diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 index 1dc7f9d0d202e16f891df661ffc484e8cae9f9d0..811b8e06f9cc10a211bfed82dcc1bd883cb8ab05 --- a/.gitignore +++ b/.gitignore @@ -1,66 +1,31 @@ -# Autosave files -*~ - -*.pc -*.obj -*.pidb -*.mdb -*/bin/* -Run/ - -# build stuff -Applications/LuaRunner/luarunner -ConsoleTest/consoletest -tests/KeraLua.dll -tests/KopiLua.dll -tests/NLua.dll -tests/NLuaTest.dll -tests/nunit.framework.dll - -#ignore thumbnails created by windows -Thumbs.db -#Ignore files build by Visual Studio -*.obj -*.exe -*.pdb -*.user -*.aps -*.pch -*.vspscc -*_i.c -*_p.c -*.ncb -*.suo -*.tlb -*.tlh -*.bak -*.cache -*.ilk -*.log -[Bb]in -[Dd]ebug*/ -*.lib -*.sbr -obj/ -[Rr]elease*/ -_ReSharper*/ -[Tt]est[Rr]esult* -UpgradeLog.XML -*.ReSharper -*.userprefs - -# http://www.gnu.org/software/automake - -Makefile -Makefile.in - -# http://www.gnu.org/software/autoconf - -/autom4te.cache -/aclocal.m4 -/compile -/configure -/depcomp -/install-sh -/missing -/config.status +*.userprefs +src/bin +src/obj +tests/bin +tests/obj +build/net45/obj/ +build/netstandard1.0/bin/ +build/netstandard1.0/obj/ +build/netstandard1.3/bin/ +build/netstandard1.3/obj/ +build/netstandard1.6/bin/ +build/netstandard1.6/obj/ +build/netstandard2.0/bin/ +build/netstandard2.0/obj/ +build/portable-net45+win8+wp8/obj/ +build/portable-net45+win8+wpa81/obj/Debug/CoreCompileInputs.cache +build/portable-net45+win8+wpa81/obj/ +lib/Debug/ +lib/Release/ +.vs/ +build/Android/obj/ +build/TVOS/obj/ +build/WatchOS/obj/ +build/XamariniOS/obj/ +build/XamarinMac/obj/ +build/netcore/obj/ +tests/build/net45/bin/Debug/KeraLua.dll +tests/build/net45/bin/ +tests/build/net45/obj/ +tests/build/netcore/bin/ +tests/build/netcore/obj/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 14daff709a4e151386d308fbd6d5413b239fde14..0000000000000000000000000000000000000000 --- a/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "Core/KopiLua"] - path = Core/KopiLua - url = git://github.com/NLua/KopiLua.git -[submodule "Core/KeraLua"] - path = Core/KeraLua - url = git://github.com/NLua/KeraLua.git -[submodule "tests/LuaTests"] - path = tests/LuaTests - url = git://github.com/NLua/LuaTests.git diff --git a/.travis.yml b/.travis.yml index c43b11187d010c9970b57c051a3db2ee0d0decf1..b62ccec33943d429f327de40f365677d5b8e0a30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,20 @@ # -# lua Travis-CI Hook +# NLua Travis-CI Hook # -# Travis language: c(sharp) :-P language: csharp before_install: - - date -u - - uname -a - - export PATH=/opt/mono/bin:$PATH - - env | sort + - export PATH=/opt/mono/bin:$PATH -install: ./CI/travis.${TRAVIS_OS_NAME}.install.deps.sh +install: + - sudo apt-get install mono-devel nunit nuget script: - - git submodule update --init --recursive - - ./run_all.linux64.sh + - nuget restore + - msbuild /p:Configuration=Release /t:Restore + - msbuild /p:Configuration=Release + - nunit-console ./tests/build/net45/bin/Release/NLuaTest.dll # Execute additional tests or commands #after_script: @@ -32,4 +31,4 @@ notifications: - viniciusjarina@gmail.com email: on_success: change - on_failure: always \ No newline at end of file + on_failure: always diff --git a/Applications/LuaRunner/LuaNetRunner.cs b/Applications/LuaRunner/LuaNetRunner.cs deleted file mode 100644 index 6f9066fb5f8e7ba50d510d29e10a4b1b30fd8d44..0000000000000000000000000000000000000000 --- a/Applications/LuaRunner/LuaNetRunner.cs +++ /dev/null @@ -1,485 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -using System; -using System.Threading; -using NLua; -using System.Collections.Generic; - -/* - * Application to run Lua scripts that can use NLua - * from the console - * - * Author: Fabio Mascarenhas - * Version: 1.0 - */ -namespace NLua -{ - public class LuaNetRunner - { - const string lua_script = @"-- lua.lua - Lua 5.1 interpreter (lua.c) reimplemented in Lua. --- --- WARNING: This is not completed but was quickly done just an experiment. --- Fix omissions/bugs and test if you want to use this in production. --- Particularly pay attention to error handling. --- --- (c) David Manura, 2008-08 --- Licensed under the same terms as Lua itself. --- Based on lua.c from Lua 5.1.3. --- Improvements by Shmuel Zeigerman. - --- Variables analogous to those in luaconf.h -local LUA_INIT = ""LUA_INIT"" -local LUA_PROGNAME = ""lua"" -local LUA_PROMPT = ""> "" -local LUA_PROMPT2 = "">> "" -local function LUA_QL(x) return ""'"" .. x .. ""'"" end - -local lua51 = _VERSION:match '5%.1$' --- Variables analogous to those in lua.h -local LUA_RELEASE, LUA_COPYRIGHT, eof_ender -if lua51 then - LUA_RELEASE = ""Lua 5.1.4"" - LUA_COPYRIGHT = ""Copyright (C) 1994-2008 Lua.org, PUC-Rio"" - eof_ender = LUA_QL("""") -else - LUA_RELEASE = ""Lua 5.2.2"" - LUA_COPYRIGHT = ""Copyright (C) 1994-2013 Lua.org, PUC-Rio"" - eof_ender = '' -end -local EXTRA_COPYRIGHT = ""lua.lua (c) David Manura, 2008-08"" - --- Note: don't allow user scripts to change implementation. --- Check for globals with ""cat lua.lua | luac -p -l - | grep ETGLOBAL"" - -local _G = _G -local assert = assert -local collectgarbage = collectgarbage -local loadfile = loadfile -local loadstring = loadstring or load -local pcall = pcall -local rawget = rawget -local select = select -local tostring = tostring -local type = type -local unpack = unpack or table.unpack -local xpcall = xpcall -local io_stderr = io.stderr -local io_stdout = io.stdout -local io_stdin = io.stdin -local string_format = string.format -local string_sub = string.sub -local os_getenv = os.getenv -local os_exit = os.exit - - -local progname = LUA_PROGNAME - --- Use external functions, if available -local lua_stdin_is_tty = function() return true end -local setsignal = function() end - -local function print_usage() - io_stderr:write(string_format( - ""usage: %s [options] [script [args]].\n"" .. - ""Available options are:\n"" .. - "" -e stat execute string "" .. LUA_QL(""stat"") .. ""\n"" .. - "" -l name require library "" .. LUA_QL(""name"") .. ""\n"" .. - "" -i enter interactive mode after executing "" .. - LUA_QL(""script"") .. ""\n"" .. - "" -v show version information\n"" .. - "" -- stop handling options\n"" .. - "" - execute stdin and stop handling options\n"" - , - progname)) - io_stderr:flush() -end - -local our_tostring = tostring - -local tuple = table.pack or function(...) - return {n=select('#', ...), ...} -end - -local using_lsh,lsh - -local function our_print (...) - local args = tuple(...) - for i = 1,args.n do - io.write(our_tostring(args[i]),'\t') - end - _G._ = args[1] - io.write '\n' -end - -local function saveline(s) - if using_lsh then - lsh.saveline(s) - end -end - -local function getline(prmt) - if using_lsh then - return lsh.readline(prmt) - else - io_stdout:write(prmt) - io_stdout:flush() - return io_stdin:read'*l' - end -end - -local function l_message (pname, msg) - if pname then io_stderr:write(string_format(""%s: "", pname)) end - io_stderr:write(string_format(""%s\n"", msg)) - io_stderr:flush() -end - -local function report(status, msg) - if not status and msg ~= nil then - msg = tostring(msg) ---~ msg = (type(msg) == 'string' or type(msg) == 'number') and tostring(msg) ---~ or ""(error object is not a string)"" - l_message(progname, msg); - end - return status -end - -local function traceback (message) - local tp = type(message) - if tp ~= ""string"" and tp ~= ""number"" then return message end - local debug = _G.debug - if type(debug) ~= ""table"" then return message end - local tb = debug.traceback - if type(tb) ~= ""function"" then return message end - return tb(message, 2) -end - -local function docall(f, ...) - local tp = {...} -- no need in tuple (string arguments only) - local F = function() return f(unpack(tp)) end - setsignal(true) - local result = tuple(xpcall(F, traceback)) - setsignal(false) - -- force a complete garbage collection in case of errors - if not result[1] then collectgarbage(""collect"") end - return unpack(result, 1, result.n) -end - -function dofile(name) - local f, msg = loadfile(name) - if f then f, msg = docall(f) end - return report(f, msg) -end - -local function dostring(s, name) - local f, msg = loadstring(s, name) - if f then f, msg = docall(f) end - return report(f, msg) -end - -local function dolibrary (name) - return report(docall(_G.require, name)) -end - -local function print_version() - l_message(nil, LUA_RELEASE .. "" "" .. LUA_COPYRIGHT..""\n""..EXTRA_COPYRIGHT) -end - -local function getargs (argv, n) - local arg = {} - for i=1,#argv do arg[i - n] = argv[i] end - if _G.arg then - local i = 0 - while _G.arg[i] do - arg[i - n] = _G.arg[i] - i = i - 1 - end - end - return arg -end - -local function get_prompt (firstline) - -- use rawget to play fine with require 'strict' - local pmt = rawget(_G, firstline and ""_PROMPT"" or ""_PROMPT2"") - local tp = type(pmt) - if tp == ""string"" or tp == ""number"" then - return tostring(pmt) - end - return firstline and LUA_PROMPT or LUA_PROMPT2 -end - -local function fetchline(firstline) - return getline(get_prompt(firstline)) -end - -local function incomplete (msg) - if msg then - if string_sub(msg, -#eof_ender) == eof_ender then - return true - end - end - return false -end - - -local function pushline (firstline) - local fine,b = true - repeat - b = fetchline(firstline) - if not b then return end -- no input - if using_lsh then - fine = lsh.checkline(b) - end - until fine - if firstline and string_sub(b, 1, 1) == '=' then - return ""return "" .. string_sub(b, 2) -- change '=' to `return' - else - return b - end -end - - -local function loadline () - local b = pushline(true) - if not b then return -1 end -- no input - local f, msg - while true do -- repeat until gets a complete line - f, msg = loadstring(b, ""=stdin"") - if not incomplete(msg) then break end -- cannot try to add lines? - local b2 = pushline(false) - if not b2 then -- no more input? - return -1 - end - b = b .. ""\n"" .. b2 -- join them - end - - saveline(b) - - return f, msg -end - - -local function dotty () - local oldprogname = progname - progname = nil - using_lsh,lsh = false -- pcall(require, 'luaish') blows with LI ?? - if using_lsh then - our_tostring = lsh.tostring - else - --print('problem loading luaish:',lsh) - our_tostring = tostring - end - while true do - local result - local status, msg = loadline() - if status == -1 then break end - if status then - result = tuple(docall(status)) - status, msg = result[1], result[2] - end - report(status, msg) - if status and result.n > 1 then -- any result to print? - status, msg = pcall(our_print, unpack(result, 2, result.n)) - if not status then - l_message(progname, string_format( - ""error calling %s (%s)"", - LUA_QL(""print""), msg)) - end - end - end - io_stdout:write""\n"" - io_stdout:flush() - progname = oldprogname -end - - -local function handle_script(argv, n) - _G.arg = getargs(argv, n) -- collect arguments - local fname = argv[n] - if fname == ""-"" and argv[n-1] ~= ""--"" then - fname = nil -- stdin - end - local status, msg = loadfile(fname) - if status then - status, msg = docall(status, unpack(_G.arg)) - end - return report(status, msg) -end - - -local function collectargs (argv, p) - local i = 1 - while i <= #argv do - if string_sub(argv[i], 1, 1) ~= '-' then -- not an option? - return i - end - local prefix = string_sub(argv[i], 1, 2) - if prefix == '--' then - if #argv[i] > 2 then return -1 end - return argv[i+1] and i+1 or 0 - elseif prefix == '-' then - return i - elseif prefix == '-i' then - if #argv[i] > 2 then return -1 end - p.i = true - p.v = true - elseif prefix == '-v' then - if #argv[i] > 2 then return -1 end - p.v = true - elseif prefix == '-e' then - p.e = true - if #argv[i] == 2 then - i = i + 1 - if argv[i] == nil then return -1 end - end - elseif prefix == '-l' then - if #argv[i] == 2 then - i = i + 1 - if argv[i] == nil then return -1 end - end - else - return -1 -- invalid option - end - i = i + 1 - end - return 0 -end - - -local function runargs(argv, n) - local i = 1 - while i <= n do if argv[i] then - assert(string_sub(argv[i], 1, 1) == '-') - local c = string_sub(argv[i], 2, 2) -- option - if c == 'e' then - local chunk = string_sub(argv[i], 3) - if chunk == '' then i = i + 1; chunk = argv[i] end - assert(chunk) - if not dostring(chunk, ""=(command line)"") then return false end - elseif c == 'l' then - local filename = string_sub(argv[i], 3) - if filename == '' then i = i + 1; filename = argv[i] end - assert(filename) - if not dolibrary(filename) then return false end - end - i = i + 1 - end end - return true -end - - -local function handle_luainit() - local init = os_getenv(LUA_INIT) - if init == nil then - return -- status OK - elseif string_sub(init, 1, 1) == '@' then - dofile(string_sub(init, 2)) - else - dostring(init, ""="" .. LUA_INIT) - end -end - - -if _G.arg and _G.arg[0] and #_G.arg[0] > 0 then progname = _G.arg[0] end -local argv = arg -handle_luainit() -local has = {i=false, v=false, e=false} -local script = collectargs(argv, has) -if script < 0 then -- invalid args? - print_usage() - os_exit(1) -end -if has.v then print_version() end -local status = runargs(argv, (script > 0) and script-1 or #argv) -if not status then os_exit(1) end -if script ~= 0 then - status = handle_script(argv, script) - if not status then os_exit(1) end -else - _G.arg = nil -end -if has.i then - dotty() -elseif script == 0 and not has.e and not has.v then - if lua_stdin_is_tty() then - print_version() - import 'System' - dotty() - else dofile(nil) -- executes stdin as a file - end -end -"; - /* - * Runs the Lua script passed as the first command-line argument. - * It passed all the command-line arguments to the script. - */ - [STAThread] - public static void Main(string[] args) - { - try { - - using (Lua lua = new Lua ()) { - //lua.OpenLibs(); // steffenj: Lua 5.1.1 API change (all libs already opened in Lua constructor!) - lua.NewTable ("arg"); - LuaTable argc = (LuaTable)lua ["arg"]; - - argc [0] = "NLua"; - - for (int i = 0; i < args.Length; i++) { - argc [i + 1] = args [i]; - } - - argc ["n"] = args.Length; - - lua.LoadCLRPackage (); - - try { - lua.DoString (lua_script,"lua"); - } catch (Exception e) { - // limit size of stack traceback message to roughly 1 console screen height - string trace = e.StackTrace; - - if (e.StackTrace.Length > 1300) - trace = e.StackTrace.Substring (0, 1300) + " [...] (traceback cut short)"; - - Console.WriteLine (); - Console.WriteLine (e.Message); - Console.WriteLine (e.Source + " raised a " + e.GetType ().ToString ()); - Console.WriteLine (trace); - - // wait for key press if there is an error - Console.ReadKey (); - } - } - } catch (Exception e) { - Console.WriteLine (); - Console.WriteLine (e.Message); - Console.WriteLine (e.Source + " raised a " + e.GetType ().ToString ()); - - Console.ReadKey (); - } - } - } -} \ No newline at end of file diff --git a/Applications/LuaRunner/Makefile.am b/Applications/LuaRunner/Makefile.am deleted file mode 100644 index e2d4738c3268d05de3ff5600577f162168794132..0000000000000000000000000000000000000000 --- a/Applications/LuaRunner/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ - -EXTRA_DIST = - -#Warning: This is an automatically generated file, do not edit! -if ENABLE_DEBUG - SUBDIRS = . -endif -if ENABLE_DEBUGKOPILUA - SUBDIRS = . -endif -if ENABLE_RELEASE - SUBDIRS = . -endif -if ENABLE_RELEASEKOPILUA - SUBDIRS = . -endif -if ENABLE_DEBUG_X64 - SUBDIRS = . -endif -if ENABLE_RELEASE_X64 - SUBDIRS = . -endif -if ENABLE_DEBUGKOPILUA_X64 - SUBDIRS = . -endif -if ENABLE_RELEASEKOPILUA_X64 - SUBDIRS = . -endif - -# Projekt-specifikus makefile beszúrása -include NLua.40.make \ No newline at end of file diff --git a/Applications/LuaRunner/NLua.40.csproj b/Applications/LuaRunner/NLua.40.csproj deleted file mode 100644 index 3db070c179b1c814a055be5d41ebe51e96a24eed..0000000000000000000000000000000000000000 --- a/Applications/LuaRunner/NLua.40.csproj +++ /dev/null @@ -1,138 +0,0 @@ - - - - Debug - AnyCPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5} - Exe - Properties - NLua - NLua - 2.x - v4.0 - - - - True - full - False - ..\..\tests\ - DEBUG - prompt - 4 - AllRules.ruleset - true - - - none - True - ..\..\tests\ - RELEASE - prompt - 4 - AnyCPU - AllRules.ruleset - - - True - full - False - ..\..\Run\Debug_x64 - DEBUG - prompt - 4 - x64 - AllRules.ruleset - - - none - True - ..\..\Run\Release_x64 - RELEASE - prompt - 4 - x64 - AllRules.ruleset - - - true - ..\..\tests\ - DEBUG - full - AnyCPU - prompt - AllRules.ruleset - 4 - false - - - true - bin\x64\DebugKopiLua\ - DEBUG - full - x64 - prompt - AllRules.ruleset - 4 - false - - - ..\..\tests\ - 4 - false - - - bin\x64\ReleaseKopiLua\ - 4 - false - - - NLua.ico - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - {F55CABBB-4108-4A39-94E1-581FD46DC021} - NLua.Net40 - - - - - - - - \ No newline at end of file diff --git a/Applications/LuaRunner/NLua.40.make b/Applications/LuaRunner/NLua.40.make deleted file mode 100644 index 7463ef0a6eccd5d09e4005d68637196b7048e180..0000000000000000000000000000000000000000 --- a/Applications/LuaRunner/NLua.40.make +++ /dev/null @@ -1,264 +0,0 @@ - - -# Warning: This is an automatically generated file, do not edit! - -if ENABLE_DEBUG -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" -ASSEMBLY = ../../tests/NLua.exe -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../../Run/Debug/net40/NLua.dll -BUILD_DIR = ../../tests/ - -NLUA_EXE_MDB_SOURCE=../../tests/NLua.exe.mdb -NLUA_EXE_MDB=$(BUILD_DIR)/NLua.exe.mdb -NLUA_EXE_CONFIG_SOURCE=app.config -NLUA_DLL_SOURCE=../../Run/Debug/net40/NLua.dll -NLUA_DLL_MDB_SOURCE=../../Run/Debug/net40/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../../Core/KopiLua/Bin/Debug/net40/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../../Core/KopiLua/Bin/Debug/net40/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb - -endif - -if ENABLE_DEBUGKOPILUA -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" -ASSEMBLY = ../../tests/NLua.exe -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../../Core/NLua/bin/DebugKopiLua/NLua.dll -BUILD_DIR = ../../tests/ - -NLUA_EXE_MDB_SOURCE=../../tests/NLua.exe.mdb -NLUA_EXE_MDB=$(BUILD_DIR)/NLua.exe.mdb -NLUA_EXE_CONFIG_SOURCE=app.config -NLUA_DLL_SOURCE=../../Core/NLua/bin/DebugKopiLua/NLua.dll -NLUA_DLL_MDB_SOURCE=../../Core/NLua/bin/DebugKopiLua/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../../Core/KeraLua/src/bin/DebugKopiLua/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../../Core/KeraLua/src/bin/DebugKopiLua/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../../Core/KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../../Core/KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb - -endif - -if ENABLE_RELEASE -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:RELEASE" -ASSEMBLY = ../../tests/NLua.exe -ASSEMBLY_MDB = -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../../Run/Release/net40/NLua.dll -BUILD_DIR = ../../tests/ - -NLUA_EXE_MDB= -NLUA_EXE_CONFIG_SOURCE=app.config -NLUA_DLL_SOURCE=../../Run/Release/net40/NLua.dll -NLUA_DLL_MDB= -KERALUA_DLL_SOURCE=../../Core/KeraLua/src/bin/Release/net40/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../../Core/KopiLua/Bin/Release/net40/KopiLua.dll -KOPILUA_DLL_MDB= - -endif - -if ENABLE_RELEASEKOPILUA -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -ASSEMBLY = ../../tests/NLua.exe -ASSEMBLY_MDB = -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../../Core/NLua/bin/ReleaseKopiLua/NLua.dll -BUILD_DIR = ../../tests/ - -NLUA_EXE_MDB= -NLUA_EXE_CONFIG_SOURCE=app.config -NLUA_DLL_SOURCE=../../Core/NLua/bin/ReleaseKopiLua/NLua.dll -NLUA_DLL_MDB= -KERALUA_DLL_SOURCE=../../Core/KeraLua/src/bin/ReleaseKopiLua/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../../Core/KopiLua/KopiLua/bin/ReleaseKopiLua/KopiLua.dll -KOPILUA_DLL_MDB= - -endif - -if ENABLE_DEBUG_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" -ASSEMBLY = ../../Run/Debug_x64/NLua.exe -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../../Run/Debug/net40/NLua.dll -BUILD_DIR = ../../Run/Debug_x64 - -NLUA_EXE_MDB_SOURCE=../../Run/Debug_x64/NLua.exe.mdb -NLUA_EXE_MDB=$(BUILD_DIR)/NLua.exe.mdb -NLUA_EXE_CONFIG_SOURCE=app.config -NLUA_DLL_SOURCE=../../Run/Debug/net40/NLua.dll -NLUA_DLL_MDB_SOURCE=../../Run/Debug/net40/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../../Core/KopiLua/Bin/Debug/net40/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../../Core/KopiLua/Bin/Debug/net40/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb - -endif - -if ENABLE_RELEASE_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:RELEASE" -ASSEMBLY = ../../Run/Release_x64/NLua.exe -ASSEMBLY_MDB = -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../../Run/Release/net40/NLua.dll -BUILD_DIR = ../../Run/Release_x64 - -NLUA_EXE_MDB= -NLUA_EXE_CONFIG_SOURCE=app.config -NLUA_DLL_SOURCE=../../Run/Debug/net40/NLua.dll -NLUA_DLL_MDB_SOURCE=../../Run/Debug/net40/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../../Core/KopiLua/Bin/Debug/net40/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../../Core/KopiLua/Bin/Debug/net40/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb - -endif - -if ENABLE_DEBUGKOPILUA_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" -ASSEMBLY = bin/x64/DebugKopiLua/NLua.exe -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../../Core/NLua/bin/DebugKopiLua/NLua.dll -BUILD_DIR = bin/x64/DebugKopiLua/ - -NLUA_EXE_MDB_SOURCE=bin/x64/DebugKopiLua/NLua.exe.mdb -NLUA_EXE_MDB=$(BUILD_DIR)/NLua.exe.mdb -NLUA_EXE_CONFIG_SOURCE=app.config -NLUA_DLL_SOURCE=../../Run/Debug/net40/NLua.dll -NLUA_DLL_MDB_SOURCE=../../Run/Debug/net40/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../../Core/KopiLua/Bin/Debug/net40/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../../Core/KopiLua/Bin/Debug/net40/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb - -endif - -if ENABLE_RELEASEKOPILUA_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -ASSEMBLY = bin/x64/ReleaseKopiLua/NLua.exe -ASSEMBLY_MDB = -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../../Core/NLua/bin/ReleaseKopiLua/NLua.dll -BUILD_DIR = bin/x64/ReleaseKopiLua/ - -NLUA_EXE_MDB= -NLUA_EXE_CONFIG_SOURCE=app.config -NLUA_DLL_SOURCE=../../Run/Debug/net40/NLua.dll -NLUA_DLL_MDB_SOURCE=../../Run/Debug/net40/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../../Core/KopiLua/Bin/Debug/net40/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../../Core/KopiLua/Bin/Debug/net40/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb - -endif - -AL=al -SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll - -PROGRAMFILES = \ - $(NLUA_EXE_MDB) \ - $(NLUA_EXE_CONFIG) \ - $(NLUA_DLL) \ - $(NLUA_DLL_MDB) \ - $(KERALUA_DLL) \ - $(KERALUA_DLL_MDB) \ - $(KOPILUA_DLL) \ - $(KOPILUA_DLL_MDB) - -BINARIES = \ - $(NLUA_40) - - -RESGEN=resgen2 - -all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) - -FILES = \ - LuaNetRunner.cs \ - Properties/AssemblyInfo.cs - -DATA_FILES = - -RESOURCES = - -EXTRAS = \ - app.config \ - NLua.ico \ - nlua.40.in - -REFERENCES = \ - System \ - System.Data \ - System.Xml - -DLL_REFERENCES = - -CLEANFILES = $(PROGRAMFILES) $(BINARIES) - -include $(top_srcdir)/Makefile.include - -NLUA_EXE_CONFIG = $(BUILD_DIR)/NLua.exe.config -NLUA_DLL = $(BUILD_DIR)/NLua.dll -KERALUA_DLL = $(BUILD_DIR)/KeraLua.dll -KOPILUA_DLL = $(BUILD_DIR)/KopiLua.dll -NLUA_40 = $(BUILD_DIR)/nlua.40 - -$(eval $(call emit-deploy-target,NLUA_EXE_CONFIG)) -$(eval $(call emit-deploy-target,NLUA_DLL)) -$(eval $(call emit-deploy-target,NLUA_DLL_MDB)) -$(eval $(call emit-deploy-target,KERALUA_DLL)) -$(eval $(call emit-deploy-target,KERALUA_DLL_MDB)) -$(eval $(call emit-deploy-target,KOPILUA_DLL)) -$(eval $(call emit-deploy-target,KOPILUA_DLL_MDB)) -$(eval $(call emit-deploy-wrapper,NLUA_40,nlua.40,x)) - - -$(eval $(call emit_resgen_targets)) -$(build_xamlg_list): %.xaml.g.cs: %.xaml - xamlg '$<' - -$(ASSEMBLY_MDB): $(ASSEMBLY) - -$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) - mkdir -p $(shell dirname $(ASSEMBLY)) - $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) diff --git a/Applications/LuaRunner/NLua.csproj b/Applications/LuaRunner/NLua.csproj deleted file mode 100644 index 9d1205eb16088ba77b2bac3a500ce9961c865a76..0000000000000000000000000000000000000000 --- a/Applications/LuaRunner/NLua.csproj +++ /dev/null @@ -1,138 +0,0 @@ - - - - Debug - AnyCPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5} - Exe - Properties - NLua - NLua - 1.3.2 - v4.5 - - - - True - full - False - ..\..\tests\ - DEBUG - prompt - 4 - AllRules.ruleset - true - - - none - True - ..\..\tests\ - RELEASE - prompt - 4 - AnyCPU - AllRules.ruleset - - - True - full - False - ..\..\Run\Debug_x64 - DEBUG - prompt - 4 - x64 - AllRules.ruleset - - - none - True - ..\..\Run\Release_x64 - RELEASE - prompt - 4 - x64 - AllRules.ruleset - - - true - ..\..\tests\ - DEBUG - full - AnyCPU - prompt - AllRules.ruleset - 4 - false - - - true - bin\x64\DebugKopiLua\ - DEBUG - full - x64 - prompt - AllRules.ruleset - 4 - false - - - ..\..\tests\ - 4 - false - - - bin\x64\ReleaseKopiLua\ - 4 - false - - - NLua.ico - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - - {F55CABBB-4108-4A39-94E1-581FD46DC021} - NLua.Net45 - - - \ No newline at end of file diff --git a/Applications/LuaRunner/NLua.ico b/Applications/LuaRunner/NLua.ico deleted file mode 100644 index 77c174bad12deea5ce7c6dda45810c2fa4440b95..0000000000000000000000000000000000000000 Binary files a/Applications/LuaRunner/NLua.ico and /dev/null differ diff --git a/Applications/LuaRunner/Properties/AssemblyInfo.cs b/Applications/LuaRunner/Properties/AssemblyInfo.cs deleted file mode 100644 index 925608de0a6b782155e81d5e8c439f67ec60540f..0000000000000000000000000000000000000000 --- a/Applications/LuaRunner/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using NLua.Config; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("LuaRunner")] -[assembly: AssemblyDescription(Consts.NLuaDescription)] -[assembly: AssemblyConfiguration(Consts.NLuaConfiguration)] -[assembly: AssemblyCompany(Consts.NLuaCompany)] -[assembly: AssemblyProduct(Consts.NLuaProduct)] -[assembly: AssemblyCopyright(Consts.NLuaCopyright)] -[assembly: AssemblyTrademark(Consts.NLuaTrademark)] - -// 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)] - -// 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.5.2")] -[assembly: AssemblyFileVersion("1.5.2")] \ No newline at end of file diff --git a/Applications/LuaRunner/app.config b/Applications/LuaRunner/app.config deleted file mode 100644 index cb2586beb1dbb3ea3773ec7384aa1f440c2e1ba8..0000000000000000000000000000000000000000 --- a/Applications/LuaRunner/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/Applications/LuaRunner/nlua.40.in b/Applications/LuaRunner/nlua.40.in deleted file mode 100644 index 90bb4419c9dbaab8ca9698903b1d56155c54491e..0000000000000000000000000000000000000000 --- a/Applications/LuaRunner/nlua.40.in +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec mono "@expanded_libdir@/@PACKAGE@/NLua.exe" "$@" diff --git a/BuildFunctions.ps1 b/BuildFunctions.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..5189dc661f56a4378d74953050ff1dda44a7f890 --- /dev/null +++ b/BuildFunctions.ps1 @@ -0,0 +1,300 @@ +function Get-Current-Branch-Name () +{ + $branch = ([string](git rev-parse --abbrev-ref HEAD)).Trim() + $parts = $branch.Split('/') + $branch = $parts[$parts.Length - 1] + return $branch +} + +function Get-Current-Commit-Hash () +{ + return ([string](git log -1 --pretty=%h)).Trim() +} + +function Get-Current-Commit-Message () +{ + return ([string](git log -1 --pretty=%B)).Trim() +} + +function Test-Should-Deploy () +{ + $nugetGitVersion = Get-Git-Package-Version + $buildMetaData = Get-Git-Build-MetaData + $fullSemVer = Get-Git-Full-Sem-Ver + + if (Test-Tag-Build $nugetGitVersion $buildMetaData $fullSemVer) { + return $true + } + return $false +} + +function Get-Published-PreRelase-Package ($PackageId) +{ + $out = [string](nuget list -PreRelease id:$PackageId) + $version = $out.Split(' ')[1] + return $version +} + +function Get-Published-PreRelase-Package-Version ($PackageId) +{ + $version = Get-Published-PreRelase-Package $PackageId + $version = $version.Split('-')[0] + return $version +} + +function Get-Published-Package ($PackageId) +{ + $out = [string](nuget list id:$PackageId) + $version = $out.Split(' ')[1] + return $version +} + +function Get-Published-Package-Version ($PackageId) +{ + $version = Get-Published-Package $PackageId + $version = $version.Split('-')[0] + return $version +} + +function Get-Git-Package-Version () +{ + Update-Ensure-Git-Not-Detached + return [string](gitversion /showvariable MajorMinorPatch) +} + +function Get-Git-Build-MetaData () +{ + Update-Ensure-Git-Not-Detached + return [string](gitversion /showvariable BuildMetaData) +} + +function Get-Git-Full-Sem-Ver () +{ + Update-Ensure-Git-Not-Detached + + return [string](gitversion /showvariable FullSemVer) +} + +function Update-NuSpec-Release-Notes($File, $releaseNotes) +{ + $File = Resolve-Path $File + + [xml] $fileContents = Get-Content -Encoding UTF8 -Path $File + + $releaseNotesPath = "package.metadata.releaseNotes" + + if ($releaseNotes -ne $null -and $releaseNotes -ne "") { + Set-XmlElementsTextValue -XmlDocument $fileContents -ElementPath $releaseNotesPath -TextValue $releaseNotes + } + $fileContents.Save($File) +} + +function Update-NuSpec-Version($File, $Version) +{ + $File = Resolve-Path $File + + [xml] $fileContents = Get-Content -Encoding UTF8 -Path $File + + $versionPath = "package.metadata.version" + + if ($Version -ne $null -and $Version -ne "") { + Set-XmlElementsTextValue -XmlDocument $fileContents -ElementPath $versionPath -TextValue $Version + } + + $fileContents.Save($File) +} + +function Get-XmlNamespaceManager([xml]$XmlDocument, [string]$NamespaceURI = "") +{ + # If a Namespace URI was not given, use the Xml document's default namespace. + if ([string]::IsNullOrEmpty($NamespaceURI)) { $NamespaceURI = $XmlDocument.DocumentElement.NamespaceURI } + + # In order for SelectSingleNode() to actually work, we need to use the fully qualified node path along with an Xml Namespace Manager, so set them up. + [System.Xml.XmlNamespaceManager]$xmlNsManager = New-Object System.Xml.XmlNamespaceManager($XmlDocument.NameTable) + $xmlNsManager.AddNamespace("ns", $NamespaceURI) + return ,$xmlNsManager # Need to put the comma before the variable name so that PowerShell doesn't convert it into an Object[]. +} + +function Get-FullyQualifiedXmlNodePath([string]$NodePath, [string]$NodeSeparatorCharacter = '.') +{ + return "/ns:$($NodePath.Replace($($NodeSeparatorCharacter), '/ns:'))" +} + +function Get-XmlNode([xml]$XmlDocument, [string]$NodePath, [string]$NamespaceURI = "", [string]$NodeSeparatorCharacter = '.') +{ + $xmlNsManager = Get-XmlNamespaceManager -XmlDocument $XmlDocument -NamespaceURI $NamespaceURI + [string]$fullyQualifiedNodePath = Get-FullyQualifiedXmlNodePath -NodePath $NodePath -NodeSeparatorCharacter $NodeSeparatorCharacter + + # Try and get the node, then return it. Returns $null if the node was not found. + $node = $XmlDocument.SelectSingleNode($fullyQualifiedNodePath, $xmlNsManager) + return $node +} + +function Set-XmlElementsTextValue([xml]$XmlDocument, [string]$ElementPath, [string]$TextValue, [string]$NamespaceURI = "", [string]$NodeSeparatorCharacter = '.') +{ + # Try and get the node. + $node = Get-XmlNode -XmlDocument $XmlDocument -NodePath $ElementPath -NamespaceURI $NamespaceURI -NodeSeparatorCharacter $NodeSeparatorCharacter + + # If the node already exists, update its value. + if ($node) + { + $node.InnerText = $TextValue + } + # Else the node doesn't exist yet, so create it with the given value. + else + { + # Create the new element with the given value. + $elementName = $ElementPath.Substring($ElementPath.LastIndexOf($NodeSeparatorCharacter) + 1) + $element = $XmlDocument.CreateElement($elementName, $XmlDocument.DocumentElement.NamespaceURI) + $textNode = $XmlDocument.CreateTextNode($TextValue) + $element.AppendChild($textNode) > $null + + # Try and get the parent node. + $parentNodePath = $ElementPath.Substring(0, $ElementPath.LastIndexOf($NodeSeparatorCharacter)) + $parentNode = Get-XmlNode -XmlDocument $XmlDocument -NodePath $parentNodePath -NamespaceURI $NamespaceURI -NodeSeparatorCharacter $NodeSeparatorCharacter + + if ($parentNode) + { + $parentNode.AppendChild($element) > $null + } + else + { + throw "$parentNodePath does not exist in the xml." + } + } +} + +function Test-Tag-Build ($nugetGitVersion, $buildMetaData, $fullSemVer) { + if ([string]::IsNullOrEmpty($buildMetaData) -and $fullSemVer -eq $nugetGitVersion) { + return $true + } + return $false +} + +function Test-Stable-Release ($stableVersion, $preReleaseVersion, $nugetGitVersion, $buildMetaData, $fullSemVer) +{ + # This is unlikelly to heppen, but could happen if the tag creation didn't triggered the Package + if ($stableVersion -ne $preReleaseVersion -and $preReleaseVersion -ne $nugetGitVersion) { + return 1 + } + if (Test-Tag-Build $nugetGitVersion $buildMetaData $fullSemVer) { + return 2 + } + return 0 +} + +function Set-Forced-Git-Version ($version) +{ + Write-Output "next-version: $version" > GitVersion.yml +} + +function Get-Prefix-Name () +{ + $branchName = Get-Current-Branch-Name + + if ($branchName -ne "master") { + return $branchName + } + return "beta" +} + +function Get-Next-Version-String ($PackageId) +{ + $stableVersion = Get-Published-Package-Version ($PackageId) + $preReleaseVersion = Get-Published-PreRelase-Package-Version ($PackageId) + + $nugetGitVersion = Get-Git-Package-Version + $buildMetaData = Get-Git-Build-MetaData + $fullSemVer = Get-Git-Full-Sem-Ver + + $prefix = Get-Prefix-Name + $prefix = $prefix.Replace("-", "") + $prefix = $prefix.Replace("_", "") + $prefix = $prefix.Replace(".", "") + $nextVersion = "" + + $stable = Test-Stable-Release $stableVersion $preReleaseVersion $nugetGitVersion $buildMetaData $fullSemVer + if ($stable -eq 1){ + $nextVersion = $preReleaseVersion + Set-Forced-Git-Version $nextVersion + } elseif ($stable -eq 2) { + $nextVersion = $nugetGitVersion + } else { + $nextVersion = "$($nugetGitVersion)-$($prefix)-build$($buildMetaData)" + } + return $nextVersion +} + +function Test-Version-Stable-Release ($version) +{ + $count = $version.Split("-").Length + if ($count -eq 3) { + return $false + } + return $true +} + +function Test-Package-Already-Published ($PackageId, $nextVersion) +{ + if (Test-Version-Stable-Release $nextVersion) { + $publishedVersion = Get-Published-Package $PackageId + if ($publishedVersion -eq $nextVersion) { + return $true + } + return $false + } + + $buildMetaData = Get-Git-Build-MetaData + $currentVersion = $nextVersion.Split('-')[0] + + [int]$currentBuild = [Convert]::ToInt32($buildMetaData, 10) + $currentPrefix = Get-Prefix-Name + + $version = Get-Published-PreRelase-Package $PackageId + #if the latest pre-relese returned is a stable release + if (Test-Version-Stable-Release $version) { + return $false + } + + $publishedVersion = $version.Split('-')[0] + $publishedPrefix = $version.Split('-')[1] + $build = $version.Split('-')[2] + $build = $build.Replace("build", "") + [int]$publishedBuild = [Convert]::ToInt32($build, 10) + + if ($currentVersion -ne $publishedVersion) { + return $false + } + if ($currentPrefix -ne $publishedPrefix) { + return $false + } + if ($currentBuild -gt $publishedPrefix) { + return $false + } + return $true +} + +function Test-Git-Detached () +{ + $output = [string](git branch | head -1) + $detached = $output.Contains("detached") + return $detached +} + +function Get-Git-Current-Tag +{ + return [string](git describe --tags | head -1) +} + +# GitVersion only works in attached branches, if we try to build a tag from the commit hash gitversion will fail +# so we ensure we are always attached to a branch +function Update-Ensure-Git-Not-Detached () +{ + $detached = Test-Git-Detached + if (!$detached) { + return + } + $currentTag = Get-Git-Current-Tag + & git checkout -B $currentTag + # We are using -B because maybe the branch alrady exist +} diff --git a/CI/travis.linux.install.deps.sh b/CI/travis.linux.install.deps.sh deleted file mode 100755 index d4e02389d24cb8d6cdcc9381c6d0fba0c6d28712..0000000000000000000000000000000000000000 --- a/CI/travis.linux.install.deps.sh +++ /dev/null @@ -1,9 +0,0 @@ -set -ev - -sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF - -echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/3.12.0 main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list -echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list - -sudo apt-get update -sudo apt-get install mono-devel cmake nunit \ No newline at end of file diff --git a/COPYRIGHT b/COPYRIGHT deleted file mode 100644 index b5f5ac69b5e6f729dd45d02a294413f77e20ef50..0000000000000000000000000000000000000000 --- a/COPYRIGHT +++ /dev/null @@ -1,78 +0,0 @@ -NLua License --------------------- - -NLua is licensed under the terms of the MIT license reproduced below. -This mean that NLua is free software and can be used for both academic and -commercial purposes at absolutely no cost. - -=============================================================================== - -Copyright (C) 2013 - Vinicius Jarina (viniciusjarina@gmail.com) -Copyright (C) 2012 Megax -Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -=============================================================================== - -Kopi Lua License ----------------- - -Kopi Lua is licensed under the terms of the MIT license. Both the MIT -license and the original Lua copyright notice are reproduced below. - -Please see http://www.ppl-pilot.com/KopiLua for details. - -=============================================================================== - -Lua License ------------ - -Lua is licensed under the terms of the MIT license reproduced below. -This means that Lua is free software and can be used for both academic -and commercial purposes at absolutely no cost. - -For details and rationale, see http://www.lua.org/license.html . - -=============================================================================== - -Copyright (C) 1994-2008 Lua.org, PUC-Rio. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -=============================================================================== - -(end of COPYRIGHT) diff --git a/ConsoleTest/App.config b/ConsoleTest/App.config deleted file mode 100644 index fad249e406f0363449addb9c6ecaf61077d5b19b..0000000000000000000000000000000000000000 --- a/ConsoleTest/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ConsoleTest/ConsoleTest.40.csproj b/ConsoleTest/ConsoleTest.40.csproj deleted file mode 100644 index 8fc96dc30ae3e429fb0355d57b9877ff8d3c499d..0000000000000000000000000000000000000000 --- a/ConsoleTest/ConsoleTest.40.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - - Debug - AnyCPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7} - Exe - Properties - ConsoleTest - ConsoleTest - v4.0 - 512 - 2.x - - - x86 - true - full - false - ..\tests\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - bin\DebugKopiLua\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - 4 - false - - - bin\ReleaseKopiLua\ - 4 - false - - - - - - - - - - - - Entity.cs - - - TestLua.cs - - - - - - - - - - {F55CABBB-4108-4A39-94E1-581FD46DC021} - NLua.Net40 - - - {d5fcadfa-5047-40c2-b392-256875862920} - NLuaTest.40 - - - - - \ No newline at end of file diff --git a/ConsoleTest/ConsoleTest.csproj b/ConsoleTest/ConsoleTest.csproj deleted file mode 100644 index 711d6f7b315ac92c4236f31bbdfd11fc086188af..0000000000000000000000000000000000000000 --- a/ConsoleTest/ConsoleTest.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - - Debug - AnyCPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7} - Exe - Properties - ConsoleTest - ConsoleTest - v4.5 - 512 - 1.3.2 - - - x86 - true - full - false - ..\tests\ - TRACE;DEBUG - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - bin\DebugKopiLua\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - 4 - false - - - bin\ReleaseKopiLua\ - 4 - false - - - - - - - - - - - - Entity.cs - - - - - - - - - - - - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8} - KopiLua.Net45 - - - {F55CABBB-4108-4A39-94E1-581FD46DC021} - NLua.Net45 - - - {47153754-10F5-44D8-B578-F5A32B69061A} - KeraLua.Net45 - - - {D5FCADFA-5047-40C2-B392-256875862920} - NLuaTest - - - \ No newline at end of file diff --git a/ConsoleTest/Makefile.am b/ConsoleTest/Makefile.am deleted file mode 100644 index 5a1185703bed25a171ef0adf3dce5c6b2a30cb0b..0000000000000000000000000000000000000000 --- a/ConsoleTest/Makefile.am +++ /dev/null @@ -1,307 +0,0 @@ - -EXTRA_DIST = - -# Warning: This is an automatically generated file, do not edit! - -if ENABLE_DEBUG -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE" -ASSEMBLY = ../tests/ConsoleTest.exe -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../Run/Debug/net40/NLua.dll \ - ../tests/NLuaTest.dll -BUILD_DIR = ../tests/ - -CONSOLETEST_EXE_MDB_SOURCE=../tests/ConsoleTest.exe.mdb -CONSOLETEST_EXE_MDB=$(BUILD_DIR)/ConsoleTest.exe.mdb -CONSOLETEST_EXE_CONFIG_SOURCE=App.config -NLUA_DLL_SOURCE=../Run/Debug/net40/NLua.dll -NLUA_DLL_MDB_SOURCE=../Run/Debug/net40/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../Core/KopiLua/Bin/Debug/net40/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../Core/KopiLua/Bin/Debug/net40/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb -NLUATEST_DLL_SOURCE=../tests/NLuaTest.dll -NLUATEST_DLL_MDB_SOURCE=../tests/NLuaTest.dll.mdb -NLUATEST_DLL_MDB=$(BUILD_DIR)/NLuaTest.dll.mdb -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll - -endif - -if ENABLE_DEBUGKOPILUA -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE" -ASSEMBLY = bin/DebugKopiLua/ConsoleTest.exe -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../Core/NLua/bin/DebugKopiLua/NLua.dll \ - ../NLuaTest/bin/DebugKopiLua/NLuaTest.dll -BUILD_DIR = bin/DebugKopiLua/ - -CONSOLETEST_EXE_MDB_SOURCE=bin/DebugKopiLua/ConsoleTest.exe.mdb -CONSOLETEST_EXE_MDB=$(BUILD_DIR)/ConsoleTest.exe.mdb -CONSOLETEST_EXE_CONFIG_SOURCE=App.config -NLUA_DLL_SOURCE=../Core/NLua/bin/DebugKopiLua/NLua.dll -NLUA_DLL_MDB_SOURCE=../Core/NLua/bin/DebugKopiLua/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/DebugKopiLua/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../Core/KeraLua/src/bin/DebugKopiLua/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../Core/KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../Core/KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb -NLUATEST_DLL_SOURCE=../NLuaTest/bin/DebugKopiLua/NLuaTest.dll -NLUATEST_DLL_MDB_SOURCE=../NLuaTest/bin/DebugKopiLua/NLuaTest.dll.mdb -NLUATEST_DLL_MDB=$(BUILD_DIR)/NLuaTest.dll.mdb -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll - -endif - -if ENABLE_RELEASE -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:TRACE" -ASSEMBLY = bin/Release/ConsoleTest.exe -ASSEMBLY_MDB = -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../Run/Release/net40/NLua.dll \ - ../tests/NLuaTest.dll -BUILD_DIR = bin/Release/ - -CONSOLETEST_EXE_MDB= -CONSOLETEST_EXE_CONFIG_SOURCE=App.config -NLUA_DLL_SOURCE=../Run/Release/net40/NLua.dll -NLUA_DLL_MDB= -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/Release/net40/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../Core/KopiLua/Bin/Release/net40/KopiLua.dll -KOPILUA_DLL_MDB= -NLUATEST_DLL_SOURCE=../tests/NLuaTest.dll -NLUATEST_DLL_MDB= -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll - -endif - -if ENABLE_RELEASEKOPILUA -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -ASSEMBLY = bin/ReleaseKopiLua/ConsoleTest.exe -ASSEMBLY_MDB = -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../Core/NLua/bin/ReleaseKopiLua/NLua.dll \ - ../tests/NLuaTest.dll -BUILD_DIR = bin/ReleaseKopiLua/ - -CONSOLETEST_EXE_MDB= -CONSOLETEST_EXE_CONFIG_SOURCE=App.config -NLUA_DLL_SOURCE=../Core/NLua/bin/ReleaseKopiLua/NLua.dll -NLUA_DLL_MDB= -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/ReleaseKopiLua/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../Core/KopiLua/KopiLua/bin/ReleaseKopiLua/KopiLua.dll -KOPILUA_DLL_MDB= -NLUATEST_DLL_SOURCE=../tests/NLuaTest.dll -NLUATEST_DLL_MDB= -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll - -endif - -if ENABLE_DEBUG_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE" -ASSEMBLY = ../tests/ConsoleTest.exe -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../Run/Debug/net40/NLua.dll \ - ../tests/NLuaTest.dll -BUILD_DIR = ../tests/ - -CONSOLETEST_EXE_MDB_SOURCE=../tests/ConsoleTest.exe.mdb -CONSOLETEST_EXE_MDB=$(BUILD_DIR)/ConsoleTest.exe.mdb -CONSOLETEST_EXE_CONFIG_SOURCE=App.config -NLUA_DLL_SOURCE=../Run/Debug/net40/NLua.dll -NLUA_DLL_MDB_SOURCE=../Run/Debug/net40/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../Core/KopiLua/Bin/Debug/net40/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../Core/KopiLua/Bin/Debug/net40/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb -NLUATEST_DLL_SOURCE=../tests/NLuaTest.dll -NLUATEST_DLL_MDB_SOURCE=../tests/NLuaTest.dll.mdb -NLUATEST_DLL_MDB=$(BUILD_DIR)/NLuaTest.dll.mdb -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll - -endif - -if ENABLE_RELEASE_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:TRACE" -ASSEMBLY = bin/Release/ConsoleTest.exe -ASSEMBLY_MDB = -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../Run/Release/net40/NLua.dll \ - ../tests/NLuaTest.dll -BUILD_DIR = bin/Release/ - -CONSOLETEST_EXE_MDB= -CONSOLETEST_EXE_CONFIG_SOURCE=App.config -NLUA_DLL_SOURCE=../Run/Release/net40/NLua.dll -NLUA_DLL_MDB= -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/Release/net40/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../Core/KopiLua/Bin/Release/net40/KopiLua.dll -KOPILUA_DLL_MDB= -NLUATEST_DLL_SOURCE=../tests/NLuaTest.dll -NLUATEST_DLL_MDB= -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll - -endif - -if ENABLE_DEBUGKOPILUA_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE" -ASSEMBLY = bin/DebugKopiLua/ConsoleTest.exe -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../Core/NLua/bin/DebugKopiLua/NLua.dll \ - ../NLuaTest/bin/DebugKopiLua/NLuaTest.dll -BUILD_DIR = bin/DebugKopiLua/ - -CONSOLETEST_EXE_MDB_SOURCE=bin/DebugKopiLua/ConsoleTest.exe.mdb -CONSOLETEST_EXE_MDB=$(BUILD_DIR)/ConsoleTest.exe.mdb -CONSOLETEST_EXE_CONFIG_SOURCE=App.config -NLUA_DLL_SOURCE=../Core/NLua/bin/DebugKopiLua/NLua.dll -NLUA_DLL_MDB_SOURCE=../Core/NLua/bin/DebugKopiLua/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/DebugKopiLua/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../Core/KeraLua/src/bin/DebugKopiLua/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../Core/KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../Core/KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb -NLUATEST_DLL_SOURCE=../NLuaTest/bin/DebugKopiLua/NLuaTest.dll -NLUATEST_DLL_MDB_SOURCE=../NLuaTest/bin/DebugKopiLua/NLuaTest.dll.mdb -NLUATEST_DLL_MDB=$(BUILD_DIR)/NLuaTest.dll.mdb -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll - -endif - -if ENABLE_RELEASEKOPILUA_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -ASSEMBLY = bin/ReleaseKopiLua/ConsoleTest.exe -ASSEMBLY_MDB = -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../Core/NLua/bin/ReleaseKopiLua/NLua.dll \ - ../tests/NLuaTest.dll -BUILD_DIR = bin/ReleaseKopiLua/ - -CONSOLETEST_EXE_MDB= -CONSOLETEST_EXE_CONFIG_SOURCE=App.config -NLUA_DLL_SOURCE=../Core/NLua/bin/ReleaseKopiLua/NLua.dll -NLUA_DLL_MDB= -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/ReleaseKopiLua/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../Core/KopiLua/KopiLua/bin/ReleaseKopiLua/KopiLua.dll -KOPILUA_DLL_MDB= -NLUATEST_DLL_SOURCE=../tests/NLuaTest.dll -NLUATEST_DLL_MDB= -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll - -endif - -AL=al -SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll - -PROGRAMFILES = \ - $(CONSOLETEST_EXE_MDB) \ - $(CONSOLETEST_EXE_CONFIG) \ - $(NLUA_DLL) \ - $(NLUA_DLL_MDB) \ - $(KERALUA_DLL) \ - $(KERALUA_DLL_MDB) \ - $(KOPILUA_DLL) \ - $(KOPILUA_DLL_MDB) \ - $(NLUATEST_DLL) \ - $(NLUATEST_DLL_MDB) \ - $(NUNIT_FRAMEWORK_DLL) - -BINARIES = \ - $(CONSOLETEST_40) - - -RESGEN=resgen2 - -all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) - -FILES = \ - ../tests/Entity.cs \ - ../tests/TestLua.cs \ - Program.cs \ - Properties/AssemblyInfo.cs - -DATA_FILES = - -RESOURCES = - -EXTRAS = \ - App.config \ - consoletest.40.in - -REFERENCES = \ - System \ - System.Core \ - System.Numerics \ - System.Xml.Linq \ - System.Data \ - System.Xml - -DLL_REFERENCES = - -CLEANFILES = $(PROGRAMFILES) $(BINARIES) - -include $(top_srcdir)/Makefile.include - -CONSOLETEST_EXE_CONFIG = $(BUILD_DIR)/ConsoleTest.exe.config -NLUA_DLL = $(BUILD_DIR)/NLua.dll -KERALUA_DLL = $(BUILD_DIR)/KeraLua.dll -KOPILUA_DLL = $(BUILD_DIR)/KopiLua.dll -NLUATEST_DLL = $(BUILD_DIR)/NLuaTest.dll -NUNIT_FRAMEWORK_DLL = $(BUILD_DIR)/nunit.framework.dll -CONSOLETEST_40 = $(BUILD_DIR)/consoletest.40 - -$(eval $(call emit-deploy-target,CONSOLETEST_EXE_CONFIG)) -$(eval $(call emit-deploy-target,NLUA_DLL)) -$(eval $(call emit-deploy-target,NLUA_DLL_MDB)) -$(eval $(call emit-deploy-target,KERALUA_DLL)) -$(eval $(call emit-deploy-target,KERALUA_DLL_MDB)) -$(eval $(call emit-deploy-target,KOPILUA_DLL)) -$(eval $(call emit-deploy-target,KOPILUA_DLL_MDB)) -$(eval $(call emit-deploy-target,NLUATEST_DLL)) -$(eval $(call emit-deploy-target,NLUATEST_DLL_MDB)) -$(eval $(call emit-deploy-target,NUNIT_FRAMEWORK_DLL)) -$(eval $(call emit-deploy-wrapper,CONSOLETEST_40,consoletest.40,x)) - - -$(eval $(call emit_resgen_targets)) -$(build_xamlg_list): %.xaml.g.cs: %.xaml - xamlg '$<' - -$(ASSEMBLY_MDB): $(ASSEMBLY) - -$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) - mkdir -p $(shell dirname $(ASSEMBLY)) - $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) diff --git a/ConsoleTest/Program.cs b/ConsoleTest/Program.cs deleted file mode 100755 index 96231ddced66930aca02aea26e1a0744da827e90..0000000000000000000000000000000000000000 --- a/ConsoleTest/Program.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NLua; -using NLuaTest.Mock; -using NLuaTest; - -namespace ConsoleTest -{ - - public class Program - { - static public void Method(int a, params int[] others) { - Console.WriteLine (a); - foreach (int val in others) - Console.WriteLine (val); - } - - static void Main (string [] args) - { - using (var l = new Lua ()) { - l.LoadCLRPackage (); - l.DoString (" import ('ConsoleTest', 'NLuaTest.Mock') "); - l.DoString (@" - e1 = Entity() - e2 = Entity ('Another world') - e3 = Entity (10) - "); - } - } - } -} diff --git a/ConsoleTest/Properties/AssemblyInfo.cs b/ConsoleTest/Properties/AssemblyInfo.cs deleted file mode 100644 index f4a250fa339169f7d15147ed111026004ec114db..0000000000000000000000000000000000000000 --- a/ConsoleTest/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 ("ConsoleTest")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("ConsoleTest")] -[assembly: AssemblyCopyright ("Copyright © 2015")] -[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 ("7c99edf7-f9ea-40fd-9ff9-c463f501e21a")] - -// 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/ConsoleTest/consoletest.40.in b/ConsoleTest/consoletest.40.in deleted file mode 100644 index 0521b34b71e01e6c5bf20e36625fc5050ca095c7..0000000000000000000000000000000000000000 --- a/ConsoleTest/consoletest.40.in +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec mono "@expanded_libdir@/@PACKAGE@/ConsoleTest.exe" "$@" diff --git a/Core/KeraLua b/Core/KeraLua deleted file mode 160000 index e5ef8341688d8a25e8cf6f6d812ab3da365399b6..0000000000000000000000000000000000000000 --- a/Core/KeraLua +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e5ef8341688d8a25e8cf6f6d812ab3da365399b6 diff --git a/Core/KopiLua b/Core/KopiLua deleted file mode 160000 index 6855aea035e73911cb01da1f1616f2f579251e65..0000000000000000000000000000000000000000 --- a/Core/KopiLua +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6855aea035e73911cb01da1f1616f2f579251e65 diff --git a/Core/Makefile.am b/Core/Makefile.am deleted file mode 100644 index f894acac7423b3756f8eb5ff0a8113df777a9ee9..0000000000000000000000000000000000000000 --- a/Core/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ - -EXTRA_DIST = - -#Warning: This is an automatically generated file, do not edit! -if ENABLE_DEBUG - SUBDIRS = KopiLua/KopiLua KeraLua/src NLua -endif -if ENABLE_DEBUGKOPILUA - SUBDIRS = KopiLua/KopiLua KeraLua/src NLua -endif -if ENABLE_RELEASE - SUBDIRS = KopiLua/KopiLua KeraLua/src NLua -endif -if ENABLE_RELEASEKOPILUA - SUBDIRS = KopiLua/KopiLua KeraLua/src NLua -endif -if ENABLE_DEBUG_X64 - SUBDIRS = KopiLua/KopiLua KeraLua/src NLua -endif -if ENABLE_RELEASE_X64 - SUBDIRS = KopiLua/KopiLua KeraLua/src NLua -endif -if ENABLE_DEBUGKOPILUA_X64 - SUBDIRS = KopiLua/KopiLua KeraLua/src NLua -endif -if ENABLE_RELEASEKOPILUA_X64 - SUBDIRS = KopiLua/KopiLua KeraLua/src NLua -endif diff --git a/Core/NLua/CheckType.cs b/Core/NLua/CheckType.cs deleted file mode 100755 index 80371a5a0a134b5a9bcd2fbe889992954466e0aa..0000000000000000000000000000000000000000 --- a/Core/NLua/CheckType.cs +++ /dev/null @@ -1,388 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Reflection; -using System.Collections.Generic; -using NLua.Method; -using NLua.Extensions; - -namespace NLua -{ - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - #endif - - /* - * Type checking and conversion functions. - * - * Author: Fabio Mascarenhas - * Version: 1.0 - */ - sealed class CheckType - { - Dictionary extractValues = new Dictionary(); - ExtractValue extractNetObject; - ObjectTranslator translator; - - public CheckType (ObjectTranslator translator) - { - this.translator = translator; - extractValues.Add(GetExtractDictionaryKey(typeof(object)), new ExtractValue(GetAsObject)); - extractValues.Add(GetExtractDictionaryKey(typeof(sbyte)), new ExtractValue(GetAsSbyte)); - extractValues.Add(GetExtractDictionaryKey(typeof(byte)), new ExtractValue(GetAsByte)); - extractValues.Add(GetExtractDictionaryKey(typeof(short)), new ExtractValue(GetAsShort)); - extractValues.Add(GetExtractDictionaryKey(typeof(ushort)), new ExtractValue(GetAsUshort)); - extractValues.Add(GetExtractDictionaryKey(typeof(int)), new ExtractValue(GetAsInt)); - extractValues.Add(GetExtractDictionaryKey(typeof(uint)), new ExtractValue(GetAsUint)); - extractValues.Add(GetExtractDictionaryKey(typeof(long)), new ExtractValue(GetAsLong)); - extractValues.Add(GetExtractDictionaryKey(typeof(ulong)), new ExtractValue(GetAsUlong)); - extractValues.Add(GetExtractDictionaryKey(typeof(double)), new ExtractValue(GetAsDouble)); - extractValues.Add(GetExtractDictionaryKey(typeof(char)), new ExtractValue(GetAsChar)); - extractValues.Add(GetExtractDictionaryKey(typeof(float)), new ExtractValue(GetAsFloat)); - extractValues.Add(GetExtractDictionaryKey(typeof(decimal)), new ExtractValue(GetAsDecimal)); - extractValues.Add(GetExtractDictionaryKey(typeof(bool)), new ExtractValue(GetAsBoolean)); - extractValues.Add(GetExtractDictionaryKey(typeof(string)), new ExtractValue(GetAsString)); - extractValues.Add(GetExtractDictionaryKey(typeof(char[])), new ExtractValue (GetAsCharArray)); - extractValues.Add(GetExtractDictionaryKey(typeof(LuaFunction)), new ExtractValue(GetAsFunction)); - extractValues.Add(GetExtractDictionaryKey(typeof(LuaTable)), new ExtractValue(GetAsTable)); - extractValues.Add(GetExtractDictionaryKey(typeof(LuaUserData)), new ExtractValue(GetAsUserdata)); - extractNetObject = new ExtractValue (GetAsNetObject); - } - - /* - * Checks if the value at Lua stack index stackPos matches paramType, - * returning a conversion function if it does and null otherwise. - */ - internal ExtractValue GetExtractor (ProxyType paramType) - { - return GetExtractor (paramType.UnderlyingSystemType); - } - - internal ExtractValue GetExtractor (Type paramType) - { - if (paramType.IsByRef) - paramType = paramType.GetElementType (); - - var extractKey = GetExtractDictionaryKey(paramType); - return extractValues.ContainsKey(extractKey) ? extractValues[extractKey] : extractNetObject; - } - - internal ExtractValue CheckLuaType (LuaState luaState, int stackPos, Type paramType) - { - var luatype = LuaLib.LuaType (luaState, stackPos); - - if (paramType.IsByRef) - paramType = paramType.GetElementType (); - - var underlyingType = Nullable.GetUnderlyingType (paramType); - - if (underlyingType != null) { - paramType = underlyingType; // Silently convert nullable types to their non null requics - } - - var extractKey = GetExtractDictionaryKey (paramType); - - bool netParamIsNumeric = paramType == typeof (int) || - paramType == typeof (uint) || - paramType == typeof (long) || - paramType == typeof (ulong) || - paramType == typeof (short) || - paramType == typeof (ushort) || - paramType == typeof (float) || - paramType == typeof (double) || - paramType == typeof (decimal) || - paramType == typeof (byte); - - // If it is a nullable - if (underlyingType != null) { - // null can always be assigned to nullable - if (luatype == LuaTypes.Nil) { - // Return the correct extractor anyways - if (netParamIsNumeric || paramType == typeof (bool)) - return extractValues [extractKey]; - return extractNetObject; - } - } - - if (paramType.Equals (typeof(object))) - return extractValues [extractKey]; - - //CP: Added support for generic parameters - if (paramType.IsGenericParameter) { - if (luatype == LuaTypes.Boolean) - return extractValues [GetExtractDictionaryKey (typeof(bool))]; - else if (luatype == LuaTypes.String) - return extractValues[GetExtractDictionaryKey (typeof(string))]; - else if (luatype == LuaTypes.Table) - return extractValues [GetExtractDictionaryKey (typeof(LuaTable))]; - else if (luatype == LuaTypes.UserData) - return extractValues [GetExtractDictionaryKey (typeof(object))]; - else if (luatype == LuaTypes.Function) - return extractValues [GetExtractDictionaryKey (typeof(LuaFunction))]; - else if (luatype == LuaTypes.Number) - return extractValues [GetExtractDictionaryKey (typeof(double))]; - } - bool netParamIsString = paramType == typeof (string) || paramType == typeof (char []); - - if (netParamIsNumeric) { - if (LuaLib.LuaIsNumber (luaState, stackPos) && !netParamIsString) - return extractValues [extractKey]; - } else if (paramType == typeof(bool)) { - if (LuaLib.LuaIsBoolean (luaState, stackPos)) - return extractValues [extractKey]; - } else if (netParamIsString) { - if (LuaLib.LuaNetIsStringStrict (luaState, stackPos)) - return extractValues [extractKey]; - else if (luatype == LuaTypes.Nil) - return extractNetObject; // kevinh - silently convert nil to a null string pointer - } else if (paramType == typeof(LuaTable)) { - if (luatype == LuaTypes.Table || luatype == LuaTypes.Nil) - return extractValues [extractKey]; - } else if (paramType == typeof(LuaUserData)) { - if (luatype == LuaTypes.UserData || luatype == LuaTypes.Nil) - return extractValues [extractKey]; - } else if (paramType == typeof(LuaFunction)) { - if (luatype == LuaTypes.Function || luatype == LuaTypes.Nil) - return extractValues [extractKey]; - } else if (typeof(Delegate).IsAssignableFrom (paramType) && luatype == LuaTypes.Function) - return new ExtractValue (new DelegateGenerator (translator, paramType).ExtractGenerated); - else if (paramType.IsInterface() && luatype == LuaTypes.Table) - return new ExtractValue (new ClassGenerator (translator, paramType).ExtractGenerated); - else if ((paramType.IsInterface() || paramType.IsClass()) && luatype == LuaTypes.Nil) { - // kevinh - allow nil to be silently converted to null - extractNetObject will return null when the item ain't found - return extractNetObject; - } else if (LuaLib.LuaType (luaState, stackPos) == LuaTypes.Table) { - if (LuaLib.LuaLGetMetafield (luaState, stackPos, "__index")) { - object obj = translator.GetNetObject (luaState, -1); - LuaLib.LuaSetTop (luaState, -2); - if (obj != null && paramType.IsAssignableFrom (obj.GetType ())) - return extractNetObject; - } else - return null; - } else { - object obj = translator.GetNetObject (luaState, stackPos); - if (obj != null && paramType.IsAssignableFrom (obj.GetType ())) - return extractNetObject; - } - - return null; - } - - Type GetExtractDictionaryKey(Type targetType) - { - return targetType; - } - - /* - * The following functions return the value in the Lua stack - * index stackPos as the desired type if it can, or null - * otherwise. - */ - private object GetAsSbyte (LuaState luaState, int stackPos) - { - sbyte retVal = (sbyte)LuaLib.LuaToNumber (luaState, stackPos); - if (retVal == 0 && !LuaLib.LuaIsNumber (luaState, stackPos)) - return null; - - return retVal; - } - - private object GetAsByte (LuaState luaState, int stackPos) - { - byte retVal = (byte)LuaLib.LuaToNumber (luaState, stackPos); - if (retVal == 0 && !LuaLib.LuaIsNumber (luaState, stackPos)) - return null; - - return retVal; - } - - private object GetAsShort (LuaState luaState, int stackPos) - { - short retVal = (short)LuaLib.LuaToNumber (luaState, stackPos); - if (retVal == 0 && !LuaLib.LuaIsNumber (luaState, stackPos)) - return null; - - return retVal; - } - - private object GetAsUshort (LuaState luaState, int stackPos) - { - ushort retVal = (ushort)LuaLib.LuaToNumber (luaState, stackPos); - if (retVal == 0 && !LuaLib.LuaIsNumber (luaState, stackPos)) - return null; - - return retVal; - } - - private object GetAsInt (LuaState luaState, int stackPos) - { - if (!LuaLib.LuaIsNumber (luaState, stackPos)) - return null; - - int retVal = (int)LuaLib.LuaToNumber (luaState, stackPos); - return retVal; - } - - private object GetAsUint (LuaState luaState, int stackPos) - { - uint retVal = (uint)LuaLib.LuaToNumber (luaState, stackPos); - if (retVal == 0 && !LuaLib.LuaIsNumber (luaState, stackPos)) - return null; - - return retVal; - } - - private object GetAsLong (LuaState luaState, int stackPos) - { - long retVal = (long)LuaLib.LuaToNumber (luaState, stackPos); - if (retVal == 0 && !LuaLib.LuaIsNumber (luaState, stackPos)) - return null; - - return retVal; - } - - private object GetAsUlong (LuaState luaState, int stackPos) - { - ulong retVal = (ulong)LuaLib.LuaToNumber (luaState, stackPos); - if (retVal == 0 && !LuaLib.LuaIsNumber (luaState, stackPos)) - return null; - - return retVal; - } - - private object GetAsDouble (LuaState luaState, int stackPos) - { - double retVal = LuaLib.LuaToNumber (luaState, stackPos); - if (retVal == 0 && !LuaLib.LuaIsNumber (luaState, stackPos)) - return null; - - return retVal; - } - - private object GetAsChar (LuaState luaState, int stackPos) - { - char retVal = (char)LuaLib.LuaToNumber (luaState, stackPos); - if (retVal == 0 && !LuaLib.LuaIsNumber (luaState, stackPos)) - return null; - - return retVal; - } - - private object GetAsFloat (LuaState luaState, int stackPos) - { - float retVal = (float)LuaLib.LuaToNumber (luaState, stackPos); - if (retVal == 0 && !LuaLib.LuaIsNumber (luaState, stackPos)) - return null; - - return retVal; - } - - private object GetAsDecimal (LuaState luaState, int stackPos) - { - decimal retVal = (decimal)LuaLib.LuaToNumber (luaState, stackPos); - if (retVal == 0 && !LuaLib.LuaIsNumber (luaState, stackPos)) - return null; - - return retVal; - } - - private object GetAsBoolean (LuaState luaState, int stackPos) - { - return LuaLib.LuaToBoolean (luaState, stackPos); - } - - - - private object GetAsCharArray (LuaState luaState, int stackPos) - { - if (!LuaLib.LuaNetIsStringStrict (luaState, stackPos)) - return null; - string retVal = LuaLib.LuaToString (luaState, stackPos).ToString (); - return retVal.ToCharArray(); - } - - private object GetAsString (LuaState luaState, int stackPos) - { - if (!LuaLib.LuaNetIsStringStrict (luaState, stackPos)) - return null; - string retVal = LuaLib.LuaToString (luaState, stackPos).ToString (); - return retVal; - } - - private object GetAsTable (LuaState luaState, int stackPos) - { - return translator.GetTable (luaState, stackPos); - } - - private object GetAsFunction (LuaState luaState, int stackPos) - { - return translator.GetFunction (luaState, stackPos); - } - - private object GetAsUserdata (LuaState luaState, int stackPos) - { - return translator.GetUserData (luaState, stackPos); - } - - public object GetAsObject (LuaState luaState, int stackPos) - { - if (LuaLib.LuaType (luaState, stackPos) == LuaTypes.Table) { - if (LuaLib.LuaLGetMetafield (luaState, stackPos, "__index")) { - if (LuaLib.LuaLCheckMetatable (luaState, -1)) { - LuaLib.LuaInsert (luaState, stackPos); - LuaLib.LuaRemove (luaState, stackPos + 1); - } else - LuaLib.LuaSetTop (luaState, -2); - } - } - - object obj = translator.GetObject (luaState, stackPos); - return obj; - } - - public object GetAsNetObject (LuaState luaState, int stackPos) - { - object obj = translator.GetNetObject (luaState, stackPos); - - if (obj == null && LuaLib.LuaType (luaState, stackPos) == LuaTypes.Table) { - if (LuaLib.LuaLGetMetafield (luaState, stackPos, "__index")) { - if (LuaLib.LuaLCheckMetatable (luaState, -1)) { - LuaLib.LuaInsert (luaState, stackPos); - LuaLib.LuaRemove (luaState, stackPos + 1); - obj = translator.GetNetObject (luaState, stackPos); - } else - LuaLib.LuaSetTop (luaState, -2); - } - } - - return obj; - } - } -} \ No newline at end of file diff --git a/Core/NLua/Config/NLuaConfig.cs b/Core/NLua/Config/NLuaConfig.cs deleted file mode 100644 index d23d06b8d500f868f35473c9e107f7bae29241ad..0000000000000000000000000000000000000000 --- a/Core/NLua/Config/NLuaConfig.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua.Config -{ - public static class Consts - { - public const string NLuaDescription = "Bridge between the Lua runtime and the CLR"; -#if DEBUG - public const string NLuaConfiguration = "Debug"; -#else - public const string NLuaConfiguration = "Release"; -#endif - public const string NLuaCompany = "NLua.org"; - public const string NLuaProduct = "NLua"; - public const string NLuaCopyright = "Copyright 2003-2015 Vinicius Jarina , Fabio Mascarenhas, Kevin Hesterm and Megax"; - public const string NLuaTrademark = "MIT license"; - public const string NLuaVersion = "1.3.2"; - public const string NLuaFileVersion = "1.3.2"; - } -} \ No newline at end of file diff --git a/Core/NLua/Event/DebugHookEventArgs.cs b/Core/NLua/Event/DebugHookEventArgs.cs deleted file mode 100644 index b1b0194fa005d0c147705a45698191f257f1bc41..0000000000000000000000000000000000000000 --- a/Core/NLua/Event/DebugHookEventArgs.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua.Event -{ - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - using LuaDebug = KopiLua.LuaDebug; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - using LuaDebug = KeraLua.LuaDebug; - #endif - - /// - /// Event args for hook callback event - /// - /// Reinhard Ostermeier - public class DebugHookEventArgs : EventArgs - { - private readonly LuaDebug luaDebug; - - public DebugHookEventArgs (LuaDebug luaDebug) - { - this.luaDebug = luaDebug; - } - - public LuaDebug LuaDebug { - get { return luaDebug; } - } - } -} \ No newline at end of file diff --git a/Core/NLua/Event/EventCodes.cs b/Core/NLua/Event/EventCodes.cs deleted file mode 100755 index 9d962a4ed6724450777b205326bd7c3b3a385d0a..0000000000000000000000000000000000000000 --- a/Core/NLua/Event/EventCodes.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua.Event -{ - /// - /// Event codes for lua hook function - /// - /// - /// Do not change any of the values because they must match the lua values - /// - public enum EventCodes - { - LUA_HOOKCALL = 0, - LUA_HOOKRET = 1, - LUA_HOOKLINE = 2, - LUA_HOOKCOUNT = 3, - LUA_HOOKTAILRET = 4 - } -} \ No newline at end of file diff --git a/Core/NLua/Event/EventMasks.cs b/Core/NLua/Event/EventMasks.cs deleted file mode 100755 index bd4da588303dca30feb74e42e9b108f008a45e8d..0000000000000000000000000000000000000000 --- a/Core/NLua/Event/EventMasks.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua.Event -{ - /// - /// Event masks for lua hook callback - /// - /// - /// Do not change any of the values because they must match the lua values - /// - [Flags] - public enum EventMasks - { - LUA_MASKCALL = (1 << EventCodes.LUA_HOOKCALL), - LUA_MASKRET = (1 << EventCodes.LUA_HOOKRET), - LUA_MASKLINE = (1 << EventCodes.LUA_HOOKLINE), - LUA_MASKCOUNT = (1 << EventCodes.LUA_HOOKCOUNT), - LUA_MASKALL = Int32.MaxValue - } -} \ No newline at end of file diff --git a/Core/NLua/Event/HookExceptionEventArgs.cs b/Core/NLua/Event/HookExceptionEventArgs.cs deleted file mode 100644 index dd7fd98126c4842ae7ec13e91da0296ad46d4292..0000000000000000000000000000000000000000 --- a/Core/NLua/Event/HookExceptionEventArgs.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua.Event -{ - public class HookExceptionEventArgs : EventArgs - { - private readonly Exception m_Exception; - - public Exception Exception { - get { return m_Exception; } - } - - public HookExceptionEventArgs (Exception ex) - { - m_Exception = ex; - } - } -} \ No newline at end of file diff --git a/Core/NLua/Exceptions/LuaException.cs b/Core/NLua/Exceptions/LuaException.cs deleted file mode 100755 index 163a29a4e44bd28a493ff73cf32095575d58d838..0000000000000000000000000000000000000000 --- a/Core/NLua/Exceptions/LuaException.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -#if !SILVERLIGHT && !NETFX_CORE -using System.Runtime.Serialization; -#endif - -namespace NLua.Exceptions -{ - /// - /// Exceptions thrown by the Lua runtime - /// -#if !SILVERLIGHT && !NETFX_CORE - [Serializable] -#endif - public class LuaException : Exception - { - public LuaException () - { - } - - public LuaException (string message) : base(message) - { - } - - public LuaException (string message, Exception innerException) : base(message, innerException) - { - } - -#if !SILVERLIGHT && !NETFX_CORE - protected LuaException (SerializationInfo info, StreamingContext context) : base(info, context) - { - } -#endif - } -} \ No newline at end of file diff --git a/Core/NLua/Exceptions/LuaScriptException.cs b/Core/NLua/Exceptions/LuaScriptException.cs deleted file mode 100755 index e37b191dd263ae882f639e90adfe1d33ddd32cb2..0000000000000000000000000000000000000000 --- a/Core/NLua/Exceptions/LuaScriptException.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua.Exceptions -{ - /// - /// Exceptions thrown by the Lua runtime because of errors in the script - /// - /// -#if !SILVERLIGHT && !NETFX_CORE - [Serializable] -#endif - public class LuaScriptException : LuaException - { - /// - /// Returns true if the exception has occured as the result of a .NET exception in user code - /// - public bool IsNetException { get; private set; } - - private readonly string source; - - /// - /// The position in the script where the exception was triggered. - /// -#if SILVERLIGHT && !WINDOWS_PHONE - public string Source { get { return source; } } -#else - public override string Source { get { return source; } } -#endif - - /// - /// Creates a new Lua-only exception. - /// - /// The message that describes the error. - /// The position in the script where the exception was triggered. - public LuaScriptException (string message, string source) : base(message) - { - this.source = source; - } - - /// - /// Creates a new .NET wrapping exception. - /// - /// The .NET exception triggered by user-code. - /// The position in the script where the exception was triggered. - public LuaScriptException (Exception innerException, string source) - : base("A .NET exception occured in user-code", innerException) - { - this.source = source; - this.IsNetException = true; - } - - public override string ToString () - { - // Prepend the error source - return GetType ().FullName + ": " + source + Message; - } - } -} \ No newline at end of file diff --git a/Core/NLua/Extensions/GeneralExtensions.cs b/Core/NLua/Extensions/GeneralExtensions.cs deleted file mode 100755 index 9aeb72f6e31d20818bec25d5ff03af5b84398a30..0000000000000000000000000000000000000000 --- a/Core/NLua/Extensions/GeneralExtensions.cs +++ /dev/null @@ -1,415 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Linq; -using System.Collections.Generic; -using System.Reflection; -using System.Runtime.CompilerServices; - -namespace NLua.Extensions -{ - /// - /// Some random extension stuff. - /// - static class CheckNull - { - /// - /// Determines whether the specified obj is null. - /// - /// The obj. - /// - /// true if the specified obj is null; otherwise, false. - /// - /// - -#if USE_KOPILUA - public static bool IsNull (object obj) - { - return (obj == null); - } -#else - - public static bool IsNull (IntPtr ptr) - { - return (ptr.Equals (IntPtr.Zero)); - } -#endif - } - - static class TypeExtensions - { - public static bool HasMethod (this Type t, string name) - { - var op = t.GetMethods (BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static); - return op.Any (m => m.Name == name); - } - - public static bool HasAdditionOpertator (this Type t) - { - if (t.IsPrimitive ()) - return true; - - return t.HasMethod ("op_Addition"); - } - - public static bool HasSubtractionOpertator (this Type t) - { - if (t.IsPrimitive ()) - return true; - - return t.HasMethod ("op_Subtraction"); - } - - public static bool HasMultiplyOpertator (this Type t) - { - if (t.IsPrimitive ()) - return true; - - return t.HasMethod ("op_Multiply"); - } - - public static bool HasDivisionOpertator (this Type t) - { - if (t.IsPrimitive ()) - return true; - - return t.HasMethod ("op_Division"); - } - - public static bool HasModulusOpertator (this Type t) - { - if (t.IsPrimitive ()) - return true; - - return t.HasMethod ("op_Modulus"); - } - - public static bool HasUnaryNegationOpertator (this Type t) - { - if (t.IsPrimitive ()) - return true; - // Unary - will always have only one version. - var op = t.GetMethod ("op_UnaryNegation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static); - return op != null; - } - - public static bool HasEqualityOpertator (this Type t) - { - if (t.IsPrimitive ()) - return true; - return t.HasMethod ("op_Equality"); - } - - public static bool HasLessThanOpertator (this Type t) - { - if (t.IsPrimitive ()) - return true; - - return t.HasMethod ("op_LessThan"); - } - - public static bool HasLessThanOrEqualOpertator (this Type t) - { - if (t.IsPrimitive ()) - return true; - return t.HasMethod ("op_LessThanOrEqual"); - } - - public static MethodInfo [] GetMethods (this Type t, string name, BindingFlags flags) - { - return t.GetMethods (flags).Where (m => m.Name == name).ToArray (); - } - - public static MethodInfo [] GetExtensionMethods (this Type type, IEnumerable assemblies = null) - { - List types = new List (); - - types.AddRange (type.GetAssembly().GetTypes ().Where (t => t.IsPublic ())); - - if (assemblies != null) { - foreach (Assembly item in assemblies) { - if (item == type.GetAssembly ()) - continue; - types.AddRange (item.GetTypes ().Where (t => t.IsPublic ())); - } - } - - var query = from extensionType in types - where extensionType.IsSealed() && !extensionType.IsGenericType() && !extensionType.IsNested - from method in extensionType.GetMethods (BindingFlags.Static | BindingFlags.Public) - where method.IsDefined (typeof (ExtensionAttribute), false) - where (method.GetParameters()[0].ParameterType == type - || type.IsSubclassOf(method.GetParameters()[0].ParameterType) - || type.GetInterfaces().Contains(method.GetParameters()[0].ParameterType)) - select method; - return query.ToArray (); - } - - /// - /// Extends the System.Type-type to search for a given extended MethodeName. - /// - /// Name of the Methode - /// the found Method or null - public static MethodInfo GetExtensionMethod (this Type t, string name, IEnumerable assemblies = null) - { - var mi = from methode in t.GetExtensionMethods (assemblies) - where methode.Name == name - select methode; - if (!mi.Any ()) - return null; - else - return mi.First (); - } - - public static bool IsPrimitive (this Type t) - { -#if NETFX_CORE - return t.GetTypeInfo ().IsPrimitive; -#else - return t.IsPrimitive; -#endif - } - - public static bool IsClass (this Type t) - { -#if NETFX_CORE - return t.GetTypeInfo ().IsClass; -#else - return t.IsClass; -#endif - } - - public static bool IsEnum (this Type t) - { -#if NETFX_CORE - return t.GetTypeInfo ().IsEnum; -#else - return t.IsEnum; -#endif - } - - public static bool IsPublic (this Type t) - { -#if NETFX_CORE - return t.GetTypeInfo ().IsPublic; -#else - return t.IsPublic; -#endif - } - - public static bool IsSealed (this Type t) - { -#if NETFX_CORE - return t.GetTypeInfo ().IsSealed; -#else - return t.IsSealed; -#endif - } - - public static bool IsGenericType (this Type t) - { -#if NETFX_CORE - return t.GetTypeInfo ().IsGenericType; -#else - return t.IsGenericType; -#endif - } - - public static bool IsInterface (this Type t) - { -#if NETFX_CORE - return t.GetTypeInfo ().IsInterface; -#else - return t.IsInterface; -#endif - } - - public static Assembly GetAssembly (this Type t) - { -#if NETFX_CORE - return t.GetTypeInfo ().Assembly; -#else - return t.Assembly; -#endif - } - -#if NETFX_CORE - // Missing Reflection methods from WinRT - - public const BindingFlags Default = BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance; - - public static MethodInfo GetMethod (this Type type, string name, BindingFlags flags, Type [] signature) - { - return GetMethods (type, flags).FirstOrDefault (c => c.Name == name && c.GetParameters ().Select (p => p.ParameterType).SequenceEqual (signature)); - } - - static IEnumerable GetTypes (this Assembly assembly) - { - return assembly.ExportedTypes; - } - - public static bool IsAssignableFrom (this Type t, Type t2) - { - return t.GetTypeInfo ().IsAssignableFrom (t2.GetTypeInfo ()); - } - - public static MemberInfo [] GetMember (this Type type, string name, BindingFlags flags) - { - return GetMembers (type, flags).Where (m => m.Name == name).ToArray (); - } - - public static MemberInfo [] GetMembers (this Type type, BindingFlags flags) - { - // Metro does have DeclaredMembers but nothing otherwise - return GetEvents (type, flags).Cast () - .Concat (GetFields (type, flags).Cast ()) - .Concat (GetMethods (type, flags).Cast ()) - .Concat (GetProperties (type, flags).Cast ()) - .ToArray (); - } - - public static MethodInfo GetMethod (this Type type, string name) - { - return GetMethod (type, name, Default); - } - - public static MethodInfo GetMethod (this Type type, string name, BindingFlags flags) - { - return GetMethods (type, flags).FirstOrDefault (m => m.Name == name); - } - - public static MethodInfo [] GetMethods (this Type type) - { - return GetMethods (type, Default); - } - - public static MethodInfo [] GetMethods (this Type type, BindingFlags flags) - { - var methods = type.GetRuntimeMethods (); - return methods.Where (m => - ((flags.HasFlag (BindingFlags.Static) == m.IsStatic) || (flags.HasFlag (BindingFlags.Instance) == !m.IsStatic) - ) && - (flags.HasFlag (BindingFlags.Public) == m.IsPublic) - ).ToArray (); - } - - public static PropertyInfo [] GetProperties (this Type type, BindingFlags flags) - { - var props = type.GetRuntimeProperties (); - - return props.Where (p => - ((flags.HasFlag (BindingFlags.Static) == (p.GetMethod != null && p.GetMethod.IsStatic)) || - (flags.HasFlag (BindingFlags.Instance) == (p.GetMethod != null && !p.GetMethod.IsStatic)) - ) && - (flags.HasFlag (BindingFlags.Public) == (p.GetMethod != null && p.GetMethod.IsPublic) - )).ToArray (); - } - public static ConstructorInfo GetConstructor (this Type type, Type [] paramTypes) - { - return GetConstructors (type, Default).FirstOrDefault (c => c.GetParameters ().Select (p => p.ParameterType).SequenceEqual (paramTypes)); - } - - public static ConstructorInfo [] GetConstructors (this Type type) - { - return GetConstructors (type, Default); - } - - public static ConstructorInfo [] GetConstructors (this Type type, BindingFlags flags) - { - var props = type.GetTypeInfo ().DeclaredConstructors; - return props.Where (p => - ((flags.HasFlag (BindingFlags.Static) == p.IsStatic) || - (flags.HasFlag (BindingFlags.Instance) == !p.IsStatic) - ) && - (flags.HasFlag (BindingFlags.Public) == p.IsPublic) - ).ToArray (); - } - - public static EventInfo [] GetEvents (this Type type, BindingFlags flags) - { - var props = type.GetRuntimeEvents (); - - return props.Where (p => - ((flags.HasFlag (BindingFlags.Static) == p.AddMethod.IsStatic) || - (flags.HasFlag (BindingFlags.Instance) == !p.AddMethod.IsStatic) - ) && - (flags.HasFlag (BindingFlags.Public) == p.AddMethod.IsPublic) - ).ToArray (); - } - - public static FieldInfo GetField (this Type type, string name) - { - return GetField (type, name, Default); - } - - public static FieldInfo GetField (this Type type, string name, BindingFlags flags) - { - return GetFields (type, flags).FirstOrDefault (f => f.Name == name); - } - - public static FieldInfo [] GetFields (this Type type, BindingFlags flags) - { - var fields = type.GetRuntimeFields (); - - return fields.Where (p => - ((flags.HasFlag (BindingFlags.Static) == p.IsStatic) || (flags.HasFlag (BindingFlags.Instance) == !p.IsStatic) - ) && - (flags.HasFlag (BindingFlags.Public) == p.IsPublic) - ).ToArray (); - } - - public static bool ImplementInterface (this Type t, string name) - { - return t.GetTypeInfo ().ImplementedInterfaces.Any (i => i.Name == name); - } - -#endif - } - - static class StringExtensions - { - public static IEnumerable SplitWithEscape (this string input, char separator, char escapeCharacter) - { - int start = 0; - int index = 0; - while (index < input.Length) { - index = input.IndexOf (separator, index); - if (index == -1) - break; - - if (input [index - 1] == escapeCharacter) { - input = input.Remove (index - 1, 1); - continue; - } - - - yield return input.Substring (start, index - start); - index++; - start = index; - } - yield return input.Substring (start); - } - } -} \ No newline at end of file diff --git a/Core/NLua/GenerateEventAssembly/ClassGenerator.cs b/Core/NLua/GenerateEventAssembly/ClassGenerator.cs deleted file mode 100644 index 291e302a4ba69104622ba8645f6a6dafa13888a8..0000000000000000000000000000000000000000 --- a/Core/NLua/GenerateEventAssembly/ClassGenerator.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua -{ - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - #endif - /* - * Class used for generating delegates that get a table from the Lua - * stack as a an object of a specific type. - * - * Author: Fabio Mascarenhas - * Version: 1.0 - */ - class ClassGenerator - { - private ObjectTranslator translator; - private Type klass; - - public ClassGenerator (ObjectTranslator objTranslator, Type typeClass) - { - translator = objTranslator; - klass = typeClass; - } - - public object ExtractGenerated (LuaState luaState, int stackPos) - { - return CodeGeneration.Instance.GetClassInstance (klass, translator.GetTable (luaState, stackPos)); - } - } -} \ No newline at end of file diff --git a/Core/NLua/GenerateEventAssembly/CodeGeneration.cs b/Core/NLua/GenerateEventAssembly/CodeGeneration.cs deleted file mode 100755 index fa6aa460db3d8459dbcc6d3402218489ed315da9..0000000000000000000000000000000000000000 --- a/Core/NLua/GenerateEventAssembly/CodeGeneration.cs +++ /dev/null @@ -1,749 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Linq; -using System.Threading; -using System.Reflection; - -using NLua.Extensions; - - -#if !MONOTOUCH -using System.Reflection.Emit; -#endif -using System.Collections; -using System.Collections.Generic; -using NLua.Method; - -namespace NLua -{ - /* - * Dynamically generates new types from existing types and - * Lua function and table values. Generated types are event handlers, - * delegates, interface implementations and subclasses. - * - * Author: Fabio Mascarenhas - * Version: 1.0 - */ - class CodeGeneration - { - private Dictionary classCollection = new Dictionary (); - private Dictionary delegateCollection = new Dictionary (); - private static readonly CodeGeneration instance = new CodeGeneration (); - private AssemblyName assemblyName; - -#if !MONOTOUCH && !SILVERLIGHT && !NETFX_CORE - private Dictionary eventHandlerCollection = new Dictionary (); - private Type eventHandlerParent = typeof(LuaEventHandler); - private Type delegateParent = typeof(LuaDelegate); - private Type classHelper = typeof(LuaClassHelper); - private AssemblyBuilder newAssembly; - private ModuleBuilder newModule; - private int luaClassNumber = 1; -#endif - - static CodeGeneration () - { - } - - private CodeGeneration () - { - // Create an assembly name - assemblyName = new AssemblyName (); - assemblyName.Name = "NLua_generatedcode"; - // Create a new assembly with one module. -#if !MONOTOUCH && !SILVERLIGHT && !NETFX_CORE - newAssembly = Thread.GetDomain ().DefineDynamicAssembly (assemblyName, AssemblyBuilderAccess.Run); - newModule = newAssembly.DefineDynamicModule ("NLua_generatedcode"); -#endif - } - - /* - * Singleton instance of the class - */ - public static CodeGeneration Instance { - get { return instance; } - } - - /* - * Generates an event handler that calls a Lua function - */ - private Type GenerateEvent (Type eventHandlerType) - { -#if MONOTOUCH - throw new NotImplementedException (" Emit not available on MonoTouch "); -#elif SILVERLIGHT - throw new NotImplementedException(" Emit not available on Silverlight "); -#elif NETFX_CORE - throw new NotImplementedException(" Emit not available on Windows Store "); -#else - string typeName; - lock (this) { - typeName = "LuaGeneratedClass" + luaClassNumber.ToString (); - luaClassNumber++; - } - - // Define a public class in the assembly, called typeName - var myType = newModule.DefineType (typeName, TypeAttributes.Public, eventHandlerParent); - - // Defines the handler method. Its signature is void(object, ) - var paramTypes = new Type[2]; - paramTypes [0] = typeof(object); - paramTypes [1] = eventHandlerType; - var returnType = typeof(void); - var handleMethod = myType.DefineMethod ("HandleEvent", MethodAttributes.Public | MethodAttributes.HideBySig, returnType, paramTypes); - - // Emits the IL for the method. It loads the arguments - // and calls the handleEvent method of the base class - ILGenerator generator = handleMethod.GetILGenerator (); - generator.Emit (OpCodes.Ldarg_0); - generator.Emit (OpCodes.Ldarg_1); - generator.Emit (OpCodes.Ldarg_2); - var miGenericEventHandler = eventHandlerParent.GetMethod ("HandleEvent"); - generator.Emit (OpCodes.Call, miGenericEventHandler); - // returns - generator.Emit (OpCodes.Ret); - // creates the new type - return myType.CreateType (); -#endif - } - - /* - * Generates a type that can be used for instantiating a delegate - * of the provided type, given a Lua function. - */ - private Type GenerateDelegate (Type delegateType) - { -#if MONOTOUCH - throw new NotImplementedException ("GenerateDelegate is not available on iOS, please register your LuaDelegate type with Lua.RegisterLuaDelegateType( yourDelegate, theLuaDelegateHandler) "); -#elif SILVERLIGHT - throw new NotImplementedException("GenerateDelegate is not available on Silverlight, please register your LuaDelegate type with Lua.RegisterLuaDelegateType( yourDelegate, theLuaDelegateHandler) "); -#elif NETFX_CORE - throw new NotImplementedException("GenerateDelegate is not available on Windows Store, please register your LuaDelegate type with Lua.RegisterLuaDelegateType( yourDelegate, theLuaDelegateHandler) "); -#else - string typeName; - lock (this) { - typeName = "LuaGeneratedClass" + luaClassNumber.ToString (); - luaClassNumber++; - } - - // Define a public class in the assembly, called typeName - var myType = newModule.DefineType (typeName, TypeAttributes.Public, delegateParent); - - // Defines the delegate method with the same signature as the - // Invoke method of delegateType - var invokeMethod = delegateType.GetMethod ("Invoke"); - var paramInfo = invokeMethod.GetParameters (); - var paramTypes = new Type[paramInfo.Length]; - var returnType = invokeMethod.ReturnType; - - // Counts out and ref params, for use later - int nOutParams = 0; - int nOutAndRefParams = 0; - - for (int i = 0; i < paramTypes.Length; i++) { - paramTypes [i] = paramInfo [i].ParameterType; - - if ((!paramInfo [i].IsIn) && paramInfo [i].IsOut) - nOutParams++; - - if (paramTypes [i].IsByRef) - nOutAndRefParams++; - } - - int[] refArgs = new int[nOutAndRefParams]; - var delegateMethod = myType.DefineMethod ("CallFunction", invokeMethod.Attributes, returnType, paramTypes); - - // Generates the IL for the method - ILGenerator generator = delegateMethod.GetILGenerator (); - generator.DeclareLocal (typeof(object[])); // original arguments - generator.DeclareLocal (typeof(object[])); // with out-only arguments removed - generator.DeclareLocal (typeof(int[])); // indexes of out and ref arguments - - if (!(returnType == typeof(void))) // return value - generator.DeclareLocal (returnType); - else - generator.DeclareLocal (typeof(object)); - - // Initializes local variables - generator.Emit (OpCodes.Ldc_I4, paramTypes.Length); - generator.Emit (OpCodes.Newarr, typeof(object)); - generator.Emit (OpCodes.Stloc_0); - generator.Emit (OpCodes.Ldc_I4, paramTypes.Length - nOutParams); - generator.Emit (OpCodes.Newarr, typeof(object)); - generator.Emit (OpCodes.Stloc_1); - generator.Emit (OpCodes.Ldc_I4, nOutAndRefParams); - generator.Emit (OpCodes.Newarr, typeof(int)); - generator.Emit (OpCodes.Stloc_2); - - // Stores the arguments in the local variables - for (int iArgs = 0, iInArgs = 0, iOutArgs = 0; iArgs < paramTypes.Length; iArgs++) { - generator.Emit (OpCodes.Ldloc_0); - generator.Emit (OpCodes.Ldc_I4, iArgs); - generator.Emit (OpCodes.Ldarg, iArgs + 1); - - if (paramTypes [iArgs].IsByRef) { - if (paramTypes [iArgs].GetElementType ().IsValueType) { - generator.Emit (OpCodes.Ldobj, paramTypes [iArgs].GetElementType ()); - generator.Emit (OpCodes.Box, paramTypes [iArgs].GetElementType ()); - } else - generator.Emit (OpCodes.Ldind_Ref); - } else { - if (paramTypes [iArgs].IsValueType) - generator.Emit (OpCodes.Box, paramTypes [iArgs]); - } - - generator.Emit (OpCodes.Stelem_Ref); - - if (paramTypes [iArgs].IsByRef) { - generator.Emit (OpCodes.Ldloc_2); - generator.Emit (OpCodes.Ldc_I4, iOutArgs); - generator.Emit (OpCodes.Ldc_I4, iArgs); - generator.Emit (OpCodes.Stelem_I4); - refArgs [iOutArgs] = iArgs; - iOutArgs++; - } - - if (paramInfo [iArgs].IsIn || (!paramInfo [iArgs].IsOut)) { - generator.Emit (OpCodes.Ldloc_1); - generator.Emit (OpCodes.Ldc_I4, iInArgs); - generator.Emit (OpCodes.Ldarg, iArgs + 1); - - if (paramTypes [iArgs].IsByRef) { - if (paramTypes [iArgs].GetElementType ().IsValueType) { - generator.Emit (OpCodes.Ldobj, paramTypes [iArgs].GetElementType ()); - generator.Emit (OpCodes.Box, paramTypes [iArgs].GetElementType ()); - } else - generator.Emit (OpCodes.Ldind_Ref); - } else { - if (paramTypes [iArgs].IsValueType) - generator.Emit (OpCodes.Box, paramTypes [iArgs]); - } - - generator.Emit (OpCodes.Stelem_Ref); - iInArgs++; - } - } - - // Calls the callFunction method of the base class - generator.Emit (OpCodes.Ldarg_0); - generator.Emit (OpCodes.Ldloc_0); - generator.Emit (OpCodes.Ldloc_1); - generator.Emit (OpCodes.Ldloc_2); - var miGenericEventHandler = delegateParent.GetMethod ("CallFunction"); - generator.Emit (OpCodes.Call, miGenericEventHandler); - - // Stores return value - if (returnType == typeof(void)) { - generator.Emit (OpCodes.Pop); - generator.Emit (OpCodes.Ldnull); - } else if (returnType.IsValueType) { - generator.Emit (OpCodes.Unbox, returnType); - generator.Emit (OpCodes.Ldobj, returnType); - } else - generator.Emit (OpCodes.Castclass, returnType); - - generator.Emit (OpCodes.Stloc_3); - - // Stores new value of out and ref params - for (int i = 0; i < refArgs.Length; i++) { - generator.Emit (OpCodes.Ldarg, refArgs [i] + 1); - generator.Emit (OpCodes.Ldloc_0); - generator.Emit (OpCodes.Ldc_I4, refArgs [i]); - generator.Emit (OpCodes.Ldelem_Ref); - - if (paramTypes [refArgs [i]].GetElementType ().IsValueType) { - generator.Emit (OpCodes.Unbox, paramTypes [refArgs [i]].GetElementType ()); - generator.Emit (OpCodes.Ldobj, paramTypes [refArgs [i]].GetElementType ()); - generator.Emit (OpCodes.Stobj, paramTypes [refArgs [i]].GetElementType ()); - } else { - generator.Emit (OpCodes.Castclass, paramTypes [refArgs [i]].GetElementType ()); - generator.Emit (OpCodes.Stind_Ref); - } - } - - // Returns - if (!(returnType == typeof(void))) - generator.Emit (OpCodes.Ldloc_3); - - generator.Emit (OpCodes.Ret); - return myType.CreateType (); // creates the new type -#endif - } - - void GetReturnTypesFromClass (Type klass, out Type[][] returnTypes) - { - var classMethods = klass.GetMethods (); - returnTypes = new Type[classMethods.Length][]; - - int i = 0; - - foreach (var method in classMethods) { - if (klass.IsInterface ()) { - GetReturnTypesFromMethod (method, out returnTypes [i]); - i++; - } else { - if (!method.IsPrivate && !method.IsFinal && method.IsVirtual) { - GetReturnTypesFromMethod (method, out returnTypes [i]); - i++; - } - } - } - } - - /* - * Generates an implementation of klass, if it is an interface, or - * a subclass of klass that delegates its virtual methods to a Lua table. - */ - public void GenerateClass (Type klass, out Type newType, out Type[][] returnTypes) - { -#if MONOTOUCH - throw new NotImplementedException (" Emit not available on MonoTouch "); -#elif SILVERLIGHT - throw new NotImplementedException (" Emit not available on Silverlight "); -#elif NETFX_CORE - throw new NotImplementedException (" Emit not available on Windows Store "); -#else - string typeName; - lock (this) { - typeName = "LuaGeneratedClass" + luaClassNumber.ToString (); - luaClassNumber++; - } - - TypeBuilder myType; - // Define a public class in the assembly, called typeName - if (klass.IsInterface) - myType = newModule.DefineType (typeName, TypeAttributes.Public, typeof(object), new Type[] { - klass, - typeof(ILuaGeneratedType) - }); - else - myType = newModule.DefineType (typeName, TypeAttributes.Public, klass, new Type[] { typeof(ILuaGeneratedType) }); - - // Field that stores the Lua table - var luaTableField = myType.DefineField ("__luaInterface_luaTable", typeof(LuaTable), FieldAttributes.Public); - // Field that stores the return types array - var returnTypesField = myType.DefineField ("__luaInterface_returnTypes", typeof(Type[][]), FieldAttributes.Public); - // Generates the constructor for the new type, it takes a Lua table and an array - // of return types and stores them in the respective fields - var constructor = myType.DefineConstructor (MethodAttributes.Public, CallingConventions.Standard, new Type[] { - typeof(LuaTable), - typeof(Type[][]) - }); - ILGenerator generator = constructor.GetILGenerator (); - generator.Emit (OpCodes.Ldarg_0); - - if (klass.IsInterface) - generator.Emit (OpCodes.Call, typeof(object).GetConstructor (Type.EmptyTypes)); - else - generator.Emit (OpCodes.Call, klass.GetConstructor (Type.EmptyTypes)); - - generator.Emit (OpCodes.Ldarg_0); - generator.Emit (OpCodes.Ldarg_1); - generator.Emit (OpCodes.Stfld, luaTableField); - generator.Emit (OpCodes.Ldarg_0); - generator.Emit (OpCodes.Ldarg_2); - generator.Emit (OpCodes.Stfld, returnTypesField); - generator.Emit (OpCodes.Ret); - // Generates overriden versions of the klass' public virtual methods - var classMethods = klass.GetMethods (); - returnTypes = new Type[classMethods.Length][]; - int i = 0; - - foreach (var method in classMethods) { - if (klass.IsInterface) { - GenerateMethod (myType, method, MethodAttributes.HideBySig | MethodAttributes.Virtual | MethodAttributes.NewSlot, - i, luaTableField, returnTypesField, false, out returnTypes [i]); - i++; - } else { - if (!method.IsPrivate && !method.IsFinal && method.IsVirtual) { - GenerateMethod (myType, method, (method.Attributes | MethodAttributes.NewSlot) ^ MethodAttributes.NewSlot, i, - luaTableField, returnTypesField, true, out returnTypes [i]); - i++; - } - } - } - - // Generates an implementation of the luaInterfaceGetLuaTable method - var returnTableMethod = myType.DefineMethod ("LuaInterfaceGetLuaTable", - MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.Virtual, typeof(LuaTable), new Type[0]); - myType.DefineMethodOverride (returnTableMethod, typeof(ILuaGeneratedType).GetMethod ("LuaInterfaceGetLuaTable")); - generator = returnTableMethod.GetILGenerator (); - generator.Emit (OpCodes.Ldfld, luaTableField); - generator.Emit (OpCodes.Ret); - newType = myType.CreateType (); // Creates the type -#endif - } - - void GetReturnTypesFromMethod (MethodInfo method, out Type[] returnTypes) - { - var paramInfo = method.GetParameters (); - var paramTypes = new Type[paramInfo.Length]; - var returnTypesList = new List (); - - // Counts out and ref parameters, for later use, - // and creates the list of return types - int nOutParams = 0; - int nOutAndRefParams = 0; - var returnType = method.ReturnType; - returnTypesList.Add (returnType); - - for (int i = 0; i < paramTypes.Length; i++) { - paramTypes [i] = paramInfo [i].ParameterType; -#if SILVERLIGHT - if (paramInfo[i].IsOut) { -#else - if ((!paramInfo [i].IsIn) && paramInfo [i].IsOut) { -#endif - nOutParams++; - } - - if (paramTypes [i].IsByRef) { - returnTypesList.Add (paramTypes [i].GetElementType ()); - nOutAndRefParams++; - } - } - - returnTypes = returnTypesList.ToArray (); - } - -#if !MONOTOUCH && !SILVERLIGHT && !NETFX_CORE - - /* - * Generates an overriden implementation of method inside myType that delegates - * to a function in a Lua table with the same name, if the function exists. If it - * doesn't the method calls the base method (or does nothing, in case of interface - * implementations). - */ - private void GenerateMethod (TypeBuilder myType, MethodInfo method, MethodAttributes attributes, int methodIndex, - FieldInfo luaTableField, FieldInfo returnTypesField, bool generateBase, out Type[] returnTypes) - { - var paramInfo = method.GetParameters (); - var paramTypes = new Type[paramInfo.Length]; - var returnTypesList = new List (); - - // Counts out and ref parameters, for later use, - // and creates the list of return types - int nOutParams = 0; - int nOutAndRefParams = 0; - var returnType = method.ReturnType; - returnTypesList.Add (returnType); - - for (int i = 0; i < paramTypes.Length; i++) { - paramTypes [i] = paramInfo [i].ParameterType; - if ((!paramInfo [i].IsIn) && paramInfo [i].IsOut) - nOutParams++; - - if (paramTypes [i].IsByRef) { - returnTypesList.Add (paramTypes [i].GetElementType ()); - nOutAndRefParams++; - } - } - - int[] refArgs = new int[nOutAndRefParams]; - returnTypes = returnTypesList.ToArray (); - - // Generates a version of the method that calls the base implementation - // directly, for use by the base field of the table - if (generateBase) { - var baseMethod = myType.DefineMethod ("__luaInterface_base_" + method.Name, - MethodAttributes.Private | MethodAttributes.NewSlot | MethodAttributes.HideBySig, - returnType, paramTypes); - ILGenerator generatorBase = baseMethod.GetILGenerator (); - generatorBase.Emit (OpCodes.Ldarg_0); - - for (int i = 0; i < paramTypes.Length; i++) - generatorBase.Emit (OpCodes.Ldarg, i + 1); - - generatorBase.Emit (OpCodes.Call, method); - - if (returnType == typeof(void)) - generatorBase.Emit (OpCodes.Pop); - - generatorBase.Emit (OpCodes.Ret); - } - - // Defines the method - var methodImpl = myType.DefineMethod (method.Name, attributes, returnType, paramTypes); - - // If it's an implementation of an interface tells what method it - // is overriding - if (myType.BaseType.Equals (typeof(object))) - myType.DefineMethodOverride (methodImpl, method); - - ILGenerator generator = methodImpl.GetILGenerator (); - generator.DeclareLocal (typeof(object[])); // original arguments - generator.DeclareLocal (typeof(object[])); // with out-only arguments removed - generator.DeclareLocal (typeof(int[])); // indexes of out and ref arguments - - if (!(returnType == typeof(void))) // return value - generator.DeclareLocal (returnType); - else - generator.DeclareLocal (typeof(object)); - - // Initializes local variables - generator.Emit (OpCodes.Ldc_I4, paramTypes.Length); - generator.Emit (OpCodes.Newarr, typeof(object)); - generator.Emit (OpCodes.Stloc_0); - generator.Emit (OpCodes.Ldc_I4, paramTypes.Length - nOutParams + 1); - generator.Emit (OpCodes.Newarr, typeof(object)); - generator.Emit (OpCodes.Stloc_1); - generator.Emit (OpCodes.Ldc_I4, nOutAndRefParams); - generator.Emit (OpCodes.Newarr, typeof(int)); - generator.Emit (OpCodes.Stloc_2); - generator.Emit (OpCodes.Ldloc_1); - generator.Emit (OpCodes.Ldc_I4_0); - generator.Emit (OpCodes.Ldarg_0); - generator.Emit (OpCodes.Ldfld, luaTableField); - generator.Emit (OpCodes.Stelem_Ref); - - // Stores the arguments into the local variables, as needed - for (int iArgs = 0, iInArgs = 1, iOutArgs = 0; iArgs < paramTypes.Length; iArgs++) { - generator.Emit (OpCodes.Ldloc_0); - generator.Emit (OpCodes.Ldc_I4, iArgs); - generator.Emit (OpCodes.Ldarg, iArgs + 1); - - if (paramTypes [iArgs].IsByRef) { - if (paramTypes [iArgs].GetElementType ().IsValueType) { - generator.Emit (OpCodes.Ldobj, paramTypes [iArgs].GetElementType ()); - generator.Emit (OpCodes.Box, paramTypes [iArgs].GetElementType ()); - } else - generator.Emit (OpCodes.Ldind_Ref); - } else { - if (paramTypes [iArgs].IsValueType) - generator.Emit (OpCodes.Box, paramTypes [iArgs]); - } - - generator.Emit (OpCodes.Stelem_Ref); - - if (paramTypes [iArgs].IsByRef) { - generator.Emit (OpCodes.Ldloc_2); - generator.Emit (OpCodes.Ldc_I4, iOutArgs); - generator.Emit (OpCodes.Ldc_I4, iArgs); - generator.Emit (OpCodes.Stelem_I4); - refArgs [iOutArgs] = iArgs; - iOutArgs++; - } - - if (paramInfo [iArgs].IsIn || (!paramInfo [iArgs].IsOut)) { - generator.Emit (OpCodes.Ldloc_1); - generator.Emit (OpCodes.Ldc_I4, iInArgs); - generator.Emit (OpCodes.Ldarg, iArgs + 1); - - if (paramTypes [iArgs].IsByRef) { - if (paramTypes [iArgs].GetElementType ().IsValueType) { - generator.Emit (OpCodes.Ldobj, paramTypes [iArgs].GetElementType ()); - generator.Emit (OpCodes.Box, paramTypes [iArgs].GetElementType ()); - } else - generator.Emit (OpCodes.Ldind_Ref); - } else { - if (paramTypes [iArgs].IsValueType) - generator.Emit (OpCodes.Box, paramTypes [iArgs]); - } - - generator.Emit (OpCodes.Stelem_Ref); - iInArgs++; - } - } - - // Gets the function the method will delegate to by calling - // the getTableFunction method of class LuaClassHelper - generator.Emit (OpCodes.Ldarg_0); - generator.Emit (OpCodes.Ldfld, luaTableField); - generator.Emit (OpCodes.Ldstr, method.Name); - generator.Emit (OpCodes.Call, classHelper.GetMethod ("GetTableFunction")); - var lab1 = generator.DefineLabel (); - generator.Emit (OpCodes.Dup); - generator.Emit (OpCodes.Brtrue_S, lab1); - // Function does not exist, call base method - generator.Emit (OpCodes.Pop); - - if (!method.IsAbstract) { - generator.Emit (OpCodes.Ldarg_0); - - for (int i = 0; i < paramTypes.Length; i++) - generator.Emit (OpCodes.Ldarg, i + 1); - - generator.Emit (OpCodes.Call, method); - - if (returnType == typeof(void)) - generator.Emit (OpCodes.Pop); - - generator.Emit (OpCodes.Ret); - generator.Emit (OpCodes.Ldnull); - } else - generator.Emit (OpCodes.Ldnull); - - var lab2 = generator.DefineLabel (); - generator.Emit (OpCodes.Br_S, lab2); - generator.MarkLabel (lab1); - // Function exists, call using method callFunction of LuaClassHelper - generator.Emit (OpCodes.Ldloc_0); - generator.Emit (OpCodes.Ldarg_0); - generator.Emit (OpCodes.Ldfld, returnTypesField); - generator.Emit (OpCodes.Ldc_I4, methodIndex); - generator.Emit (OpCodes.Ldelem_Ref); - generator.Emit (OpCodes.Ldloc_1); - generator.Emit (OpCodes.Ldloc_2); - generator.Emit (OpCodes.Call, classHelper.GetMethod ("CallFunction")); - generator.MarkLabel (lab2); - - // Stores the function return value - if (returnType == typeof(void)) { - generator.Emit (OpCodes.Pop); - generator.Emit (OpCodes.Ldnull); - } else if (returnType.IsValueType) { - generator.Emit (OpCodes.Unbox, returnType); - generator.Emit (OpCodes.Ldobj, returnType); - } else - generator.Emit (OpCodes.Castclass, returnType); - - generator.Emit (OpCodes.Stloc_3); - - // Sets return values of out and ref parameters - for (int i = 0; i < refArgs.Length; i++) { - generator.Emit (OpCodes.Ldarg, refArgs [i] + 1); - generator.Emit (OpCodes.Ldloc_0); - generator.Emit (OpCodes.Ldc_I4, refArgs [i]); - generator.Emit (OpCodes.Ldelem_Ref); - - if (paramTypes [refArgs [i]].GetElementType ().IsValueType) { - generator.Emit (OpCodes.Unbox, paramTypes [refArgs [i]].GetElementType ()); - generator.Emit (OpCodes.Ldobj, paramTypes [refArgs [i]].GetElementType ()); - generator.Emit (OpCodes.Stobj, paramTypes [refArgs [i]].GetElementType ()); - } else { - generator.Emit (OpCodes.Castclass, paramTypes [refArgs [i]].GetElementType ()); - generator.Emit (OpCodes.Stind_Ref); - } - } - - // Returns - if (!(returnType == typeof(void))) - generator.Emit (OpCodes.Ldloc_3); - - generator.Emit (OpCodes.Ret); - } -#endif - /* - * Gets an event handler for the event type that delegates to the eventHandler Lua function. - * Caches the generated type. - */ - public LuaEventHandler GetEvent (Type eventHandlerType, LuaFunction eventHandler) - { -#if MONOTOUCH - throw new NotImplementedException (" Emit not available on MonoTouch "); -#elif SILVERLIGHT - throw new NotImplementedException (" Emit not available on Silverlight "); -#elif NETFX_CORE - throw new NotImplementedException (" Emit not available on Windows Store "); -#else - Type eventConsumerType; - - if (eventHandlerCollection.ContainsKey (eventHandlerType)) - eventConsumerType = eventHandlerCollection [eventHandlerType]; - else { - eventConsumerType = GenerateEvent (eventHandlerType); - eventHandlerCollection [eventHandlerType] = eventConsumerType; - } - - var luaEventHandler = (LuaEventHandler)Activator.CreateInstance (eventConsumerType); - luaEventHandler.handler = eventHandler; - return luaEventHandler; -#endif - } - - public void RegisterLuaDelegateType (Type delegateType, Type luaDelegateType) - { - delegateCollection [delegateType] = luaDelegateType; - } - - public void RegisterLuaClassType (Type klass, Type luaClass) - { - LuaClassType luaClassType = new LuaClassType (); - luaClassType.klass = luaClass; - GetReturnTypesFromClass (klass, out luaClassType.returnTypes); - classCollection [klass] = luaClassType; - } - /* - * Gets a delegate with delegateType that calls the luaFunc Lua function - * Caches the generated type. - */ - public Delegate GetDelegate (Type delegateType, LuaFunction luaFunc) - { - var returnTypes = new List (); - Type luaDelegateType; - - if (delegateCollection.ContainsKey (delegateType)) - luaDelegateType = delegateCollection [delegateType]; - else { - luaDelegateType = GenerateDelegate (delegateType); - delegateCollection [delegateType] = luaDelegateType; - } - - var methodInfo = delegateType.GetMethod ("Invoke"); - returnTypes.Add (methodInfo.ReturnType); - - foreach (ParameterInfo paramInfo in methodInfo.GetParameters()) { - if (paramInfo.ParameterType.IsByRef) - returnTypes.Add (paramInfo.ParameterType); - } - - var luaDelegate = (LuaDelegate)Activator.CreateInstance (luaDelegateType); - luaDelegate.function = luaFunc; - luaDelegate.returnTypes = returnTypes.ToArray (); -#if NETFX_CORE - var mi = luaDelegate.GetType ().GetTypeInfo ().GetDeclaredMethod ("CallFunction"); - return mi.CreateDelegate (delegateType, luaDelegate); -#else - return Delegate.CreateDelegate (delegateType, luaDelegate, "CallFunction"); -#endif - } - - /* - * Gets an instance of an implementation of the klass interface or - * subclass of klass that delegates public virtual methods to the - * luaTable table. - * Caches the generated type. - */ - public object GetClassInstance (Type klass, LuaTable luaTable) - { - LuaClassType luaClassType; - - if (classCollection.ContainsKey (klass)) - luaClassType = classCollection [klass]; - else { - luaClassType = new LuaClassType (); - GenerateClass (klass, out luaClassType.klass, out luaClassType.returnTypes); - classCollection [klass] = luaClassType; - } - - return Activator.CreateInstance (luaClassType.klass, new object[] { - luaTable, - luaClassType.returnTypes - }); - } - } -} \ No newline at end of file diff --git a/Core/NLua/GenerateEventAssembly/DelegateGenerator.cs b/Core/NLua/GenerateEventAssembly/DelegateGenerator.cs deleted file mode 100644 index b944d96f2fc019d1142f0c5cf3dac1d894b90c74..0000000000000000000000000000000000000000 --- a/Core/NLua/GenerateEventAssembly/DelegateGenerator.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua -{ - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - #endif - /* - * Class used for generating delegates that get a function from the Lua - * stack as a delegate of a specific type. - * - * Author: Fabio Mascarenhas - * Version: 1.0 - */ - class DelegateGenerator - { - private ObjectTranslator translator; - private Type delegateType; - - - public DelegateGenerator (ObjectTranslator objectTranslator, Type type) - { - translator = objectTranslator; - delegateType = type; - } - - public object ExtractGenerated (LuaState luaState, int stackPos) - { - return CodeGeneration.Instance.GetDelegate (delegateType, translator.GetFunction (luaState, stackPos)); - } - } -} \ No newline at end of file diff --git a/Core/NLua/GenerateEventAssembly/ILuaGeneratedType.cs b/Core/NLua/GenerateEventAssembly/ILuaGeneratedType.cs deleted file mode 100644 index 543d273d1a8f8f7286743c030b2b9101298212fd..0000000000000000000000000000000000000000 --- a/Core/NLua/GenerateEventAssembly/ILuaGeneratedType.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua -{ - /* - * Common interface for types generated from tables. The method - * returns the table that overrides some or all of the type's methods. - */ - public interface ILuaGeneratedType - { - LuaTable LuaInterfaceGetLuaTable (); - } -} \ No newline at end of file diff --git a/Core/NLua/GenerateEventAssembly/LuaClassType.cs b/Core/NLua/GenerateEventAssembly/LuaClassType.cs deleted file mode 100644 index d40b523702515020976387dd8519b657e00a5f9c..0000000000000000000000000000000000000000 --- a/Core/NLua/GenerateEventAssembly/LuaClassType.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua -{ - /* - * Structure to store a type and the return types of - * its methods (the type of the returned value and out/ref - * parameters). - */ - struct LuaClassType - { - public Type klass; - public Type[][] returnTypes; - } -} \ No newline at end of file diff --git a/Core/NLua/Lua.cs b/Core/NLua/Lua.cs deleted file mode 100644 index 6193dce1082f8d9dd5473aaf452f98bf68b0973c..0000000000000000000000000000000000000000 --- a/Core/NLua/Lua.cs +++ /dev/null @@ -1,1216 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2014 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.IO; -using System.Linq; -using System.Threading; -using System.Reflection; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using NLua.Event; -using NLua.Method; -using NLua.Exceptions; -using NLua.Extensions; - -#if MONOTOUCH - using ObjCRuntime; -#endif - -namespace NLua -{ - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - using LuaHook = KopiLua.LuaHook; - using LuaDebug = KopiLua.LuaDebug; - using LuaNativeFunction = KopiLua.LuaNativeFunction; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - using LuaHook = KeraLua.LuaHook; - using LuaDebug = KeraLua.LuaDebug; - using LuaNativeFunction = KeraLua.LuaNativeFunction; - #endif - - /* - * Main class of NLua - * Object-oriented wrapper to Lua API - * - * Author: Fabio Mascarenhas - * Version: 1.0 - * - * // steffenj: important changes in Lua class: - * - removed all Open*Lib() functions - * - all libs automatically open in the Lua class constructor (just assign nil to unwanted libs) - * */ - [CLSCompliant(true)] - public class Lua : IDisposable - { - #region lua debug functions - /// - /// Event that is raised when an exception occures during a hook call. - /// - public event EventHandler HookException; - /// - /// Event when lua hook callback is called - /// - /// - /// Is only raised if SetDebugHook is called before. - /// - public event EventHandler DebugHook; - /// - /// lua hook calback delegate - /// - private LuaHook hookCallback = null; - #endregion - #region Globals auto-complete - private readonly List globals = new List (); - private bool globalsSorted; - #endregion - private LuaState luaState; - /// - /// True while a script is being executed - /// - public bool IsExecuting { get { return executing; } } - - private LuaNativeFunction panicCallback; - private ObjectTranslator translator; - /// - /// Used to protect the (global) object translator pool during add/remove - /// - private static readonly object translatorPoolLock = new object(); - - /// - /// Used to ensure multiple .net threads all get serialized by this single lock for access to the lua stack/objects - /// - //private object luaLock = new object(); - private bool _StatePassed; - private bool executing; - static string initLuanet = - @"local metatable = {} - local rawget = rawget - local import_type = luanet.import_type - local load_assembly = luanet.load_assembly - luanet.error, luanet.type = error, type - -- Lookup a .NET identifier component. - function metatable:__index(key) -- key is e.g. 'Form' - -- Get the fully-qualified name, e.g. 'System.Windows.Forms.Form' - local fqn = rawget(self,'.fqn') - fqn = ((fqn and fqn .. '.') or '') .. key - - -- Try to find either a luanet function or a CLR type - local obj = rawget(luanet,key) or import_type(fqn) - - -- If key is neither a luanet function or a CLR type, then it is simply - -- an identifier component. - if obj == nil then - -- It might be an assembly, so we load it too. - pcall(load_assembly,fqn) - obj = { ['.fqn'] = fqn } - setmetatable(obj, metatable) - end - - -- Cache this lookup - rawset(self, key, obj) - return obj - end - - -- A non-type has been called; e.g. foo = System.Foo() - function metatable:__call(...) - error('No such type: ' .. rawget(self,'.fqn'), 2) - end - - -- This is the root of the .NET namespace - luanet['.fqn'] = false - setmetatable(luanet, metatable) - - -- Preload the mscorlib assembly - luanet.load_assembly('mscorlib')"; - - static string clr_package = @"--- ---- This lua module provides auto importing of .net classes into a named package. ---- Makes for super easy use of LuaInterface glue ---- ---- example: ---- Threading = CLRPackage(""System"", ""System.Threading"") ---- Threading.Thread.Sleep(100) ---- ---- Extensions: ---- import() is a version of CLRPackage() which puts the package into a list which is used by a global __index lookup, ---- and thus works rather like C#'s using statement. It also recognizes the case where one is importing a local ---- assembly, which must end with an explicit .dll extension. - ---- Alternatively, luanet.namespace can be used for convenience without polluting the global namespace: ---- local sys,sysi = luanet.namespace {'System','System.IO'} --- sys.Console.WriteLine(""we are at {0}"",sysi.Directory.GetCurrentDirectory()) - - --- LuaInterface hosted with stock Lua interpreter will need to explicitly require this... -if not luanet then require 'luanet' end - -local import_type, load_assembly = luanet.import_type, luanet.load_assembly - -local mt = { - --- Lookup a previously unfound class and add it to our table - __index = function(package, classname) - local class = rawget(package, classname) - if class == nil then - class = import_type(package.packageName .. ""."" .. classname) - if class == nil then class = import_type(classname) end - package[classname] = class -- keep what we found around, so it will be shared - end - return class - end -} - -function luanet.namespace(ns) - if type(ns) == 'table' then - local res = {} - for i = 1,#ns do - res[i] = luanet.namespace(ns[i]) - end - return unpack(res) - end - -- FIXME - table.packageName could instead be a private index (see Lua 13.4.4) - local t = { packageName = ns } - setmetatable(t,mt) - return t -end - -local globalMT, packages - -local function set_global_mt() - packages = {} - globalMT = { - __index = function(T,classname) - for i,package in ipairs(packages) do - local class = package[classname] - if class then - _G[classname] = class - return class - end - end - end - } - setmetatable(_G, globalMT) -end - ---- Create a new Package class -function CLRPackage(assemblyName, packageName) - -- a sensible default... - packageName = packageName or assemblyName - local ok = pcall(load_assembly,assemblyName) -- Make sure our assembly is loaded - return luanet.namespace(packageName) -end - -function import (assemblyName, packageName) - if not globalMT then - set_global_mt() - end - if not packageName then - local i = assemblyName:find('%.dll$') - if i then packageName = assemblyName:sub(1,i-1) - else packageName = assemblyName end - end - local t = CLRPackage(assemblyName,packageName) - table.insert(packages,t) - return t -end - - -function luanet.make_array (tp,tbl) - local arr = tp[#tbl] - for i,v in ipairs(tbl) do - arr:SetValue(v,i-1) - end - return arr -end - -function luanet.each(o) - local e = o:GetEnumerator() - return function() - if e:MoveNext() then - return e.Current - end - end -end -"; - public bool UseTraceback { get; set; } = false; - - #region Globals auto-complete - /// - /// An alphabetically sorted list of all globals (objects, methods, etc.) externally added to this Lua instance - /// - /// Members of globals are also listed. The formatting is optimized for text input auto-completion. - public IEnumerable Globals { - get { - // Only sort list when necessary - if (!globalsSorted) { - globals.Sort (); - globalsSorted = true; - } - - return globals; - } - } - #endregion - - public Lua () - { - luaState = LuaLib.LuaLNewState (); - LuaLib.LuaLOpenLibs (luaState); - Init (); - // We need to keep this in a managed reference so the delegate doesn't get garbage collected - panicCallback = new LuaNativeFunction (PanicCallback); - LuaLib.LuaAtPanic (luaState, panicCallback); - } - - /* - * CAUTION: NLua.Lua instances can't share the same lua state! - */ - public Lua (LuaState lState) - { - LuaLib.LuaPushString (lState, "LUAINTERFACE LOADED"); - LuaLib.LuaGetTable (lState, (int)LuaIndexes.Registry); - - if (LuaLib.LuaToBoolean (lState, -1)) { - LuaLib.LuaSetTop (lState, -2); - throw new LuaException ("There is already a NLua.Lua instance associated with this Lua state"); - } else { - luaState = lState; - _StatePassed = true; - LuaLib.LuaSetTop (luaState, -2); - Init (); - } - } - - void Init () - { - LuaLib.LuaPushString (luaState, "LUAINTERFACE LOADED"); - LuaLib.LuaPushBoolean (luaState, true); - LuaLib.LuaSetTable (luaState, (int)LuaIndexes.Registry); - if (_StatePassed == false) { - LuaLib.LuaNewTable (luaState); - LuaLib.LuaSetGlobal (luaState, "luanet"); - } - LuaLib.LuaNetPushGlobalTable (luaState); - LuaLib.LuaGetGlobal (luaState, "luanet"); - LuaLib.LuaPushString (luaState, "getmetatable"); - LuaLib.LuaGetGlobal (luaState, "getmetatable"); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaNetPopGlobalTable (luaState); - translator = new ObjectTranslator (this, luaState); - lock (translatorPoolLock) - { - ObjectTranslatorPool.Instance.Add (luaState, translator); - } - LuaLib.LuaNetPopGlobalTable (luaState); - LuaLib.LuaLDoString (luaState, Lua.initLuanet); - } - - public void Close () - { - if (_StatePassed) - return; - - if (! CheckNull.IsNull(luaState)) { - lock (translatorPoolLock) - { - LuaCore.LuaClose (luaState); - ObjectTranslatorPool.Instance.Remove (luaState); - } - } - } - -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - static int PanicCallback (LuaState luaState) - { - string reason = string.Format ("unprotected error in call to Lua API ({0})", LuaLib.LuaToString (luaState, -1)); - throw new LuaException (reason); - } - - /// - /// Assuming we have a Lua error string sitting on the stack, throw a C# exception out to the user's app - /// - /// Thrown if the script caused an exception - private void ThrowExceptionFromError (int oldTop) - { - object err = translator.GetObject (luaState, -1); - LuaLib.LuaSetTop (luaState, oldTop); - - // A pre-wrapped exception - just rethrow it (stack trace of InnerException will be preserved) - var luaEx = err as LuaScriptException; - - if (luaEx != null) - throw luaEx; - - // A non-wrapped Lua error (best interpreted as a string) - wrap it and throw it - if (err == null) - err = "Unknown Lua Error"; - - throw new LuaScriptException (err.ToString (), string.Empty); - } - - /// - /// Push a debug.traceback reference onto the stack, for a pcall function to use as error handler. (Remember to increment any top-of-stack markers!) - /// - private int PushDebugTraceback(LuaState luaState, int argcount) - { - LuaLib.LuaGetGlobal(luaState, "debug"); - LuaLib.LuaGetField(luaState, -1, "traceback"); - LuaLib.LuaRemove(luaState, -2); - int errindex = -argcount -2; - LuaLib.LuaInsert(luaState, errindex); - return errindex; - } - - /// - /// Return a debug.traceback() call result (a multi-line string, containing a full stack trace, including C calls. - /// Note: it won't return anything unless the interpreter is in the middle of execution - that is, it only makes sense to call it from a method called from Lua, or during a coroutine yield. - /// - public string GetDebugTraceback() - { - int oldTop = LuaLib.LuaGetTop(luaState); - LuaLib.LuaGetGlobal(luaState, "debug"); // stack: debug - LuaLib.LuaGetField(luaState, -1, "traceback"); // stack: debug,traceback - LuaLib.LuaRemove(luaState, -2); // stack: traceback - LuaLib.LuaPCall(luaState, 0, -1, 0); - return translator.PopValues(luaState, oldTop)[0] as string; - } - - /// - /// Convert C# exceptions into Lua errors - /// - /// num of things on stack - /// null for no pending exception - internal int SetPendingException (Exception e) - { - var caughtExcept = e; - - if (caughtExcept != null) { - translator.ThrowError (luaState, caughtExcept); - LuaLib.LuaPushNil (luaState); - return 1; - } else - return 0; - } - - /// - /// - /// - /// - /// - /// - public LuaFunction LoadString (string chunk, string name) - { - int oldTop = LuaLib.LuaGetTop (luaState); - executing = true; - - try { - if (LuaLib.LuaLLoadBuffer (luaState, chunk, name) != 0) - ThrowExceptionFromError (oldTop); - } finally { - executing = false; - } - - var result = translator.GetFunction (luaState, -1); - translator.PopValues (luaState, oldTop); - return result; - } - - /// - /// - /// - /// - /// - /// - public LuaFunction LoadString (byte[] chunk, string name) - { - int oldTop = LuaLib.LuaGetTop (luaState); - executing = true; - - try { - if (LuaLib.LuaLLoadBuffer (luaState, chunk, name) != 0) - ThrowExceptionFromError (oldTop); - } finally { - executing = false; - } - - var result = translator.GetFunction (luaState, -1); - translator.PopValues (luaState, oldTop); - return result; - } - - /// - /// Load a File on, and return a LuaFunction to execute the file loaded (useful to see if the syntax of a file is ok) - /// - /// - /// - public LuaFunction LoadFile (string fileName) - { - int oldTop = LuaLib.LuaGetTop (luaState); - - if (LuaLib.LuaLLoadFile (luaState, fileName) != 0) - ThrowExceptionFromError (oldTop); - - var result = translator.GetFunction (luaState, -1); - translator.PopValues (luaState, oldTop); - return result; - } - - /// - /// Executes a Lua chunk and returns all the chunk's return values in an array. - /// - /// Chunk to execute - /// Name to associate with the chunk. Defaults to "chunk". - /// - public object[] DoString (byte[] chunk, string chunkName = "chunk") - { - int oldTop = LuaLib.LuaGetTop(luaState); - executing = true; - - if (LuaLib.LuaLLoadBuffer(luaState, chunk, chunkName) == 0) - { - int errfunction = 0; - if (UseTraceback) { - errfunction = PushDebugTraceback(luaState, 0); - oldTop++; - } - - try - { - if (LuaLib.LuaPCall(luaState, 0, -1, errfunction) == 0) - return translator.PopValues(luaState, oldTop); - else - ThrowExceptionFromError(oldTop); - } - finally - { - executing = false; - } - } - else - ThrowExceptionFromError(oldTop); - - return null; // Never reached - keeps compiler happy - } - - /// - /// Executes a Lua chunk and returns all the chunk's return values in an array. - /// - /// Chunk to execute - /// Name to associate with the chunk. Defaults to "chunk". - /// - public object[] DoString (string chunk, string chunkName = "chunk") - { - int oldTop = LuaLib.LuaGetTop(luaState); - executing = true; - - if (LuaLib.LuaLLoadBuffer(luaState, chunk, chunkName) == 0) - { - int errfunction = 0; - if (UseTraceback) { - errfunction = PushDebugTraceback(luaState, 0); - oldTop++; - } - - try - { - if (LuaLib.LuaPCall(luaState, 0, -1, errfunction) == 0) - return translator.PopValues(luaState, oldTop); - else - ThrowExceptionFromError(oldTop); - } - finally - { - executing = false; - } - } - else - ThrowExceptionFromError(oldTop); - - return null; // Never reached - keeps compiler happy - } - - /* - * Excutes a Lua file and returns all the chunk's return - * values in an array - */ - public object[] DoFile (string fileName) - { - int oldTop = LuaLib.LuaGetTop (luaState); - - if (LuaLib.LuaLLoadFile (luaState, fileName) == 0) { - executing = true; - - int errfunction = 0; - if (UseTraceback) { - errfunction = PushDebugTraceback(luaState, 0); - oldTop++; - } - - try { - if (LuaLib.LuaPCall(luaState, 0, -1, errfunction) == 0) - return translator.PopValues (luaState, oldTop); - else - ThrowExceptionFromError (oldTop); - } finally { - executing = false; - } - } else - ThrowExceptionFromError (oldTop); - - return null; // Never reached - keeps compiler happy - } - - - /* - * Indexer for global variables from the LuaInterpreter - * Supports navigation of tables by using . operator - */ - public object this [string fullPath] { - get { - object returnValue = null; - int oldTop = LuaLib.LuaGetTop (luaState); - string [] path = FullPathToArray (fullPath); - LuaLib.LuaGetGlobal (luaState, path [0]); - returnValue = translator.GetObject (luaState, -1); - LuaBase dispose = null; - - if (path.Length > 1) { - dispose = returnValue as LuaBase; - string[] remainingPath = new string[path.Length - 1]; - Array.Copy (path, 1, remainingPath, 0, path.Length - 1); - returnValue = GetObject (remainingPath); - if (dispose != null) - dispose.Dispose (); - } - - LuaLib.LuaSetTop (luaState, oldTop); - return returnValue; - } - set { - int oldTop = LuaLib.LuaGetTop (luaState); - string [] path = FullPathToArray (fullPath); - if (path.Length == 1) { - translator.Push (luaState, value); - LuaLib.LuaSetGlobal (luaState, fullPath); - } else { - LuaLib.LuaGetGlobal (luaState, path [0]); - string[] remainingPath = new string[path.Length - 1]; - Array.Copy (path, 1, remainingPath, 0, path.Length - 1); - SetObject (remainingPath, value); - } - - LuaLib.LuaSetTop (luaState, oldTop); - - // Globals auto-complete - if (value == null) { - // Remove now obsolete entries - globals.Remove (fullPath); - } else { - // Add new entries - if (!globals.Contains (fullPath)) - RegisterGlobal (fullPath, value.GetType (), 0); - } - } - } - - #region Globals auto-complete - /// - /// Adds an entry to (recursivley handles 2 levels of members) - /// - /// The index accessor path ot the entry - /// The type of the entry - /// How deep have we gone with recursion? - private void RegisterGlobal (string path, Type type, int recursionCounter) - { - // If the type is a global method, list it directly - if (type == typeof(LuaNativeFunction)) { - // Format for easy method invocation - globals.Add (path + "("); - } - // If the type is a class or an interface and recursion hasn't been running too long, list the members - else if ((type.IsClass () || type.IsInterface ()) && type != typeof(string) && recursionCounter < 2) { - #region Methods - foreach (var method in type.GetMethods(BindingFlags.Public | BindingFlags.Instance)) { - string name = method.Name; - if ( - // Check that the LuaHideAttribute and LuaGlobalAttribute were not applied - (!method.GetCustomAttributes (typeof(LuaHideAttribute), false).Any ()) && - (!method.GetCustomAttributes (typeof(LuaGlobalAttribute), false).Any ()) && - // Exclude some generic .NET methods that wouldn't be very usefull in Lua - name != "GetType" && name != "GetHashCode" && name != "Equals" && - name != "ToString" && name != "Clone" && name != "Dispose" && - name != "GetEnumerator" && name != "CopyTo" && - !name.StartsWith ("get_", StringComparison.Ordinal) && - !name.StartsWith ("set_", StringComparison.Ordinal) && - !name.StartsWith ("add_", StringComparison.Ordinal) && - !name.StartsWith ("remove_", StringComparison.Ordinal)) { - // Format for easy method invocation - string command = path + ":" + name + "("; - - if (method.GetParameters ().Length == 0) - command += ")"; - globals.Add (command); - } - } - #endregion - - #region Fields - foreach (var field in type.GetFields(BindingFlags.Public | BindingFlags.Instance)) { - if ( - // Check that the LuaHideAttribute and LuaGlobalAttribute were not applied - (!field.GetCustomAttributes (typeof(LuaHideAttribute), false).Any ()) && - (!field.GetCustomAttributes (typeof(LuaGlobalAttribute), false).Any ())) { - // Go into recursion for members - RegisterGlobal (path + "." + field.Name, field.FieldType, recursionCounter + 1); - } - } - #endregion - - #region Properties - foreach (var property in type.GetProperties (BindingFlags.Public | BindingFlags.Instance)) { - if ( - // Check that the LuaHideAttribute and LuaGlobalAttribute were not applied - (!property.GetCustomAttributes (typeof(LuaHideAttribute), false).Any ()) && - (!property.GetCustomAttributes (typeof(LuaGlobalAttribute), false).Any ()) - // Exclude some generic .NET properties that wouldn't be very useful in Lua - && property.Name != "Item") { - // Go into recursion for members - RegisterGlobal (path + "." + property.Name, property.PropertyType, recursionCounter + 1); - } - } - #endregion - } else - globals.Add (path); // Otherwise simply add the element to the list - - // List will need to be sorted on next access - globalsSorted = false; - } - #endregion - - /* - * Navigates a table in the top of the stack, returning - * the value of the specified field - */ - object GetObject (string[] remainingPath) - { - object returnValue = null; - - for (int i = 0; i < remainingPath.Length; i++) { - LuaLib.LuaPushString (luaState, remainingPath [i]); - LuaLib.LuaGetTable (luaState, -2); - returnValue = translator.GetObject (luaState, -1); - - if (returnValue == null) - break; - } - - return returnValue; - } - - /* - * Gets a numeric global variable - */ - public double GetNumber (string fullPath) - { - return (double)this [fullPath]; - } - - /* - * Gets a string global variable - */ - public string GetString (string fullPath) - { - return this [fullPath].ToString (); - } - - /* - * Gets a table global variable - */ - public LuaTable GetTable (string fullPath) - { - return (LuaTable)this [fullPath]; - } - - /* - * Gets a table global variable as an object implementing - * the interfaceType interface - */ - public object GetTable (Type interfaceType, string fullPath) - { - return CodeGeneration.Instance.GetClassInstance (interfaceType, GetTable (fullPath)); - } - - /* - * Gets a function global variable - */ - public LuaFunction GetFunction (string fullPath) - { - object obj = this [fullPath]; - return (obj is LuaNativeFunction ? new LuaFunction ((LuaNativeFunction)obj, this) : (LuaFunction)obj); - } - - /* - * Register a delegate type to be used to convert Lua functions to C# delegates (useful for iOS where there is no dynamic code generation) - * type delegateType - */ - public void RegisterLuaDelegateType (Type delegateType, Type luaDelegateType) - { - CodeGeneration.Instance.RegisterLuaDelegateType (delegateType, luaDelegateType); - } - - public void RegisterLuaClassType (Type klass, Type luaClass) - { - CodeGeneration.Instance.RegisterLuaClassType (klass, luaClass); - } - - public void LoadCLRPackage () - { - LuaLib.LuaLDoString (luaState, Lua.clr_package); - } - /* - * Gets a function global variable as a delegate of - * type delegateType - */ - public Delegate GetFunction (Type delegateType, string fullPath) - { - return CodeGeneration.Instance.GetDelegate (delegateType, GetFunction (fullPath)); - } - - /* - * Calls the object as a function with the provided arguments, - * returning the function's returned values inside an array - */ - internal object[] CallFunction (object function, object[] args) - { - return CallFunction (function, args, null); - } - - /* - * Calls the object as a function with the provided arguments and - * casting returned values to the types in returnTypes before returning - * them in an array - */ - internal object[] CallFunction (object function, object[] args, Type[] returnTypes) - { - int nArgs = 0; - int oldTop = LuaLib.LuaGetTop (luaState); - - if (!LuaLib.LuaCheckStack (luaState, args.Length + 6)) - throw new LuaException ("Lua stack overflow"); - - translator.Push (luaState, function); - - if (args != null) { - nArgs = args.Length; - - for (int i = 0; i < args.Length; i++) - translator.Push (luaState, args [i]); - } - - executing = true; - - try { - int errfunction = 0; - if (UseTraceback) { - errfunction = PushDebugTraceback(luaState, nArgs); - oldTop++; - } - - int error = LuaLib.LuaPCall (luaState, nArgs, -1, errfunction); - if (error != 0) - ThrowExceptionFromError (oldTop); - } finally { - executing = false; - } - - return returnTypes != null ? translator.PopValues (luaState, oldTop, returnTypes) : translator.PopValues (luaState, oldTop); - } - - /* - * Navigates a table to set the value of one of its fields - */ - void SetObject (string[] remainingPath, object val) - { - for (int i = 0; i < remainingPath.Length-1; i++) { - LuaLib.LuaPushString (luaState, remainingPath [i]); - LuaLib.LuaGetTable (luaState, -2); - } - - LuaLib.LuaPushString (luaState, remainingPath [remainingPath.Length - 1]); - translator.Push (luaState, val); - LuaLib.LuaSetTable (luaState, -3); - } - - string [] FullPathToArray (string fullPath) - { - return fullPath.SplitWithEscape ('.', '\\').ToArray (); - } - /* - * Creates a new table as a global variable or as a field - * inside an existing table - */ - public void NewTable (string fullPath) - { - string [] path = FullPathToArray (fullPath); - int oldTop = LuaLib.LuaGetTop (luaState); - - if (path.Length == 1) { - LuaLib.LuaNewTable (luaState); - LuaLib.LuaSetGlobal (luaState, fullPath); - } else { - LuaLib.LuaGetGlobal (luaState, path [0]); - - for (int i = 1; i < path.Length-1; i++) { - LuaLib.LuaPushString (luaState, path [i]); - LuaLib.LuaGetTable (luaState, -2); - } - - LuaLib.LuaPushString (luaState, path [path.Length - 1]); - LuaLib.LuaNewTable (luaState); - LuaLib.LuaSetTable (luaState, -3); - } - - LuaLib.LuaSetTop (luaState, oldTop); - } - - public Dictionary GetTableDict (LuaTable table) - { - var dict = new Dictionary (); - int oldTop = LuaLib.LuaGetTop (luaState); - translator.Push (luaState, table); - LuaLib.LuaPushNil (luaState); - - while (LuaLib.LuaNext(luaState, -2) != 0) { - dict [translator.GetObject (luaState, -2)] = translator.GetObject (luaState, -1); - LuaLib.LuaSetTop (luaState, -2); - } - - LuaLib.LuaSetTop (luaState, oldTop); - return dict; - } - - /* - * Lets go of a previously allocated reference to a table, function - * or userdata - */ - #region lua debug functions - /// - /// Activates the debug hook - /// - /// Mask - /// Count - /// see lua docs. -1 if hook is already set - public int SetDebugHook (EventMasks mask, int count) - { - if (hookCallback == null) { - hookCallback = new LuaHook (Lua.DebugHookCallback); - return LuaCore.LuaSetHook (luaState, hookCallback, (int)mask, count); - } - - return -1; - } - - /// - /// Removes the debug hook - /// - /// see lua docs - public int RemoveDebugHook () - { - hookCallback = null; - return LuaCore.LuaSetHook (luaState, null, 0, 0); - } - - /// - /// Gets the hook mask. - /// - /// hook mask - public EventMasks GetHookMask () - { - return (EventMasks)LuaCore.LuaGetHookMask (luaState); - } - - /// - /// Gets the hook count - /// - /// see lua docs - public int GetHookCount () - { - return LuaCore.LuaGetHookCount (luaState); - } - - - /// - /// Gets local (see lua docs) - /// - /// lua debug structure - /// see lua docs - /// see lua docs - public string GetLocal (LuaDebug luaDebug, int n) - { - return LuaCore.LuaGetLocal (luaState, luaDebug, n).ToString (); - } - - /// - /// Sets local (see lua docs) - /// - /// lua debug structure - /// see lua docs - /// see lua docs - public string SetLocal (LuaDebug luaDebug, int n) - { - return LuaCore.LuaSetLocal (luaState, luaDebug, n).ToString (); - } - - public int GetStack (int level, ref LuaDebug ar) - { - return LuaCore.LuaGetStack (luaState, level,ref ar); - } - - public int GetInfo (string what, ref LuaDebug ar) - { - return LuaCore.LuaGetInfo (luaState, what, ref ar); - } - - /// - /// Gets up value (see lua docs) - /// - /// see lua docs - /// see lua docs - /// see lua docs - public string GetUpValue (int funcindex, int n) - { - return LuaCore.LuaGetUpValue (luaState, funcindex, n).ToString (); - } - - /// - /// Sets up value (see lua docs) - /// - /// see lua docs - /// see lua docs - /// see lua docs - public string SetUpValue (int funcindex, int n) - { - return LuaCore.LuaSetUpValue (luaState, funcindex, n).ToString (); - } - - /// - /// Delegate that is called on lua hook callback - /// - /// lua state - /// Pointer to LuaDebug (lua_debug) structure - /// -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaHook))] -#endif -#if USE_KOPILUA - static void DebugHookCallback (LuaState luaState, LuaDebug debug) - { -#elif NETFX_CORE - static void DebugHookCallback (LuaState luaState, long luaDebug) - { - IntPtr ptr = new IntPtr (luaDebug); - LuaDebug debug = System.Runtime.InteropServices.Marshal.PtrToStructure (ptr); -#else - static void DebugHookCallback (LuaState luaState, IntPtr luaDebug) - { - LuaDebug debug = (LuaDebug)System.Runtime.InteropServices.Marshal.PtrToStructure (luaDebug, typeof (LuaDebug)); -#endif - ObjectTranslator translator = ObjectTranslatorPool.Instance.Find (luaState); - Lua lua = translator.Interpreter; - lua.DebugHookCallbackInternal (luaState, debug); - } - - private void DebugHookCallbackInternal (LuaState luaState, LuaDebug luaDebug) - { - try { - var temp = DebugHook; - - if (temp != null) - temp (this, new DebugHookEventArgs (luaDebug)); - } catch (Exception ex) { - OnHookException (new HookExceptionEventArgs (ex)); - } - } - - private void OnHookException (HookExceptionEventArgs e) - { - var temp = HookException; - if (temp != null) - temp (this, e); - } - - /// - /// Pops a value from the lua stack. - /// - /// Returns the top value from the lua stack. - public object Pop () - { - int top = LuaLib.LuaGetTop (luaState); - return translator.PopValues (luaState, top - 1) [0]; - } - - /// - /// Pushes a value onto the lua stack. - /// - /// Value to push. - public void Push (object value) - { - translator.Push (luaState, value); - } - #endregion - - internal void DisposeInternal (int reference) - { - if (! CheckNull.IsNull(luaState)) //Fix submitted by Qingrui Li - LuaLib.LuaUnref (luaState, reference); - } - - /* - * Gets a field of the table corresponding to the provided reference - * using rawget (do not use metatables) - */ - internal object RawGetObject (int reference, string field) - { - int oldTop = LuaLib.LuaGetTop (luaState); - LuaLib.LuaGetRef (luaState, reference); - LuaLib.LuaPushString (luaState, field); - LuaLib.LuaRawGet (luaState, -2); - object obj = translator.GetObject (luaState, -1); - LuaLib.LuaSetTop (luaState, oldTop); - return obj; - } - - /* - * Gets a field of the table or userdata corresponding to the provided reference - */ - internal object GetObject (int reference, string field) - { - int oldTop = LuaLib.LuaGetTop (luaState); - LuaLib.LuaGetRef (luaState, reference); - object returnValue = GetObject (FullPathToArray (field)); - LuaLib.LuaSetTop (luaState, oldTop); - return returnValue; - } - - /* - * Gets a numeric field of the table or userdata corresponding the the provided reference - */ - internal object GetObject (int reference, object field) - { - int oldTop = LuaLib.LuaGetTop (luaState); - LuaLib.LuaGetRef (luaState, reference); - translator.Push (luaState, field); - LuaLib.LuaGetTable (luaState, -2); - object returnValue = translator.GetObject (luaState, -1); - LuaLib.LuaSetTop (luaState, oldTop); - return returnValue; - } - - /* - * Sets a field of the table or userdata corresponding the the provided reference - * to the provided value - */ - internal void SetObject (int reference, string field, object val) - { - int oldTop = LuaLib.LuaGetTop (luaState); - LuaLib.LuaGetRef (luaState, reference); - SetObject (FullPathToArray (field), val); - LuaLib.LuaSetTop (luaState, oldTop); - } - - /* - * Sets a numeric field of the table or userdata corresponding the the provided reference - * to the provided value - */ - internal void SetObject (int reference, object field, object val) - { - int oldTop = LuaLib.LuaGetTop (luaState); - LuaLib.LuaGetRef (luaState, reference); - translator.Push (luaState, field); - translator.Push (luaState, val); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaSetTop (luaState, oldTop); - } - - public LuaFunction RegisterFunction (string path,MethodBase function /*MethodInfo function*/) - { - return RegisterFunction (path, null, function); - } - - /* - * Registers an object's method as a Lua function (global or table field) - * The method may have any signature - */ - public LuaFunction RegisterFunction (string path, object target, MethodBase function /*MethodInfo function*/) //CP: Fix for struct constructor by Alexander Kappner (link: http://luaforge.net/forum/forum.php?thread_id = 2859&forum_id = 145) - { - // We leave nothing on the stack when we are done - int oldTop = LuaLib.LuaGetTop (luaState); - var wrapper = new LuaMethodWrapper (translator, target, new ProxyType(function.DeclaringType), function); - translator.Push (luaState, new LuaNativeFunction (wrapper.invokeFunction)); - this [path] = translator.GetObject (luaState, -1); - var f = GetFunction (path); - LuaLib.LuaSetTop (luaState, oldTop); - return f; - } - - /* - * Compares the two values referenced by ref1 and ref2 for equality - */ - internal bool CompareRef (int ref1, int ref2) - { - int top = LuaLib.LuaGetTop (luaState); - LuaLib.LuaGetRef (luaState, ref1); - LuaLib.LuaGetRef (luaState, ref2); - int equal = LuaLib.LuaEqual (luaState, -1, -2); - LuaLib.LuaSetTop (luaState, top); - return (equal != 0); - } - - internal void PushCSFunction (LuaNativeFunction function) - { - translator.PushFunction (luaState, function); - } - - #region IDisposable Members - public virtual void Dispose () - { - if (translator != null) { - translator.pendingEvents.Dispose (); - translator = null; - } - - Close (); - GC.WaitForPendingFinalizers (); - } - #endregion - } -} diff --git a/Core/NLua/LuaBase.cs b/Core/NLua/LuaBase.cs deleted file mode 100644 index 851a3ad24a292f88badf8d218df7eee2d85c2ec2..0000000000000000000000000000000000000000 --- a/Core/NLua/LuaBase.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Text; -using System.Collections.Generic; - -namespace NLua -{ - /// - /// Base class to provide consistent disposal flow across lua objects. Uses code provided by Yves Duhoux and suggestions by Hans Schmeidenbacher and Qingrui Li - /// - public abstract class LuaBase : IDisposable - { - private bool _Disposed; - [CLSCompliantAttribute(false)] - protected int - _Reference; - [CLSCompliantAttribute(false)] - protected Lua - _Interpreter; - - ~LuaBase () - { - Dispose (false); - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - public virtual void Dispose (bool disposeManagedResources) - { - if (!_Disposed) { - if (disposeManagedResources) { - if (_Reference != 0) - _Interpreter.DisposeInternal (_Reference); - } - - _Interpreter = null; - _Disposed = true; - } - } - - public override bool Equals (object o) - { - if (o is LuaBase) { - var l = (LuaBase)o; - return _Interpreter.CompareRef (l._Reference, _Reference); - } else - return false; - } - - public override int GetHashCode () - { - return _Reference; - } - } -} \ No newline at end of file diff --git a/Core/NLua/LuaFunction.cs b/Core/NLua/LuaFunction.cs deleted file mode 100644 index cab177d6d320000a951365ac25926ce7ee5da6c4..0000000000000000000000000000000000000000 --- a/Core/NLua/LuaFunction.cs +++ /dev/null @@ -1,112 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Text; -using System.Collections.Generic; - -namespace NLua -{ - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - using LuaNativeFunction = KopiLua.LuaNativeFunction; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - using LuaNativeFunction = KeraLua.LuaNativeFunction; - #endif - - public class LuaFunction : LuaBase - { - internal LuaNativeFunction function; - - public LuaFunction (int reference, Lua interpreter) - { - _Reference = reference; - this.function = null; - _Interpreter = interpreter; - } - - public LuaFunction (LuaNativeFunction function, Lua interpreter) - { - _Reference = 0; - this.function = function; - _Interpreter = interpreter; - } - - /* - * Calls the function casting return values to the types - * in returnTypes - */ - internal object[] Call (object[] args, Type[] returnTypes) - { - return _Interpreter.CallFunction (this, args, returnTypes); - } - - /* - * Calls the function and returns its return values inside - * an array - */ - public object[] Call (params object[] args) - { - return _Interpreter.CallFunction (this, args); - } - - /* - * Pushes the function into the Lua stack - */ - internal void Push (LuaState luaState) - { - if (_Reference != 0) - LuaLib.LuaGetRef (luaState, _Reference); - else - _Interpreter.PushCSFunction (function); - } - - public override string ToString () - { - return "function"; - } - - public override bool Equals (object o) - { - if (o is LuaFunction) { - var l = (LuaFunction)o; - - if (this._Reference != 0 && l._Reference != 0) - return _Interpreter.CompareRef (l._Reference, this._Reference); - else - return this.function == l.function; - } else - return false; - } - - public override int GetHashCode () - { - return _Reference != 0 ? _Reference : function.GetHashCode (); - } - } -} \ No newline at end of file diff --git a/Core/NLua/LuaGlobalAttribute.cs b/Core/NLua/LuaGlobalAttribute.cs deleted file mode 100644 index adcc18f4902683e2105c5f0b32b1ca2a713f8017..0000000000000000000000000000000000000000 --- a/Core/NLua/LuaGlobalAttribute.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua -{ - /// - /// Marks a method for global usage in Lua scripts - /// - /// - /// - [AttributeUsage(AttributeTargets.Method)] - public sealed class LuaGlobalAttribute : Attribute - { - /// - /// An alternative name to use for calling the function in Lua - leave empty for CLR name - /// - public string Name { get; set; } - - /// - /// A description of the function - /// - public string Description { get; set; } - } -} \ No newline at end of file diff --git a/Core/NLua/LuaHideAttribute.cs b/Core/NLua/LuaHideAttribute.cs deleted file mode 100644 index ef59dda419fddb3152e75ce548b110a28a35cff6..0000000000000000000000000000000000000000 --- a/Core/NLua/LuaHideAttribute.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua -{ - /// - /// Marks a method, field or property to be hidden from Lua auto-completion - /// - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] - public sealed class LuaHideAttribute : Attribute - { - } -} \ No newline at end of file diff --git a/Core/NLua/LuaLib/GCOptions.cs b/Core/NLua/LuaLib/GCOptions.cs deleted file mode 100644 index 9165e7261fbb959fd7ff94b30d70a6c075163533..0000000000000000000000000000000000000000 --- a/Core/NLua/LuaLib/GCOptions.cs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2009 Joshua Simmons - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua -{ - public enum GCOptions : int - { - /// - /// Stops the garbage collector. - /// - Stop = 0, - - /// - /// Restarts the garbage collector. - /// - Restart = 1, - - /// - /// Performs a full garbage-collection cycle. - /// - Collect = 2, - - /// - /// Returns the current amount of memory (in Kbytes) in use by KopiLua.Lua. - /// - Count = 3, - - /// - /// Returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024. - /// - CountB = 4, - - /// - /// Performs an incremental step of garbage collection. The step "size" is controlled by data (larger values mean more steps) in a non-specified way. ifyou want to control the step size you must experimentally tune the value of data. The function returns 1 ifthe step finished a garbage-collection cycle. - /// - Step = 5, - - /// - /// Sets data as the new value for the pause (Controls how long the collector waits before starting a new cycle) of the collector (see §2.10). The function returns the previous value of the pause. - /// - SetPause = 6, - - /// - /// Sets data as the new value for the step multiplier of the collector (Controls the relative speed of the collector relative to memory allocation.). The function returns the previous value of the step multiplier. - /// - SetStepMul = 7 - } -} \ No newline at end of file diff --git a/Core/NLua/LuaLib/LuaEnums.cs b/Core/NLua/LuaLib/LuaEnums.cs deleted file mode 100644 index 60995b43a3f8daac7aa0af8ebb9292394f71dd28..0000000000000000000000000000000000000000 --- a/Core/NLua/LuaLib/LuaEnums.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2009 Joshua Simmons - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua -{ - /// - /// Enumeration of basic lua globals. - /// - public enum LuaEnums : int - { - /// - /// Option for multiple returns in `lua_pcall' and `lua_call' - /// - MultiRet = -1, - - /// - /// Everything is OK. - /// - Ok = 0, - - /// - /// Thread status, Ok or Yield - /// - Yield = 1, - - /// - /// A Runtime error. - /// - ErrorRun = 2, - - /// - /// A syntax error. - /// - ErrorSyntax = 3, - - /// - /// A memory allocation error. For such errors, Lua does not call the error handler function. - /// - ErrorMemory = 4, - - /// - /// An error in the error handling function. - /// - ErrorError = 5, - - /// - /// An extra error for file load errors when using luaL_loadfile. - /// - ErrorFile = 6 - } -} \ No newline at end of file diff --git a/Core/NLua/LuaLib/LuaIndexes.cs b/Core/NLua/LuaLib/LuaIndexes.cs deleted file mode 100644 index 16212d936d0607b4b227a609c187ba80ed527e49..0000000000000000000000000000000000000000 --- a/Core/NLua/LuaLib/LuaIndexes.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2009 Joshua Simmons - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua -{ - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - #endif - - public class LuaIndexes - { - static int registryIndex = 0; - - public static int Registry { - get - { - if (registryIndex != 0) - return registryIndex; - registryIndex = LuaCore.LuaNetRegistryIndex (); - return registryIndex; - } - } - } -} \ No newline at end of file diff --git a/Core/NLua/LuaLib/LuaLib.cs b/Core/NLua/LuaLib/LuaLib.cs deleted file mode 100755 index 71b38368ac2382f5cb83c907b46979923930bb34..0000000000000000000000000000000000000000 --- a/Core/NLua/LuaLib/LuaLib.cs +++ /dev/null @@ -1,467 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2014 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2009 Joshua Simmons - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.IO; -using System.Text; -using NLua.Extensions; - -namespace NLua -{ - - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - using LuaTag = KopiLua.LuaTag; - using LuaNativeFunction = KopiLua.LuaNativeFunction; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - using LuaTag = KeraLua.LuaTag; - using LuaNativeFunction = KeraLua.LuaNativeFunction; - #endif - - - - public class LuaLib - { - public static int LuaGC (LuaState luaState, GCOptions what, int data) - { - return LuaCore.LuaGC (luaState, (int)what, data); - } - - public static string LuaTypeName (LuaState luaState, LuaTypes type) - { - return LuaCore.LuaTypeName (luaState, (int)type).ToString (); - } - - public static string LuaLTypeName (LuaState luaState, int stackPos) - { - return LuaTypeName (luaState, LuaType (luaState, stackPos)); - } - - public static void LuaLError (LuaState luaState, string message) - { - LuaCore.LuaLError (luaState, message); - } - - public static void LuaLWhere (LuaState luaState, int level) - { - LuaCore.LuaLWhere (luaState, level); - } - - public static LuaState LuaLNewState () - { - return LuaCore.LuaLNewState (); - } - - public static void LuaLOpenLibs (LuaState luaState) - { - LuaCore.LuaLOpenLibs (luaState); - } - - public static int LuaLLoadString (LuaState luaState, string chunk) - { - return LuaCore.LuaLLoadString (luaState, chunk); - } - - public static int LuaLLoadString (LuaState luaState, byte[] chunk) - { - return LuaCore.LuaLLoadString (luaState, chunk); - } - - public static int LuaLDoString (LuaState luaState, string chunk) - { - int result = LuaLLoadString (luaState, chunk); - if (result != 0) - return result; - - return LuaPCall (luaState, 0, -1, 0); - } - - public static int LuaLDoString (LuaState luaState, byte[] chunk) - { - int result = LuaLLoadString (luaState, chunk); - if (result != 0) - return result; - - return LuaPCall (luaState, 0, -1, 0); - } - - public static void LuaCreateTable (LuaState luaState, int narr, int nrec) - { - LuaCore.LuaCreateTable (luaState, narr, nrec); - } - - public static void LuaNewTable (LuaState luaState) - { - LuaCreateTable (luaState, 0, 0); - } - - public static int LuaLDoFile (LuaState luaState, string fileName) - { - int result = LuaCore.LuaNetLoadFile (luaState, fileName); - if (result != 0) - return result; - - return LuaCore.LuaNetPCall (luaState, 0, -1, 0); - } - - public static void LuaGetGlobal (LuaState luaState, string name) - { - LuaCore.LuaNetGetGlobal (luaState, name); - } - - public static void LuaSetGlobal (LuaState luaState, string name) - { - LuaCore.LuaNetSetGlobal (luaState, name); - } - - public static void LuaSetTop (LuaState luaState, int newTop) - { - LuaCore.LuaSetTop (luaState, newTop); - } - - public static void LuaPop (LuaState luaState, int amount) - { - LuaSetTop (luaState, -(amount) - 1); - } - - public static void LuaInsert (LuaState luaState, int newTop) - { - LuaCore.LuaInsert (luaState, newTop); - } - - public static void LuaRemove (LuaState luaState, int index) - { - LuaCore.LuaRemove (luaState, index); - } - - public static void LuaGetTable (LuaState luaState, int index) - { - LuaCore.LuaGetTable (luaState, index); - } - - public static void LuaRawGet (LuaState luaState, int index) - { - LuaCore.LuaRawGet (luaState, index); - } - - public static void LuaSetTable (LuaState luaState, int index) - { - LuaCore.LuaSetTable (luaState, index); - } - - public static void LuaRawSet (LuaState luaState, int index) - { - LuaCore.LuaRawSet (luaState, index); - } - - public static void LuaSetMetatable (LuaState luaState, int objIndex) - { - LuaCore.LuaSetMetatable (luaState, objIndex); - } - - public static int LuaGetMetatable (LuaState luaState, int objIndex) - { - return LuaCore.LuaGetMetatable (luaState, objIndex); - } - - public static int LuaEqual (LuaState luaState, int index1, int index2) - { - return LuaCore.LuaNetEqual (luaState, index1, index2); - } - - public static void LuaPushValue (LuaState luaState, int index) - { - LuaCore.LuaPushValue (luaState, index); - } - - public static void LuaReplace (LuaState luaState, int index) - { - LuaCore.LuaReplace (luaState, index); - } - - public static int LuaGetTop (LuaState luaState) - { - return LuaCore.LuaGetTop (luaState); - } - - public static LuaTypes LuaType (LuaState luaState, int index) - { - return (LuaTypes)LuaCore.LuaType (luaState, index); - } - - public static bool LuaIsNil (LuaState luaState, int index) - { - return LuaType (luaState, index) == LuaTypes.Nil; - } - - public static bool LuaIsNumber (LuaState luaState, int index) - { - return LuaType (luaState, index) == LuaTypes.Number; - } - - public static bool LuaIsBoolean (LuaState luaState, int index) - { - return LuaType (luaState, index) == LuaTypes.Boolean; - } - - public static int LuaLRef (LuaState luaState, int registryIndex) - { - return LuaCore.LuaLRef (luaState, registryIndex); - } - - public static int LuaRef (LuaState luaState, int lockRef) - { - return lockRef != 0 ? LuaLRef (luaState, (int)LuaIndexes.Registry) : 0; - } - - public static void LuaRawGetI (LuaState luaState, int tableIndex, int index) - { - LuaCore.LuaRawGetI (luaState, tableIndex, index); - } - - public static void LuaRawSetI (LuaState luaState, int tableIndex, int index) - { - LuaCore.LuaRawSetI (luaState, tableIndex, index); - } - - public static object LuaNewUserData (LuaState luaState, int size) - { - return LuaCore.LuaNewUserData (luaState, (uint)size); - } - - public static object LuaToUserData (LuaState luaState, int index) - { - return LuaCore.LuaToUserData (luaState, index); - } - - public static void LuaGetRef (LuaState luaState, int reference) - { - LuaRawGetI (luaState, (int)LuaIndexes.Registry, reference); - } - - public static void LuaUnref (LuaState luaState, int reference) - { - LuaCore.LuaLUnref (luaState, (int)LuaIndexes.Registry, reference); - } - - public static bool LuaIsString (LuaState luaState, int index) - { - return LuaCore.LuaIsString (luaState, index) != 0; - } - - public static bool LuaNetIsStringStrict (LuaState luaState, int index) - { - return LuaCore.LuaNetIsStringStrict (luaState, index) != 0; - } - - public static bool LuaIsCFunction (LuaState luaState, int index) - { - return LuaCore.LuaIsCFunction (luaState, index); - } - - public static void LuaPushNil (LuaState luaState) - { - LuaCore.LuaPushNil (luaState); - } - - public static void LuaPushStdCallCFunction (LuaState luaState, LuaNativeFunction function) - { - LuaCore.LuaPushStdCallCFunction (luaState, function); - } - - public static int LuaPCall (LuaState luaState, int nArgs, int nResults, int errfunc) - { - return LuaCore.LuaNetPCall (luaState, nArgs, nResults, errfunc); - } - - public static LuaNativeFunction LuaToCFunction (LuaState luaState, int index) - { - return LuaCore.LuaToCFunction (luaState, index); - } - - public static double LuaToNumber (LuaState luaState, int index) - { - return LuaCore.LuaNetToNumber (luaState, index); - } - - public static bool LuaToBoolean (LuaState luaState, int index) - { - return LuaCore.LuaToBoolean (luaState, index) != 0; - } - - public static string LuaToString (LuaState luaState, int index) - { - // FIXME use the same format string as lua i.e. LUA_NUMBER_FMT - var t = LuaType (luaState, index); - - if (t == LuaTypes.Number) - return string.Format ("{0}", LuaToNumber (luaState, index)); - else if (t == LuaTypes.String) { - uint strlen; - // Changed 2013-05-18 by Dirk Weltz - // Changed because binary chunks, which are also transfered as strings - // get corrupted by conversion to strings because of the encoding. - // So we use the ToString method with string length, so it could be checked, - // if string is a binary chunk and if, could transfered to string without - // encoding. - return LuaCore.LuaToLString (luaState, index, out strlen).ToString ((int)strlen); - } else if (t == LuaTypes.Nil) - return null; // treat lua nulls to as C# nulls - else - return "0"; // Because luaV_tostring does this - } - - public static void LuaAtPanic (LuaState luaState, LuaNativeFunction panicf) - { - LuaCore.LuaAtPanic (luaState, (LuaNativeFunction)panicf); - } - - - public static void LuaPushNumber (LuaState luaState, double number) - { - LuaCore.LuaPushNumber (luaState, number); - } - - public static void LuaPushBoolean (LuaState luaState, bool value) - { - LuaCore.LuaPushBoolean (luaState, value ? 1 : 0); - } - - public static void LuaPushString (LuaState luaState, string str) - { - LuaCore.LuaPushString (luaState, str); - } - - public static int LuaLNewMetatable (LuaState luaState, string meta) - { - return LuaCore.LuaLNewMetatable (luaState, meta); - } - - public static void LuaGetField (LuaState luaState, int stackPos, string meta) - { - LuaCore.LuaGetField (luaState, stackPos, meta); - } - - public static void LuaLGetMetatable (LuaState luaState, string meta) - { - LuaGetField (luaState, (int)LuaIndexes.Registry, meta); - } - - public static object LuaLCheckUData (LuaState luaState, int stackPos, string meta) - { - return LuaCore.LuaLCheckUData (luaState, stackPos, meta); - } - - public static bool LuaLGetMetafield (LuaState luaState, int stackPos, string field) - { - return LuaCore.LuaLGetMetafield (luaState, stackPos, field) != 0; - } - - public static int LuaLLoadBuffer (LuaState luaState, string buff, string name) - { - var bytes = Encoding.UTF8.GetBytes(buff); - return LuaCore.LuaNetLoadBuffer (luaState, bytes, (uint)bytes.Length, name); - } - - public static int LuaLLoadBuffer (LuaState luaState, byte [] buff, string name) - { - return LuaCore.LuaNetLoadBuffer (luaState, buff, (uint)buff.Length, name); - } - - public static int LuaLLoadFile (LuaState luaState, string filename) - { - return LuaCore.LuaNetLoadFile (luaState, filename); - } - - public static bool LuaLCheckMetatable (LuaState luaState, int index) - { - return LuaCore.LuaLCheckMetatable (luaState, index); - } - - public static int LuaNetRegistryIndex () - { - return LuaCore.LuaNetRegistryIndex (); - } - - public static int LuaNetToNetObject (LuaState luaState, int index) - { - return LuaCore.LuaNetToNetObject (luaState, index); - } - - public static void LuaNetNewUData (LuaState luaState, int val) - { - LuaCore.LuaNetNewUData (luaState, val); - } - - public static int LuaNetRawNetObj (LuaState luaState, int obj) - { - return LuaCore.LuaNetRawNetObj (luaState, obj); - } - - public static int LuaNetCheckUData (LuaState luaState, int ud, string tname) - { - return LuaCore.LuaNetCheckUData (luaState, ud, tname); - } - - public static void LuaError (LuaState luaState) - { - LuaCore.LuaError (luaState); - } - - public static bool LuaCheckStack (LuaState luaState, int extra) - { - return LuaCore.LuaCheckStack (luaState, extra) != 0; - } - - public static int LuaNext (LuaState luaState, int index) - { - return LuaCore.LuaNext (luaState, index); - } - - public static void LuaPushLightUserData (LuaState luaState, LuaTag udata) - { - LuaCore.LuaPushLightUserData (luaState, udata.Tag); - } - - public static LuaTag LuaNetGetTag () - { - return LuaCore.LuaNetGetTag (); - } - - public static void LuaNetPushGlobalTable (LuaState luaState) - { - LuaCore.LuaNetPushGlobalTable (luaState); - } - - public static void LuaNetPopGlobalTable (LuaState luaState) - { - LuaCore.LuaNetPopGlobalTable (luaState); - } - } -} \ No newline at end of file diff --git a/Core/NLua/LuaLib/LuaTypes.cs b/Core/NLua/LuaLib/LuaTypes.cs deleted file mode 100755 index 9788b8992b8aa3edbe7e74891eef8a9b3885bf79..0000000000000000000000000000000000000000 --- a/Core/NLua/LuaLib/LuaTypes.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2009 Joshua Simmons - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.IO; -using System.Runtime.InteropServices; -#if !SILVERLIGHT && !NETFX_CORE -using System.Runtime.Serialization.Formatters.Binary; -#endif -using NLua.Extensions; - -namespace NLua -{ - public enum LuaTypes : int - { - None = -1, - Nil = 0, - Boolean = 1, - LightUserdata = 2, - Number = 3, - String = 4, - Table = 5, - Function = 6, - UserData = 7, - Thread = 8 - } -} \ No newline at end of file diff --git a/Core/NLua/LuaLib/References.cs b/Core/NLua/LuaLib/References.cs deleted file mode 100644 index ad9dc2f4661877894a1ea4d9bba2f8b4289a3b11..0000000000000000000000000000000000000000 --- a/Core/NLua/LuaLib/References.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2009 Joshua Simmons - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua -{ - public enum References : int - { - RefNil = -1, - NoRef = -2 - } -} \ No newline at end of file diff --git a/Core/NLua/LuaRegistrationHelper.cs b/Core/NLua/LuaRegistrationHelper.cs deleted file mode 100755 index e6e5b5920a468031ba40a7798ac32e62262c6c2b..0000000000000000000000000000000000000000 --- a/Core/NLua/LuaRegistrationHelper.cs +++ /dev/null @@ -1,130 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Reflection; -using System.Diagnostics.CodeAnalysis; -using NLua.Extensions; -#if SILVERLIGHT -using System.Linq; -#endif - -namespace NLua -{ - public static class LuaRegistrationHelper - { - #region Tagged instance methods - /// - /// Registers all public instance methods in an object tagged with as Lua global functions - /// - /// The Lua VM to add the methods to - /// The object to get the methods from - public static void TaggedInstanceMethods (Lua lua, object o) - { - #region Sanity checks - if (lua == null) - throw new ArgumentNullException ("lua"); - - if (o == null) - throw new ArgumentNullException ("o"); - #endregion - - foreach (var method in o.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public)) { - foreach (LuaGlobalAttribute attribute in method.GetCustomAttributes(typeof(LuaGlobalAttribute), true)) { - if (string.IsNullOrEmpty (attribute.Name)) - lua.RegisterFunction (method.Name, o, method); // CLR name - else - lua.RegisterFunction (attribute.Name, o, method); // Custom name - } - } - } - #endregion - - #region Tagged static methods - /// - /// Registers all public static methods in a class tagged with as Lua global functions - /// - /// The Lua VM to add the methods to - /// The class type to get the methods from - public static void TaggedStaticMethods (Lua lua, Type type) - { - #region Sanity checks - if (lua == null) - throw new ArgumentNullException ("lua"); - - if (type == null) - throw new ArgumentNullException ("type"); - - if (!type.IsClass ()) - throw new ArgumentException ("The type must be a class!", "type"); - #endregion - - foreach (var method in type.GetMethods (BindingFlags.Static | BindingFlags.Public)) { - foreach (LuaGlobalAttribute attribute in method.GetCustomAttributes (typeof(LuaGlobalAttribute), false)) { - if (string.IsNullOrEmpty (attribute.Name)) - lua.RegisterFunction (method.Name, null, method); // CLR name - else - lua.RegisterFunction (attribute.Name, null, method); // Custom name - } - } - } - #endregion - - #region Enumeration - /// - /// Registers an enumeration's values for usage as a Lua variable table - /// - /// The enum type to register - /// The Lua VM to add the enum to - [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "The type parameter is used to select an enum type")] - public static void Enumeration (Lua lua) - { - #region Sanity checks - if (lua == null) - throw new ArgumentNullException ("lua"); - #endregion - - var type = typeof(T); - - if (!type.IsEnum ()) - throw new ArgumentException ("The type must be an enumeration!"); - -#if SILVERLIGHT - string[] names = type.GetFields().Where(x => x.IsLiteral).Select(field => field.Name).ToArray(); - var values = type.GetFields().Where(x => x.IsLiteral).Select(field => (T)field.GetValue(null)).ToArray(); -#else - string[] names = Enum.GetNames (type); - var values = (T[])Enum.GetValues (type); -#endif - lua.NewTable (type.Name); - - for (int i = 0; i < names.Length; i++) { - string path = type.Name + "." + names [i]; - lua [path] = values [i]; - } - } - #endregion - } -} \ No newline at end of file diff --git a/Core/NLua/LuaTable.cs b/Core/NLua/LuaTable.cs deleted file mode 100644 index dda4cc55dcaa581f61581116193011a9fbc51daa..0000000000000000000000000000000000000000 --- a/Core/NLua/LuaTable.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; - -namespace NLua -{ - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - using LuaNativeFunction = KopiLua.LuaNativeFunction; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - using LuaNativeFunction = KeraLua.LuaNativeFunction; - #endif - - /* - * Wrapper class for Lua tables - * - * Author: Fabio Mascarenhas - * Version: 1.0 - */ - public class LuaTable : LuaBase - { - public LuaTable (int reference, Lua interpreter) - { - _Reference = reference; - _Interpreter = interpreter; - } - - /* - * Indexer for string fields of the table - */ - public object this [string field] { - get { - return _Interpreter.GetObject (_Reference, field); - } - set { - _Interpreter.SetObject (_Reference, field, value); - } - } - - /* - * Indexer for numeric fields of the table - */ - public object this [object field] { - get { - return _Interpreter.GetObject (_Reference, field); - } - set { - _Interpreter.SetObject (_Reference, field, value); - } - } - - public System.Collections.IDictionaryEnumerator GetEnumerator () - { - return _Interpreter.GetTableDict (this).GetEnumerator (); - } - - public ICollection Keys { - get { return _Interpreter.GetTableDict (this).Keys; } - } - - public ICollection Values { - get { return _Interpreter.GetTableDict (this).Values; } - } - - /* - * Gets an string fields of a table ignoring its metatable, - * if it exists - */ - internal object RawGet (string field) - { - return _Interpreter.RawGetObject (_Reference, field); - } - - /* - * Pushes this table into the Lua stack - */ - internal void Push (LuaState luaState) - { - LuaLib.LuaGetRef (luaState, _Reference); - } - - public override string ToString () - { - return "table"; - } - } -} \ No newline at end of file diff --git a/Core/NLua/LuaUserData.cs b/Core/NLua/LuaUserData.cs deleted file mode 100644 index 721d118fd788e68509288a6f60f2809681905e9b..0000000000000000000000000000000000000000 --- a/Core/NLua/LuaUserData.cs +++ /dev/null @@ -1,87 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Text; -using System.Collections.Generic; - -namespace NLua -{ - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - #endif - - public class LuaUserData : LuaBase - { - public LuaUserData (int reference, Lua interpreter) - { - _Reference = reference; - _Interpreter = interpreter; - } - - /* - * Indexer for string fields of the userdata - */ - public object this [string field] { - get { - return _Interpreter.GetObject (_Reference, field); - } - set { - _Interpreter.SetObject (_Reference, field, value); - } - } - - /* - * Indexer for numeric fields of the userdata - */ - public object this [object field] { - get { - return _Interpreter.GetObject (_Reference, field); - } - set { - _Interpreter.SetObject (_Reference, field, value); - } - } - - /* - * Calls the userdata and returns its return values inside - * an array - */ - public object[] Call (params object[] args) - { - return _Interpreter.CallFunction (this, args); - } - - - public override string ToString () - { - return "userdata"; - } - } -} \ No newline at end of file diff --git a/Core/NLua/Makefile.am b/Core/NLua/Makefile.am deleted file mode 100644 index 3f085f1df511982e41fca67a670f11a5b756d7d8..0000000000000000000000000000000000000000 --- a/Core/NLua/Makefile.am +++ /dev/null @@ -1,271 +0,0 @@ - -EXTRA_DIST = - -# Warning: This is an automatically generated file, do not edit! - -if ENABLE_DEBUG -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" "-keyfile:key.snk" -ASSEMBLY = ../../Run/Debug/net40/NLua.dll -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../KeraLua/src/bin/Debug/net40/KeraLua.dll \ - ../KopiLua/Bin/Debug/net40/KopiLua.dll -BUILD_DIR = ../../Run/Debug/net40/ - -NLUA_DLL_MDB_SOURCE=../../Run/Debug/net40/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../KeraLua/src/bin/Debug/net40/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../KeraLua/src/bin/Debug/net40/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../KopiLua/Bin/Debug/net40/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../KopiLua/Bin/Debug/net40/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb - -endif - -if ENABLE_DEBUGKOPILUA -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;USE_KOPILUA" "-keyfile:key.snk" -ASSEMBLY = bin/DebugKopiLua/NLua.dll -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../KeraLua/src/bin/DebugKopiLua/KeraLua.dll \ - ../KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll -BUILD_DIR = bin/DebugKopiLua/ - -NLUA_DLL_MDB_SOURCE=bin/DebugKopiLua/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../KeraLua/src/bin/DebugKopiLua/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../KeraLua/src/bin/DebugKopiLua/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb - -endif - -if ENABLE_RELEASE -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:RELEASE" "-keyfile:key.snk" -ASSEMBLY = ../../Run/Release/net40/NLua.dll -ASSEMBLY_MDB = -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../KeraLua/src/bin/Release/net40/KeraLua.dll \ - ../KopiLua/Bin/Release/net40/KopiLua.dll -BUILD_DIR = ../../Run/Release/net40/ - -NLUA_DLL_MDB= -KERALUA_DLL_SOURCE=../KeraLua/src/bin/Release/net40/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../KopiLua/Bin/Release/net40/KopiLua.dll -KOPILUA_DLL_MDB= - -endif - -if ENABLE_RELEASEKOPILUA -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- "-define:USE_KOPILUA" "-keyfile:key.snk" -ASSEMBLY = bin/ReleaseKopiLua/NLua.dll -ASSEMBLY_MDB = -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../KeraLua/src/bin/ReleaseKopiLua/KeraLua.dll \ - ../KopiLua/KopiLua/bin/ReleaseKopiLua/KopiLua.dll -BUILD_DIR = bin/ReleaseKopiLua/ - -NLUA_DLL_MDB= -KERALUA_DLL_SOURCE=../KeraLua/src/bin/ReleaseKopiLua/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../KopiLua/KopiLua/bin/ReleaseKopiLua/KopiLua.dll -KOPILUA_DLL_MDB= - -endif - -if ENABLE_DEBUG_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" "-keyfile:key.snk" -ASSEMBLY = ../../Run/Debug/net40/NLua.dll -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../KeraLua/src/bin/Debug/net40/KeraLua.dll \ - ../KopiLua/Bin/Debug/net40/KopiLua.dll -BUILD_DIR = ../../Run/Debug/net40/ - -NLUA_DLL_MDB_SOURCE=../../Run/Debug/net40/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../KeraLua/src/bin/Debug/net40/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../KeraLua/src/bin/Debug/net40/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../KopiLua/Bin/Debug/net40/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../KopiLua/Bin/Debug/net40/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb - -endif - -if ENABLE_RELEASE_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:RELEASE" "-keyfile:key.snk" -ASSEMBLY = ../../Run/Release/net40/NLua.dll -ASSEMBLY_MDB = -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../KeraLua/src/bin/Release/net40/KeraLua.dll \ - ../KopiLua/Bin/Release/net40/KopiLua.dll -BUILD_DIR = ../../Run/Release/net40/ - -NLUA_DLL_MDB= -KERALUA_DLL_SOURCE=../KeraLua/src/bin/Release/net40/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../KopiLua/Bin/Release/net40/KopiLua.dll -KOPILUA_DLL_MDB= - -endif - -if ENABLE_DEBUGKOPILUA_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;USE_KOPILUA" "-keyfile:key.snk" -ASSEMBLY = bin/DebugKopiLua/NLua.dll -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../KeraLua/src/bin/DebugKopiLua/KeraLua.dll \ - ../KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll -BUILD_DIR = bin/DebugKopiLua/ - -NLUA_DLL_MDB_SOURCE=bin/DebugKopiLua/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb -KERALUA_DLL_SOURCE=../KeraLua/src/bin/DebugKopiLua/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../KeraLua/src/bin/DebugKopiLua/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb - -endif - -if ENABLE_RELEASEKOPILUA_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- "-define:USE_KOPILUA" "-keyfile:key.snk" -ASSEMBLY = bin/ReleaseKopiLua/NLua.dll -ASSEMBLY_MDB = -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../KeraLua/src/bin/ReleaseKopiLua/KeraLua.dll \ - ../KopiLua/KopiLua/bin/ReleaseKopiLua/KopiLua.dll -BUILD_DIR = bin/ReleaseKopiLua/ - -NLUA_DLL_MDB= -KERALUA_DLL_SOURCE=../KeraLua/src/bin/ReleaseKopiLua/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../KopiLua/KopiLua/bin/ReleaseKopiLua/KopiLua.dll -KOPILUA_DLL_MDB= - -endif - -AL=al -SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll - -PROGRAMFILES = \ - $(NLUA_DLL_MDB) \ - $(KERALUA_DLL) \ - $(KERALUA_DLL_MDB) \ - $(KOPILUA_DLL) \ - $(KOPILUA_DLL_MDB) - -LINUX_PKGCONFIG = \ - $(NLUA_NET40_PC) - - -RESGEN=resgen2 - -all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) - -FILES = \ - CheckType.cs \ - Lua.cs \ - Metatables.cs \ - ObjectTranslator.cs \ - ProxyType.cs \ - Properties/AssemblyInfo.cs \ - LuaBase.cs \ - LuaFunction.cs \ - LuaGlobalAttribute.cs \ - LuaHideAttribute.cs \ - LuaRegistrationHelper.cs \ - LuaTable.cs \ - LuaUserData.cs \ - Extensions/GeneralExtensions.cs \ - GenerateEventAssembly/LuaClassType.cs \ - GenerateEventAssembly/ILuaGeneratedType.cs \ - GenerateEventAssembly/DelegateGenerator.cs \ - GenerateEventAssembly/ClassGenerator.cs \ - GenerateEventAssembly/CodeGeneration.cs \ - Event/EventCodes.cs \ - Event/EventMasks.cs \ - Event/DebugHookEventArgs.cs \ - Event/HookExceptionEventArgs.cs \ - Exceptions/LuaException.cs \ - Exceptions/LuaScriptException.cs \ - LuaLib/LuaEnums.cs \ - LuaLib/References.cs \ - LuaLib/LuaTypes.cs \ - Method/MethodCache.cs \ - Method/MethodArgs.cs \ - Method/LuaMethodWrapper.cs \ - Method/EventHandlerContainer.cs \ - Method/RegisterEventHandler.cs \ - Method/LuaEventHandler.cs \ - Method/LuaDelegate.cs \ - Method/LuaClassHelper.cs \ - LuaLib/LuaIndexes.cs \ - LuaLib/GCOptions.cs \ - LuaLib/LuaLib.cs \ - Config/NLuaConfig.cs \ - ObjectTranslatorPool.cs \ - Platform/CLSCompliantAttribute.cs - -DATA_FILES = - -RESOURCES = - -EXTRAS = \ - key.snk \ - nlua.net40.pc.in - -REFERENCES = \ - System \ - System.Data \ - System.Xml \ - System.Core - -DLL_REFERENCES = - -CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) - -include $(top_srcdir)/Makefile.include - -KERALUA_DLL = $(BUILD_DIR)/KeraLua.dll -KOPILUA_DLL = $(BUILD_DIR)/KopiLua.dll -NLUA_NET40_PC = $(BUILD_DIR)/nlua.net40.pc - -$(eval $(call emit-deploy-target,KERALUA_DLL)) -$(eval $(call emit-deploy-target,KERALUA_DLL_MDB)) -$(eval $(call emit-deploy-target,KOPILUA_DLL)) -$(eval $(call emit-deploy-target,KOPILUA_DLL_MDB)) -$(eval $(call emit-deploy-wrapper,NLUA_NET40_PC,nlua.net40.pc)) - - -$(eval $(call emit_resgen_targets)) -$(build_xamlg_list): %.xaml.g.cs: %.xaml - xamlg '$<' - -$(ASSEMBLY_MDB): $(ASSEMBLY) - -$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) - mkdir -p $(shell dirname $(ASSEMBLY)) - $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) diff --git a/Core/NLua/Metatables.cs b/Core/NLua/Metatables.cs deleted file mode 100755 index c378e1cf1ec2647c6e4447aceae4522f95fd6798..0000000000000000000000000000000000000000 --- a/Core/NLua/Metatables.cs +++ /dev/null @@ -1,1398 +0,0 @@ -/* - * This file is part of NLua. - * Copyright (C) 2015 Vinicius Jarina. - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Linq; -using System.IO; -using System.Collections; -using System.Reflection; -using System.Diagnostics; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using NLua.Method; -using NLua.Extensions; - -#if MONOTOUCH - using ObjCRuntime; -#endif - -namespace NLua -{ - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - using LuaNativeFunction = KopiLua.LuaNativeFunction; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - using LuaNativeFunction = KeraLua.LuaNativeFunction; - #endif - - /* - * Functions used in the metatables of userdata representing - * CLR objects - * - */ - public class MetaFunctions - { - public LuaNativeFunction GcFunction { get; private set; } - public LuaNativeFunction IndexFunction { get; private set; } - public LuaNativeFunction NewIndexFunction { get; private set; } - public LuaNativeFunction BaseIndexFunction { get; private set; } - public LuaNativeFunction ClassIndexFunction { get; private set; } - public LuaNativeFunction ClassNewindexFunction { get; private set; } - public LuaNativeFunction ExecuteDelegateFunction { get; private set; } - public LuaNativeFunction CallConstructorFunction { get; private set; } - public LuaNativeFunction ToStringFunction { get; private set; } - public LuaNativeFunction CallDelegateFunction { get; private set; } - - public LuaNativeFunction AddFunction { get; private set; } - public LuaNativeFunction SubtractFunction { get; private set; } - public LuaNativeFunction MultiplyFunction { get; private set; } - public LuaNativeFunction DivisionFunction { get; private set; } - public LuaNativeFunction ModulosFunction { get; private set; } - public LuaNativeFunction UnaryNegationFunction { get; private set; } - public LuaNativeFunction EqualFunction { get; private set; } - public LuaNativeFunction LessThanFunction { get; private set; } - public LuaNativeFunction LessThanOrEqualFunction { get; private set; } - - Dictionary memberCache = new Dictionary (); - ObjectTranslator translator; - - /* - * __index metafunction for CLR objects. Implemented in Lua. - */ - static string luaIndexFunction = - @"local function index(obj,name) - local meta = getmetatable(obj) - local cached = meta.cache[name] - if cached ~= nil then - return cached - else - local value,isFunc = get_object_member(obj,name) - - if isFunc then - meta.cache[name]=value - end - return value - end - end - return index"; - public static string LuaIndexFunction { - get { return luaIndexFunction; } - } - public MetaFunctions (ObjectTranslator translator) - { - this.translator = translator; - GcFunction = new LuaNativeFunction (MetaFunctions.CollectObject); - ToStringFunction = new LuaNativeFunction (MetaFunctions.ToStringLua); - IndexFunction = new LuaNativeFunction (MetaFunctions.GetMethod); - NewIndexFunction = new LuaNativeFunction (MetaFunctions.SetFieldOrProperty); - BaseIndexFunction = new LuaNativeFunction (MetaFunctions.GetBaseMethod); - CallConstructorFunction = new LuaNativeFunction (MetaFunctions.CallConstructor); - ClassIndexFunction = new LuaNativeFunction (MetaFunctions.GetClassMethod); - ClassNewindexFunction = new LuaNativeFunction (MetaFunctions.SetClassFieldOrProperty); - ExecuteDelegateFunction = new LuaNativeFunction (MetaFunctions.RunFunctionDelegate); - CallDelegateFunction = new LuaNativeFunction (MetaFunctions.CallDelegate); - AddFunction = new LuaNativeFunction (MetaFunctions.AddLua); - SubtractFunction = new LuaNativeFunction (MetaFunctions.SubtractLua); - MultiplyFunction = new LuaNativeFunction (MetaFunctions.MultiplyLua); - DivisionFunction = new LuaNativeFunction (MetaFunctions.DivideLua); - ModulosFunction = new LuaNativeFunction (MetaFunctions.ModLua); - UnaryNegationFunction = new LuaNativeFunction (MetaFunctions.UnaryNegationLua); - EqualFunction = new LuaNativeFunction (MetaFunctions.EqualLua); - LessThanFunction = new LuaNativeFunction (MetaFunctions.LessThanLua); - LessThanOrEqualFunction = new LuaNativeFunction (MetaFunctions.LessThanOrEqualLua); - } - - /* - * __call metafunction of CLR delegates, retrieves and calls the delegate. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int RunFunctionDelegate (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return RunFunctionDelegate (luaState, translator); - } - - private static int RunFunctionDelegate (LuaState luaState, ObjectTranslator translator) - { - LuaNativeFunction func = (LuaNativeFunction)translator.GetRawNetObject (luaState, 1); - LuaLib.LuaRemove (luaState, 1); - return func (luaState); - } - - /* - * __gc metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int CollectObject (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return CollectObject (luaState, translator); - } - - private static int CollectObject (LuaState luaState, ObjectTranslator translator) - { - int udata = LuaLib.LuaNetRawNetObj (luaState, 1); - - if (udata != -1) - translator.CollectObject (udata); - - return 0; - } - - /* - * __tostring metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int ToStringLua (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return ToStringLua (luaState, translator); - } - - private static int ToStringLua (LuaState luaState, ObjectTranslator translator) - { - object obj = translator.GetRawNetObject (luaState, 1); - - if (obj != null) - translator.Push (luaState, obj.ToString () + ": " + obj.GetHashCode ().ToString()); - else - LuaLib.LuaPushNil (luaState); - - return 1; - } - - -/* - * __add metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - static int AddLua (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return MatchOperator (luaState, "op_Addition", translator); - } - - /* - * __sub metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - static int SubtractLua (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return MatchOperator (luaState, "op_Subtraction", translator); - } - - /* - * __mul metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - static int MultiplyLua (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return MatchOperator (luaState, "op_Multiply", translator); - } - - /* - * __div metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - static int DivideLua (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return MatchOperator (luaState, "op_Division", translator); - } - - /* - * __mod metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - static int ModLua (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return MatchOperator (luaState, "op_Modulus", translator); - } - - /* - * __unm metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - static int UnaryNegationLua (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return UnaryNegationLua (luaState, translator); - } - - static int UnaryNegationLua (LuaState luaState, ObjectTranslator translator) - { - object obj1 = translator.GetRawNetObject (luaState, 1); - - if (obj1 == null) { - translator.ThrowError (luaState, "Cannot negate a nil object"); - LuaLib.LuaPushNil (luaState); - return 1; - } - - Type type = obj1.GetType (); - MethodInfo opUnaryNegation = type.GetMethod ("op_UnaryNegation"); - - if (opUnaryNegation == null) { - translator.ThrowError (luaState, "Cannot negate object (" + type.Name + " does not overload the operator -)"); - LuaLib.LuaPushNil (luaState); - return 1; - } - obj1 = opUnaryNegation.Invoke (obj1, new object [] { obj1 }); - translator.Push (luaState, obj1); - return 1; - } - - - /* - * __eq metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - static int EqualLua (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return MatchOperator (luaState, "op_Equality", translator); - } - - /* - * __lt metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - static int LessThanLua (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return MatchOperator (luaState, "op_LessThan", translator); - } - - /* - * __le metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - static int LessThanOrEqualLua (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return MatchOperator (luaState, "op_LessThanOrEqual", translator); - } - - /// - /// Debug tool to dump the lua stack - /// - /// FIXME, move somewhere else - public static void DumpStack (ObjectTranslator translator, LuaState luaState) - { - int depth = LuaLib.LuaGetTop (luaState); - -#if WINDOWS_PHONE || NETFX_CORE - Debug.WriteLine("lua stack depth: {0}", depth); -#elif UNITY_3D - UnityEngine.Debug.Log(string.Format("lua stack depth: {0}", depth)); -#elif !SILVERLIGHT - Debug.Print ("lua stack depth: {0}", depth); -#endif - - for (int i = 1; i <= depth; i++) { - var type = LuaLib.LuaType (luaState, i); - // we dump stacks when deep in calls, calling typename while the stack is in flux can fail sometimes, so manually check for key types - string typestr = (type == LuaTypes.Table) ? "table" : LuaLib.LuaTypeName (luaState, type); - string strrep = LuaLib.LuaToString (luaState, i).ToString (); - - if (type == LuaTypes.UserData) { - object obj = translator.GetRawNetObject (luaState, i); - strrep = obj.ToString (); - } - -#if WINDOWS_PHONE || NETFX_CORE - Debug.WriteLine("{0}: ({1}) {2}", i, typestr, strrep); -#elif UNITY_3D - UnityEngine.Debug.Log(string.Format("{0}: ({1}) {2}", i, typestr, strrep)); -#elif !SILVERLIGHT - Debug.Print ("{0}: ({1}) {2}", i, typestr, strrep); -#endif - } - } - - /* - * Called by the __index metafunction of CLR objects in case the - * method is not cached or it is a field/property/event. - * Receives the object and the member name as arguments and returns - * either the value of the member or a delegate to call it. - * If the member does not exist returns nil. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int GetMethod (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - var instance = translator.MetaFunctionsInstance; - return instance.GetMethodInternal (luaState); - } - - private int GetMethodInternal (LuaState luaState) - { - object obj = translator.GetRawNetObject (luaState, 1); - - if (obj == null) { - translator.ThrowError (luaState, "trying to index an invalid object reference"); - LuaLib.LuaPushNil (luaState); - return 1; - } - - object index = translator.GetObject (luaState, 2); - //var indexType = index.GetType(); - string methodName = index as string; // will be null if not a string arg - var objType = obj.GetType (); - var proxyType = new ProxyType (objType); - // Handle the most common case, looking up the method by name. - - // CP: This will fail when using indexers and attempting to get a value with the same name as a property of the object, - // ie: xmlelement['item'] <- item is a property of xmlelement - try { - if (!string.IsNullOrEmpty(methodName) && IsMemberPresent (proxyType, methodName)) - return GetMember (luaState, proxyType, obj, methodName, BindingFlags.Instance); - } catch { - } - - // Try to access by array if the type is right and index is an int (lua numbers always come across as double) - if (objType.IsArray && index is double) { - int intIndex = (int)((double)index); -#if NETFX_CORE - Type type = objType; -#else - Type type = objType.UnderlyingSystemType; -#endif - - if (type == typeof(float[])) { - float[] arr = ((float[])obj); - translator.Push (luaState, arr [intIndex]); - } else if (type == typeof(double[])) { - double[] arr = ((double[])obj); - translator.Push (luaState, arr [intIndex]); - } else if (type == typeof(int[])) { - int[] arr = ((int[])obj); - translator.Push (luaState, arr [intIndex]); - } else { - object[] arr = (object[])obj; - translator.Push (luaState, arr [intIndex]); - } - } else { - - if (!string.IsNullOrEmpty (methodName) && IsExtensionMethodPresent (objType, methodName)) { - return GetExtensionMethod (luaState, objType, obj, methodName); - } - // Try to use get_Item to index into this .net object - var methods = objType.GetMethods (); - - foreach (var mInfo in methods) { - if (mInfo.Name == "get_Item") { - //check if the signature matches the input - if (mInfo.GetParameters ().Length == 1) { - var getter = mInfo; - var actualParms = (getter != null) ? getter.GetParameters () : null; - - if (actualParms == null || actualParms.Length != 1) { - translator.ThrowError (luaState, "method not found (or no indexer): " + index); - LuaLib.LuaPushNil (luaState); - } else { - // Get the index in a form acceptable to the getter - index = translator.GetAsType (luaState, 2, actualParms [0].ParameterType); - object[] args = new object[1]; - - // Just call the indexer - if out of bounds an exception will happen - args [0] = index; - - try { - object result = getter.Invoke (obj, args); - translator.Push (luaState, result); - } catch (TargetInvocationException e) { - // Provide a more readable description for the common case of key not found - if (e.InnerException is KeyNotFoundException) - translator.ThrowError (luaState, "key '" + index + "' not found "); - else - translator.ThrowError (luaState, "exception indexing '" + index + "' " + e.Message); - - LuaLib.LuaPushNil (luaState); - } - } - } - } - } - } - - LuaLib.LuaPushBoolean (luaState, false); - return 2; - } - - /* - * __index metafunction of base classes (the base field of Lua tables). - * Adds a prefix to the method name to call the base version of the method. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int GetBaseMethod (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - var instance = translator.MetaFunctionsInstance; - return instance.GetBaseMethodInternal (luaState); - } - - private int GetBaseMethodInternal (LuaState luaState) - { - object obj = translator.GetRawNetObject (luaState, 1); - - if (obj == null) { - translator.ThrowError (luaState, "trying to index an invalid object reference"); - LuaLib.LuaPushNil (luaState); - LuaLib.LuaPushBoolean (luaState, false); - return 2; - } - - string methodName = LuaLib.LuaToString (luaState, 2).ToString (); - - if (string.IsNullOrEmpty(methodName)) { - LuaLib.LuaPushNil (luaState); - LuaLib.LuaPushBoolean (luaState, false); - return 2; - } - - GetMember (luaState, new ProxyType(obj.GetType ()), obj, "__luaInterface_base_" + methodName, BindingFlags.Instance); - LuaLib.LuaSetTop (luaState, -2); - - if (LuaLib.LuaType (luaState, -1) == LuaTypes.Nil) { - LuaLib.LuaSetTop (luaState, -2); - return GetMember (luaState, new ProxyType(obj.GetType ()), obj, methodName, BindingFlags.Instance); - } - - LuaLib.LuaPushBoolean (luaState, false); - return 2; - } - - /// - /// Does this method exist as either an instance or static? - /// - /// - /// - /// - bool IsMemberPresent (ProxyType objType, string methodName) - { - object cachedMember = CheckMemberCache (memberCache, objType, methodName); - - if (cachedMember != null) - return true; - - var members = objType.GetMember (methodName, BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public); - return (members.Length > 0); - } - - bool IsExtensionMethodPresent (Type type, string name) - { - object cachedMember = CheckMemberCache (memberCache, type, name); - - if (cachedMember != null) - return true; - - return translator.IsExtensionMethodPresent (type, name); - } - - int GetExtensionMethod (LuaState luaState, Type type, object obj, string name) - { - object cachedMember = CheckMemberCache (memberCache, type, name); - - if (cachedMember != null && cachedMember is LuaNativeFunction) { - translator.PushFunction (luaState, (LuaNativeFunction)cachedMember); - translator.Push (luaState, true); - return 2; - } - - MethodInfo methodInfo = translator.GetExtensionMethod (type, name); - var wrapper = new LuaNativeFunction ((new LuaMethodWrapper (translator, obj,new ProxyType(type), methodInfo)).invokeFunction); - - SetMemberCache (memberCache, type, name, wrapper); - - translator.PushFunction (luaState, wrapper); - translator.Push (luaState, true); - return 2; - } - - /* - * Pushes the value of a member or a delegate to call it, depending on the type of - * the member. Works with static or instance members. - * Uses reflection to find members, and stores the reflected MemberInfo object in - * a cache (indexed by the type of the object and the name of the member). - */ - int GetMember (LuaState luaState, ProxyType objType, object obj, string methodName, BindingFlags bindingType) - { - bool implicitStatic = false; - MemberInfo member = null; - object cachedMember = CheckMemberCache (memberCache, objType, methodName); - - if (cachedMember is LuaNativeFunction) { - translator.PushFunction (luaState, (LuaNativeFunction)cachedMember); - translator.Push (luaState, true); - return 2; - } else if (cachedMember != null) - member = (MemberInfo)cachedMember; - else { - var members = objType.GetMember (methodName, bindingType | BindingFlags.Public); - - if (members.Length > 0) - member = members [0]; - else { - // If we can't find any suitable instance members, try to find them as statics - but we only want to allow implicit static - members = objType.GetMember (methodName, bindingType | BindingFlags.Static | BindingFlags.Public); - - if (members.Length > 0) { - member = members [0]; - implicitStatic = true; - } - } - } - - if (member != null) { -#if NETFX_CORE - if (member is FieldInfo) { -#else - if (member.MemberType == MemberTypes.Field) { -#endif - var field = (FieldInfo)member; - - if (cachedMember == null) - SetMemberCache (memberCache, objType, methodName, member); - - try { - var value = field.GetValue (obj); - translator.Push (luaState, value); - } catch { - LuaLib.LuaPushNil (luaState); - } -#if NETFX_CORE - } else if (member is PropertyInfo) { -#else - } else if (member.MemberType == MemberTypes.Property) { -#endif - var property = (PropertyInfo)member; - if (cachedMember == null) - SetMemberCache (memberCache, objType, methodName, member); - - try { - object value = property.GetValue (obj, null); - translator.Push (luaState, value); - - } catch (ArgumentException) { - // If we can't find the getter in our class, recurse up to the base class and see - // if they can help. - if (objType.UnderlyingSystemType != typeof(object)) -#if NETFX_CORE - return GetMember (luaState, new ProxyType(objType.UnderlyingSystemType.GetTypeInfo().BaseType), obj, methodName, bindingType); -#else - return GetMember (luaState, new ProxyType(objType.UnderlyingSystemType.BaseType), obj, methodName, bindingType); -#endif - else - LuaLib.LuaPushNil (luaState); - } catch (TargetInvocationException e) { // Convert this exception into a Lua error - ThrowError (luaState, e); - LuaLib.LuaPushNil (luaState); - } -#if NETFX_CORE - } else if (member is EventInfo) { -#else - } else if (member.MemberType == MemberTypes.Event) { -#endif - var eventInfo = (EventInfo)member; - if (cachedMember == null) - SetMemberCache (memberCache, objType, methodName, member); - - translator.Push (luaState, new RegisterEventHandler (translator.pendingEvents, obj, eventInfo)); - } else if (!implicitStatic) { -#if NETFX_CORE - var typeInfo = member as TypeInfo; - if (typeInfo != null && !typeInfo.IsPublic && !typeInfo.IsNotPublic) { -#else - if (member.MemberType == MemberTypes.NestedType) { -#endif - - // kevinh - added support for finding nested types- - // cache us - if (cachedMember == null) - SetMemberCache (memberCache, objType, methodName, member); - - // Find the name of our class - string name = member.Name; - var dectype = member.DeclaringType; - - // Build a new long name and try to find the type by name - string longname = dectype.FullName + "+" + name; - var nestedType = translator.FindType (longname); - translator.PushType (luaState, nestedType); - } else { - // Member type must be 'method' - var wrapper = new LuaNativeFunction ((new LuaMethodWrapper (translator, objType, methodName, bindingType)).invokeFunction); - - if (cachedMember == null) - SetMemberCache (memberCache, objType, methodName, wrapper); - - translator.PushFunction (luaState, wrapper); - translator.Push (luaState, true); - return 2; - } - } else { - // If we reach this point we found a static method, but can't use it in this context because the user passed in an instance - translator.ThrowError (luaState, "can't pass instance to static method " + methodName); - LuaLib.LuaPushNil (luaState); - } - } else { - - if (objType.UnderlyingSystemType != typeof(object)) { - #if NETFX_CORE - return GetMember (luaState, new ProxyType(objType.UnderlyingSystemType.GetTypeInfo().BaseType), obj, methodName, bindingType); - #else - return GetMember (luaState, new ProxyType(objType.UnderlyingSystemType.BaseType), obj, methodName, bindingType); - #endif - } - // kevinh - we want to throw an exception because meerly returning 'nil' in this case - // is not sufficient. valid data members may return nil and therefore there must be some - // way to know the member just doesn't exist. - translator.ThrowError (luaState, "unknown member name " + methodName); - LuaLib.LuaPushNil (luaState); - } - - // push false because we are NOT returning a function (see luaIndexFunction) - translator.Push (luaState, false); - return 2; - } - - /* - * Checks if a MemberInfo object is cached, returning it or null. - */ - object CheckMemberCache (Dictionary memberCache, Type objType, string memberName) - { - return CheckMemberCache (memberCache, new ProxyType (objType), memberName); - } - - object CheckMemberCache (Dictionary memberCache, ProxyType objType, string memberName) - { - object members = null; - - if (memberCache.TryGetValue(objType, out members)) - { - var membersDict = members as Dictionary; - - object memberValue = null; - - if (members != null && membersDict.TryGetValue(memberName, out memberValue)) - { - return memberValue; - } - } - - return null; - } - - /* - * Stores a MemberInfo object in the member cache. - */ - void SetMemberCache (Dictionary memberCache, Type objType, string memberName, object member) - { - SetMemberCache (memberCache, new ProxyType (objType), memberName, member); - } - - void SetMemberCache (Dictionary memberCache, ProxyType objType, string memberName, object member) - { - Dictionary members = null; - object memberCacheValue = null; - - if (memberCache.TryGetValue(objType, out memberCacheValue)) { - members = (Dictionary)memberCacheValue; - } else { - members = new Dictionary(); - memberCache[objType] = members; - } - - members [memberName] = member; - } - - /* - * __newindex metafunction of CLR objects. Receives the object, - * the member name and the value to be stored as arguments. Throws - * and error if the assignment is invalid. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int SetFieldOrProperty (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - var instance = translator.MetaFunctionsInstance; - return instance.SetFieldOrPropertyInternal (luaState); - } - - private int SetFieldOrPropertyInternal (LuaState luaState) - { - object target = translator.GetRawNetObject (luaState, 1); - - if (target == null) { - translator.ThrowError (luaState, "trying to index and invalid object reference"); - return 0; - } - - var type = target.GetType (); - - // First try to look up the parameter as a property name - string detailMessage; - bool didMember = TrySetMember (luaState, new ProxyType(type), target, BindingFlags.Instance, out detailMessage); - - if (didMember) - return 0; // Must have found the property name - - // We didn't find a property name, now see if we can use a [] style this accessor to set array contents - try { - if (type.IsArray && LuaLib.LuaIsNumber (luaState, 2)) { - int index = (int)LuaLib.LuaToNumber (luaState, 2); - var arr = (Array)target; - object val = translator.GetAsType (luaState, 3, arr.GetType ().GetElementType ()); - arr.SetValue (val, index); - } else { - // Try to see if we have a this[] accessor - var setter = type.GetMethod ("set_Item"); - if (setter != null) { - var args = setter.GetParameters (); - var valueType = args [1].ParameterType; - - // The new val ue the user specified - object val = translator.GetAsType (luaState, 3, valueType); - var indexType = args [0].ParameterType; - object index = translator.GetAsType (luaState, 2, indexType); - - object[] methodArgs = new object[2]; - - // Just call the indexer - if out of bounds an exception will happen - methodArgs [0] = index; - methodArgs [1] = val; - setter.Invoke (target, methodArgs); - } else - translator.ThrowError (luaState, detailMessage); // Pass the original message from trySetMember because it is probably best - } -#if !SILVERLIGHT - } catch (SEHException) { - // If we are seeing a C++ exception - this must actually be for Lua's private use. Let it handle it - throw; -#endif - } catch (Exception e) { - ThrowError (luaState, e); - } - - return 0; - } - - /// - /// Tries to set a named property or field - /// - /// - /// - /// - /// - /// false if unable to find the named member, true for success - bool TrySetMember (LuaState luaState, ProxyType targetType, object target, BindingFlags bindingType, out string detailMessage) - { - detailMessage = null; // No error yet - - // If not already a string just return - we don't want to call tostring - which has the side effect of - // changing the lua typecode to string - // Note: We don't use isstring because the standard lua C isstring considers either strings or numbers to - // be true for isstring. - if (LuaLib.LuaType (luaState, 2) != LuaTypes.String) { - detailMessage = "property names must be strings"; - return false; - } - - // We only look up property names by string - string fieldName = LuaLib.LuaToString (luaState, 2).ToString (); - if (fieldName == null || fieldName.Length < 1 || !(char.IsLetter (fieldName [0]) || fieldName [0] == '_')) { - detailMessage = "invalid property name"; - return false; - } - - // Find our member via reflection or the cache - var member = (MemberInfo)CheckMemberCache (memberCache, targetType, fieldName); - if (member == null) { - var members = targetType.GetMember (fieldName, bindingType | BindingFlags.Public); - - if (members.Length > 0) { - member = members [0]; - SetMemberCache (memberCache, targetType, fieldName, member); - } else { - detailMessage = "field or property '" + fieldName + "' does not exist"; - return false; - } - } -#if NETFX_CORE - if (member is FieldInfo) { -#else - if (member.MemberType == MemberTypes.Field) { -#endif - - var field = (FieldInfo)member; - object val = translator.GetAsType (luaState, 3, field.FieldType); - - try { - field.SetValue (target, val); - } catch (Exception e) { - ThrowError (luaState, e); - } - - // We did a call - return true; -#if NETFX_CORE - } else if (member is PropertyInfo) { -#else - } else if (member.MemberType == MemberTypes.Property) { -#endif - var property = (PropertyInfo)member; - object val = translator.GetAsType (luaState, 3, property.PropertyType); - - try { - property.SetValue (target, val, null); - } catch (Exception e) { - ThrowError (luaState, e); - } - - // We did a call - return true; - } - - detailMessage = "'" + fieldName + "' is not a .net field or property"; - return false; - } - - /* - * Writes to fields or properties, either static or instance. Throws an error - * if the operation is invalid. - */ - private int SetMember (LuaState luaState, ProxyType targetType, object target, BindingFlags bindingType) - { - string detail; - bool success = TrySetMember (luaState, targetType, target, bindingType, out detail); - - if (!success) - translator.ThrowError (luaState, detail); - - return 0; - } - - /// - /// Convert a C# exception into a Lua error - /// - /// - /// We try to look into the exception to give the most meaningful description - void ThrowError (LuaState luaState, Exception e) - { - // If we got inside a reflection show what really happened - var te = e as TargetInvocationException; - - if (te != null) - e = te.InnerException; - - translator.ThrowError (luaState, e); - } - - /* - * __index metafunction of type references, works on static members. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int GetClassMethod (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - var instance = translator.MetaFunctionsInstance; - return instance.GetClassMethodInternal (luaState); - } - - private int GetClassMethodInternal (LuaState luaState) - { - ProxyType klass; - object obj = translator.GetRawNetObject (luaState, 1); - - if (obj == null || !(obj is ProxyType)) { - translator.ThrowError (luaState, "trying to index an invalid type reference"); - LuaLib.LuaPushNil (luaState); - return 1; - } else - klass = (ProxyType)obj; - - if (LuaLib.LuaIsNumber (luaState, 2)) { - int size = (int)LuaLib.LuaToNumber (luaState, 2); - translator.Push (luaState, Array.CreateInstance (klass.UnderlyingSystemType, size)); - return 1; - } else { - string methodName = LuaLib.LuaToString (luaState, 2).ToString (); - - if (string.IsNullOrEmpty(methodName)) { - LuaLib.LuaPushNil (luaState); - return 1; - } - else - return GetMember (luaState, klass, null, methodName, BindingFlags.Static); - } - } - - /* - * __newindex function of type references, works on static members. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int SetClassFieldOrProperty (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - var instance = translator.MetaFunctionsInstance; - return instance.SetClassFieldOrPropertyInternal (luaState); - } - - private int SetClassFieldOrPropertyInternal (LuaState luaState) - { - ProxyType target; - object obj = translator.GetRawNetObject (luaState, 1); - - if (obj == null || !(obj is ProxyType)) { - translator.ThrowError (luaState, "trying to index an invalid type reference"); - return 0; - } else - target = (ProxyType)obj; - - return SetMember (luaState, target, null, BindingFlags.Static); - } - - /* - * __call metafunction of Delegates. - */ - #if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] - #endif - static int CallDelegate (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - var instance = translator.MetaFunctionsInstance; - return instance.CallDelegateInternal (luaState); - } - - int CallDelegateInternal (LuaState luaState) - { - object objDelegate = translator.GetRawNetObject (luaState, 1); - - if (objDelegate == null || !(objDelegate is Delegate)) { - translator.ThrowError (luaState, "trying to invoke a not delegate or callable value"); - LuaLib.LuaPushNil (luaState); - return 1; - } - - LuaLib.LuaRemove (luaState, 1); - - var validDelegate = new MethodCache (); - Delegate del = (Delegate)objDelegate; -#if NETFX_CORE || WP80 || NET45 || PCL - MethodBase methodDelegate = del.GetMethodInfo (); -#else - MethodBase methodDelegate = del.Method; -#endif - bool isOk = MatchParameters (luaState, methodDelegate, ref validDelegate); - - if (isOk) { - object result; - - if (methodDelegate.IsStatic) - result = methodDelegate.Invoke (null, validDelegate.args); - else - result = methodDelegate.Invoke (del.Target, validDelegate.args); - - translator.Push (luaState, result); - return 1; - } - - translator.ThrowError (luaState, "Cannot invoke delegate (invalid arguments for " + methodDelegate.Name + ")"); - LuaLib.LuaPushNil (luaState); - return 1; - } - - /* - * __call metafunction of type references. Searches for and calls - * a constructor for the type. Returns nil if the constructor is not - * found or if the arguments are invalid. Throws an error if the constructor - * generates an exception. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int CallConstructor (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - var instance = translator.MetaFunctionsInstance; - return instance.CallConstructorInternal (luaState); - } - - private int CallConstructorInternal (LuaState luaState) - { - var validConstructor = new MethodCache (); - ProxyType klass; - object obj = translator.GetRawNetObject (luaState, 1); - - if (obj == null || !(obj is ProxyType)) { - translator.ThrowError (luaState, "trying to call constructor on an invalid type reference"); - LuaLib.LuaPushNil (luaState); - return 1; - } else - klass = (ProxyType)obj; - - LuaLib.LuaRemove (luaState, 1); - var constructors = klass.UnderlyingSystemType.GetConstructors (); - - foreach (var constructor in constructors) { - bool isConstructor = MatchParameters (luaState, constructor, ref validConstructor); - - if (isConstructor) { - try { - translator.Push (luaState, constructor.Invoke (validConstructor.args)); - } catch (TargetInvocationException e) { - ThrowError (luaState, e); - LuaLib.LuaPushNil (luaState); - } catch { - LuaLib.LuaPushNil (luaState); - } - - return 1; - } - } - -#if NETFX_CORE - if (klass.UnderlyingSystemType.GetTypeInfo ().IsValueType) { -#else - if (klass.UnderlyingSystemType.IsValueType) { -#endif - int numLuaParams = LuaLib.LuaGetTop (luaState); - if (numLuaParams == 0) { - translator.Push (luaState, Activator.CreateInstance (klass.UnderlyingSystemType)); - return 1; - } - } - - string constructorName = (constructors.Length == 0) ? "unknown" : constructors [0].Name; - translator.ThrowError (luaState, String.Format ("{0} does not contain constructor({1}) argument match", - klass.UnderlyingSystemType, constructorName)); - LuaLib.LuaPushNil (luaState); - return 1; - } - static bool IsInteger(double x) { - return Math.Ceiling(x) == x; - } - - static object GetTargetObject (LuaState luaState, string operation, ObjectTranslator translator) - { - Type t; - object target = translator.GetRawNetObject (luaState, 1); - if (target != null) { - t = target.GetType (); - if (t.HasMethod (operation)) - return target; - } - target = translator.GetRawNetObject (luaState, 2); - if (target != null) { - t = target.GetType (); - if (t.HasMethod (operation)) - return target; - } - return null; - } - - static int MatchOperator (LuaState luaState, string operation, ObjectTranslator translator) - { - var validOperator = new MethodCache (); - - object target = GetTargetObject (luaState, operation, translator); - - if (target == null) { - translator.ThrowError (luaState, "Cannot call " + operation + " on a nil object"); - LuaLib.LuaPushNil (luaState); - return 1; - } - - Type type = target.GetType (); - var operators = type.GetMethods (operation, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static); - - foreach (var op in operators) { - bool isOk = translator.MatchParameters (luaState, op, ref validOperator); - - if (!isOk) - continue; - - object result; - if (op.IsStatic) - result = op.Invoke (null, validOperator.args); - else - result = op.Invoke (target, validOperator.args); - translator.Push (luaState, result); - return 1; - } - - translator.ThrowError (luaState, "Cannot call (" + operation + ") on object type " + type.Name); - LuaLib.LuaPushNil (luaState); - return 1; - } - - - - internal Array TableToArray (Func luaParamValueExtractor, Type paramArrayType, int startIndex, int count) - { - Array paramArray; - - if (count == 0) - return Array.CreateInstance (paramArrayType, 0); - - var luaParamValue = luaParamValueExtractor (startIndex); - - if (luaParamValue is LuaTable) { - LuaTable table = (LuaTable)luaParamValue; - IDictionaryEnumerator tableEnumerator = table.GetEnumerator (); - tableEnumerator.Reset (); - paramArray = Array.CreateInstance (paramArrayType, table.Values.Count); - - int paramArrayIndex = 0; - - while (tableEnumerator.MoveNext ()) { - - object value = tableEnumerator.Value; - - if (paramArrayType == typeof (object)) { - if (value != null && value.GetType () == typeof (double) && IsInteger ((double)value)) - value = Convert.ToInt32 ((double)value); - } -#if SILVERLIGHT - paramArray.SetValue (Convert.ChangeType (value, paramArrayType, System.Globalization.CultureInfo.InvariantCulture), paramArrayIndex); -#else - paramArray.SetValue (Convert.ChangeType (value, paramArrayType), paramArrayIndex); -#endif - paramArrayIndex++; - } - } else { - - paramArray = Array.CreateInstance (paramArrayType, count); - - paramArray.SetValue (luaParamValue, 0); - - for (int i = 1; i < count; i++) { - startIndex++; - var value = luaParamValueExtractor (startIndex); - paramArray.SetValue (value, i); - } - } - - return paramArray; - - } - - /* - * Matches a method against its arguments in the Lua stack. Returns - * if the match was successful. It it was also returns the information - * necessary to invoke the method. - */ - internal bool MatchParameters (LuaState luaState, MethodBase method, ref MethodCache methodCache) - { - ExtractValue extractValue; - bool isMethod = true; - var paramInfo = method.GetParameters (); - int currentLuaParam = 1; - int nLuaParams = LuaLib.LuaGetTop (luaState); - var paramList = new List (); - var outList = new List (); - var argTypes = new List (); - - foreach (var currentNetParam in paramInfo) { -#if !SILVERLIGHT - if (!currentNetParam.IsIn && currentNetParam.IsOut) // Skips out params -#else - if (currentNetParam.IsOut) // Skips out params -#endif - { - paramList.Add (null); - outList.Add (paramList.LastIndexOf (null)); - - } // Type does not match, ignore if the parameter is optional - else if (IsParamsArray (luaState, nLuaParams, currentLuaParam, currentNetParam, out extractValue)) { - - int count = (nLuaParams - currentLuaParam) + 1; - Type paramArrayType = currentNetParam.ParameterType.GetElementType (); - - Func extractDelegate = (currentParam) => { - currentLuaParam++; - return extractValue (luaState, currentParam); - }; - - Array paramArray = TableToArray (extractDelegate, paramArrayType, currentLuaParam, count); - paramList.Add (paramArray); - int index = paramList.LastIndexOf (paramArray); - var methodArg = new MethodArgs (); - methodArg.index = index; - methodArg.extractValue = extractValue; - methodArg.isParamsArray = true; - methodArg.paramsArrayType = paramArrayType; - argTypes.Add (methodArg); - - } - else if (IsTypeCorrect(luaState, currentLuaParam, currentNetParam, out extractValue)) - { // Type checking - var value = extractValue(luaState, currentLuaParam); - paramList.Add(value); - int index = paramList.LastIndexOf(value); - var methodArg = new MethodArgs(); - methodArg.index = index; - methodArg.extractValue = extractValue; - argTypes.Add(methodArg); - - if (currentNetParam.ParameterType.IsByRef) - outList.Add(index); - - currentLuaParam++; - } else if (currentLuaParam > nLuaParams) { // Adds optional parameters - if (currentNetParam.IsOptional) - paramList.Add (currentNetParam.DefaultValue); - else { - isMethod = false; - break; - } - } else if (currentNetParam.IsOptional) - paramList.Add (currentNetParam.DefaultValue); - else { // No match - isMethod = false; - break; - } - } - - if (currentLuaParam != nLuaParams + 1) // Number of parameters does not match - isMethod = false; - if (isMethod) { - methodCache.args = paramList.ToArray (); - methodCache.cachedMethod = method; - methodCache.outList = outList.ToArray (); - methodCache.argTypes = argTypes.ToArray (); - } - return isMethod; - } - - /// - /// CP: Fix for operator overloading failure - /// Returns true if the type is set and assigns the extract value - /// - /// - /// - /// - /// - /// - private bool IsTypeCorrect (LuaState luaState, int currentLuaParam, ParameterInfo currentNetParam, out ExtractValue extractValue) - { - try { - return (extractValue = translator.typeChecker.CheckLuaType (luaState, currentLuaParam, currentNetParam.ParameterType)) != null; - } catch { - extractValue = null; - Debug.WriteLine ("Type wasn't correct"); - return false; - } - } - - private bool IsParamsArray (LuaState luaState, int nLuaParams, int currentLuaParam, ParameterInfo currentNetParam, out ExtractValue extractValue) - { - extractValue = null; - bool isParamArray = false; - - if (currentNetParam.GetCustomAttributes (typeof(ParamArrayAttribute), false).Any ()) { - - isParamArray = nLuaParams < currentLuaParam; - LuaTypes luaType; - - try { - luaType = LuaLib.LuaType (luaState, currentLuaParam); - } catch (Exception ex) { - Debug.WriteLine ("Could not retrieve lua type while attempting to determine params Array Status."); - Debug.WriteLine (ex.Message); - extractValue = null; - return false; - } - - if (luaType == LuaTypes.Table) { - try { - extractValue = translator.typeChecker.GetExtractor (typeof(LuaTable)); - } catch (Exception/* ex*/) { - Debug.WriteLine ("An error occurred during an attempt to retrieve a LuaTable extractor while checking for params array status."); - } - - if (extractValue != null) { - return true; - } - } else { - var paramElementType = currentNetParam.ParameterType.GetElementType (); - - try { - extractValue = translator.typeChecker.CheckLuaType (luaState, currentLuaParam, paramElementType); - } catch (Exception/* ex*/) { - Debug.WriteLine (string.Format ("An error occurred during an attempt to retrieve an extractor ({0}) while checking for params array status.", paramElementType.FullName)); - } - - if (extractValue != null) { - return true; - } - } - } - - return isParamArray; - } - } -} \ No newline at end of file diff --git a/Core/NLua/Method/EventHandlerContainer.cs b/Core/NLua/Method/EventHandlerContainer.cs deleted file mode 100644 index 324fbcb3058c1714a3570853d3f6cec302f4bc50..0000000000000000000000000000000000000000 --- a/Core/NLua/Method/EventHandlerContainer.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Diagnostics; -using System.Collections.Generic; - -namespace NLua.Method -{ - /// - /// We keep track of what delegates we have auto attached to an event - to allow us to cleanly exit a NLua session - /// - class EventHandlerContainer : IDisposable - { - private Dictionary dict = new Dictionary (); - - public void Add (Delegate handler, RegisterEventHandler eventInfo) - { - dict.Add (handler, eventInfo); - } - - public void Remove (Delegate handler) - { - bool found = dict.Remove (handler); - Debug.Assert (found); - } - - /// - /// Remove any still registered handlers - /// - public void Dispose () - { - foreach (KeyValuePair pair in dict) - pair.Value.RemovePending (pair.Key); - - dict.Clear (); - } - } -} \ No newline at end of file diff --git a/Core/NLua/Method/LuaClassHelper.cs b/Core/NLua/Method/LuaClassHelper.cs deleted file mode 100644 index c23acc27d8a58f5545c86dc77ce61433c72f5f5b..0000000000000000000000000000000000000000 --- a/Core/NLua/Method/LuaClassHelper.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua.Method -{ - /* - * Static helper methods for Lua tables acting as CLR objects. - * - * Author: Fabio Mascarenhas - * Version: 1.0 - */ - public class LuaClassHelper - { - /* - * Gets the function called name from the provided table, - * returning null if it does not exist - */ - public static LuaFunction GetTableFunction (LuaTable luaTable, string name) - { - if (luaTable == null) - return null; - - object funcObj = luaTable.RawGet (name); - - if (funcObj is LuaFunction) - return (LuaFunction)funcObj; - else - return null; - } - - /* - * Calls the provided function with the provided parameters - */ - public static object CallFunction (LuaFunction function, object[] args, Type[] returnTypes, object[] inArgs, int[] outArgs) - { - // args is the return array of arguments, inArgs is the actual array - // of arguments passed to the function (with in parameters only), outArgs - // has the positions of out parameters - object returnValue; - int iRefArgs; - object[] returnValues = function.Call (inArgs, returnTypes); - - if (returnTypes [0] == typeof(void)) { - returnValue = null; - iRefArgs = 0; - } else { - returnValue = returnValues [0]; - iRefArgs = 1; - } - - for (int i = 0; i < outArgs.Length; i++) { - args [outArgs [i]] = returnValues [iRefArgs]; - iRefArgs++; - } - - return returnValue; - } - } -} \ No newline at end of file diff --git a/Core/NLua/Method/LuaDelegate.cs b/Core/NLua/Method/LuaDelegate.cs deleted file mode 100644 index d7782369bd293c7afa7ea1c12bf6ef9efb577a91..0000000000000000000000000000000000000000 --- a/Core/NLua/Method/LuaDelegate.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua.Method -{ - /* - * Wrapper class for Lua functions as delegates - * Subclasses with correct signatures are created - * at runtime. - * - * Author: Fabio Mascarenhas - * Version: 1.0 - */ - public class LuaDelegate - { - public LuaFunction function; - public Type[] returnTypes; - - public LuaDelegate () - { - function = null; - returnTypes = null; - } - - public object CallFunction (object[] args, object[] inArgs, int[] outArgs) - { - // args is the return array of arguments, inArgs is the actual array - // of arguments passed to the function (with in parameters only), outArgs - // has the positions of out parameters - object returnValue; - int iRefArgs; - object[] returnValues = function.Call (inArgs, returnTypes); - - if (returnTypes [0] == typeof(void)) { - returnValue = null; - iRefArgs = 0; - } else { - returnValue = returnValues [0]; - iRefArgs = 1; - } - - // Sets the value of out and ref parameters (from - // the values returned by the Lua function). - for (int i = 0; i < outArgs.Length; i++) { - args [outArgs [i]] = returnValues [iRefArgs]; - iRefArgs++; - } - - return returnValue; - } - } -} \ No newline at end of file diff --git a/Core/NLua/Method/LuaEventHandler.cs b/Core/NLua/Method/LuaEventHandler.cs deleted file mode 100644 index 8fa9ac0d14484e7913952e2724745450b24f887b..0000000000000000000000000000000000000000 --- a/Core/NLua/Method/LuaEventHandler.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua.Method -{ - /* - * Base wrapper class for Lua function event handlers. - * Subclasses that do actual event handling are created - * at runtime. - * - * Author: Fabio Mascarenhas - * Version: 1.0 - */ - public class LuaEventHandler - { - public LuaFunction handler = null; - - // CP: Fix provided by Ben Bryant for delegates with one param - // link: http://luaforge.net/forum/message.php?msg_id=9318 - public void HandleEvent (object[] args) - { - handler.Call (args); - } - //public void handleEvent(object sender,object data) - //{ - // handler.call(new object[] { sender,data },new Type[0]); - //} - } -} \ No newline at end of file diff --git a/Core/NLua/Method/LuaMethodWrapper.cs b/Core/NLua/Method/LuaMethodWrapper.cs deleted file mode 100755 index 0b28962043ad583f8f2dce365a86194f4b8fc6ae..0000000000000000000000000000000000000000 --- a/Core/NLua/Method/LuaMethodWrapper.cs +++ /dev/null @@ -1,317 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Reflection; -using System.Collections.Generic; -using System.Linq; -using NLua.Exceptions; -using NLua.Extensions; - -namespace NLua.Method -{ - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - using LuaNativeFunction = KopiLua.LuaNativeFunction; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - using LuaNativeFunction = KeraLua.LuaNativeFunction; - #endif - - /* - * Argument extraction with type-conversion function - */ - delegate object ExtractValue (LuaState luaState, int stackPos); - - /* - * Wrapper class for methods/constructors accessed from Lua. - * - * Author: Fabio Mascarenhas - * Version: 1.0 - */ - class LuaMethodWrapper - { - internal LuaNativeFunction invokeFunction; - ObjectTranslator _Translator; - MethodBase _Method; - MethodCache _LastCalledMethod = new MethodCache (); - string _MethodName; - MemberInfo[] _Members; - ExtractValue _ExtractTarget; - object _Target; - bool _IsStatic; - - /* - * Constructs the wrapper for a known MethodBase instance - */ - public LuaMethodWrapper (ObjectTranslator translator, object target, ProxyType targetType, MethodBase method) - { - invokeFunction = new LuaNativeFunction (this.Call); - _Translator = translator; - _Target = target; - - if (targetType != null) - _ExtractTarget = translator.typeChecker.GetExtractor (targetType); - - _Method = method; - _MethodName = method.Name; - _IsStatic = method.IsStatic; - } - - /* - * Constructs the wrapper for a known method name - */ - public LuaMethodWrapper (ObjectTranslator translator, ProxyType targetType, string methodName, BindingFlags bindingType) - { - invokeFunction = new LuaNativeFunction (this.Call); - - _Translator = translator; - _MethodName = methodName; - - if (targetType != null) - _ExtractTarget = translator.typeChecker.GetExtractor (targetType); - - _IsStatic = (bindingType & BindingFlags.Static) == BindingFlags.Static; - _Members = GetMethodsRecursively (targetType.UnderlyingSystemType, methodName, bindingType | BindingFlags.Public); - } - - MethodInfo [] GetMethodsRecursively (Type type, string methodName, BindingFlags bindingType) - { - if (type == typeof(object)) - return type.GetMethods (methodName, bindingType); - - var methods = type.GetMethods (methodName, bindingType); -#if NETFX_CORE - var baseMethods = GetMethodsRecursively (type.GetTypeInfo ().BaseType, methodName, bindingType); -#else - var baseMethods = GetMethodsRecursively (type.BaseType, methodName, bindingType); -#endif - - return methods.Concat (baseMethods).ToArray (); - } - - /// - /// Convert C# exceptions into Lua errors - /// - /// num of things on stack - /// null for no pending exception - int SetPendingException (Exception e) - { - return _Translator.interpreter.SetPendingException (e); - } - - /* - * Calls the method. Receives the arguments from the Lua stack - * and returns values in it. - */ - int Call (LuaState luaState) - { - var methodToCall = _Method; - object targetObject = _Target; - bool failedCall = true; - int nReturnValues = 0; - - if (!LuaLib.LuaCheckStack (luaState, 5)) - throw new LuaException ("Lua stack overflow"); - - bool isStatic = _IsStatic; - SetPendingException (null); - - if (methodToCall == null) { // Method from name - if (isStatic) - targetObject = null; - else - targetObject = _ExtractTarget (luaState, 1); - - if (_LastCalledMethod.cachedMethod != null) { // Cached? - int numStackToSkip = isStatic ? 0 : 1; // If this is an instance invoe we will have an extra arg on the stack for the targetObject - int numArgsPassed = LuaLib.LuaGetTop (luaState) - numStackToSkip; - MethodBase method = _LastCalledMethod.cachedMethod; - - if (numArgsPassed == _LastCalledMethod.argTypes.Length) { // No. of args match? - if (!LuaLib.LuaCheckStack (luaState, _LastCalledMethod.outList.Length + 6)) - throw new LuaException ("Lua stack overflow"); - - object [] args = _LastCalledMethod.args; - - try { - for (int i = 0; i < _LastCalledMethod.argTypes.Length; i++) { - - MethodArgs type = _LastCalledMethod.argTypes [i]; - - int index = i + 1 + numStackToSkip; - - Func valueExtractor = (currentParam) => { - return type.extractValue (luaState, currentParam); - }; - - if (_LastCalledMethod.argTypes [i].isParamsArray) { - int count = _LastCalledMethod.argTypes.Length - i; - Array paramArray = _Translator.TableToArray (valueExtractor, type.paramsArrayType, index, count); - args [_LastCalledMethod.argTypes [i].index] = paramArray; - } else { - args [type.index] = valueExtractor (index); - } - - if (_LastCalledMethod.args [_LastCalledMethod.argTypes [i].index] == null && - !LuaLib.LuaIsNil (luaState, i + 1 + numStackToSkip)) - throw new LuaException (string.Format("argument number {0} is invalid",(i + 1))); - } - - if (_IsStatic) - _Translator.Push (luaState, method.Invoke (null, _LastCalledMethod.args)); - else { - if (method.IsConstructor) - _Translator.Push (luaState, ((ConstructorInfo)method).Invoke (_LastCalledMethod.args)); - else - _Translator.Push (luaState, method.Invoke (targetObject, _LastCalledMethod.args)); - } - - failedCall = false; - } catch (TargetInvocationException e) { - // Failure of method invocation - if (_Translator.interpreter.UseTraceback) e.GetBaseException().Data["Traceback"] = _Translator.interpreter.GetDebugTraceback(); - return SetPendingException (e.GetBaseException ()); - } catch (Exception e) { - if (_Members.Length == 1) // Is the method overloaded? - // No, throw error - return SetPendingException (e); - } - } - } - - // Cache miss - if (failedCall) { - // System.Diagnostics.Debug.WriteLine("cache miss on " + methodName); - // If we are running an instance variable, we can now pop the targetObject from the stack - if (!isStatic) { - if (targetObject == null) { - _Translator.ThrowError (luaState, String.Format ("instance method '{0}' requires a non null target object", _MethodName)); - LuaLib.LuaPushNil (luaState); - return 1; - } - - LuaLib.LuaRemove (luaState, 1); // Pops the receiver - } - - bool hasMatch = false; - string candidateName = null; - - foreach (var member in _Members) { -#if NETFX_CORE - candidateName = member.DeclaringType.Name + "." + member.Name; -#else - candidateName = member.ReflectedType.Name + "." + member.Name; -#endif - var m = (MethodInfo)member; - bool isMethod = _Translator.MatchParameters (luaState, m, ref _LastCalledMethod); - - if (isMethod) { - hasMatch = true; - break; - } - } - - if (!hasMatch) { - string msg = (candidateName == null) ? "invalid arguments to method call" : ("invalid arguments to method: " + candidateName); - _Translator.ThrowError (luaState, msg); - LuaLib.LuaPushNil (luaState); - return 1; - } - } - } else { // Method from MethodBase instance - if (methodToCall.ContainsGenericParameters) { - - _Translator.MatchParameters (luaState, methodToCall, ref _LastCalledMethod); - - if (methodToCall.IsGenericMethodDefinition) { - //need to make a concrete type of the generic method definition - var typeArgs = new List (); - - foreach (object arg in _LastCalledMethod.args) - typeArgs.Add (arg.GetType ()); - - var concreteMethod = (methodToCall as MethodInfo).MakeGenericMethod (typeArgs.ToArray ()); - _Translator.Push (luaState, concreteMethod.Invoke (targetObject, _LastCalledMethod.args)); - failedCall = false; - } else if (methodToCall.ContainsGenericParameters) { - _Translator.ThrowError (luaState, "unable to invoke method on generic class as the current method is an open generic method"); - LuaLib.LuaPushNil (luaState); - return 1; - } - } else { - if (!methodToCall.IsStatic && !methodToCall.IsConstructor && targetObject == null) { - targetObject = _ExtractTarget (luaState, 1); - LuaLib.LuaRemove (luaState, 1); // Pops the receiver - } - - if (!_Translator.MatchParameters (luaState, methodToCall, ref _LastCalledMethod)) { - _Translator.ThrowError (luaState, "invalid arguments to method call"); - LuaLib.LuaPushNil (luaState); - return 1; - } - } - } - - if (failedCall) { - if (!LuaLib.LuaCheckStack (luaState, _LastCalledMethod.outList.Length + 6)) - throw new LuaException ("Lua stack overflow"); - - try { - if (isStatic) - _Translator.Push (luaState, _LastCalledMethod.cachedMethod.Invoke (null, _LastCalledMethod.args)); - else { - if (_LastCalledMethod.cachedMethod.IsConstructor) - _Translator.Push (luaState, ((ConstructorInfo)_LastCalledMethod.cachedMethod).Invoke (_LastCalledMethod.args)); - else - _Translator.Push (luaState, _LastCalledMethod.cachedMethod.Invoke (targetObject, _LastCalledMethod.args)); - } - } catch (TargetInvocationException e) { - if (_Translator.interpreter.UseTraceback) e.GetBaseException().Data["Traceback"] = _Translator.interpreter.GetDebugTraceback(); - return SetPendingException (e.GetBaseException ()); - } catch (Exception e) { - return SetPendingException (e); - } - } - - // Pushes out and ref return values - for (int index = 0; index < _LastCalledMethod.outList.Length; index++) { - nReturnValues++; - _Translator.Push (luaState, _LastCalledMethod.args [_LastCalledMethod.outList [index]]); - } - - //by isSingle 2010-09-10 11:26:31 - //Desc: - // if not return void,we need add 1, - // or we will lost the function's return value - // when call dotnet function like "int foo(arg1,out arg2,out arg3)" in lua code - if (!_LastCalledMethod.IsReturnVoid && nReturnValues > 0) - nReturnValues++; - - return nReturnValues < 1 ? 1 : nReturnValues; - } - } -} \ No newline at end of file diff --git a/Core/NLua/Method/MethodArgs.cs b/Core/NLua/Method/MethodArgs.cs deleted file mode 100644 index 2f510be64eaa743f40523d951db0470d9656ba74..0000000000000000000000000000000000000000 --- a/Core/NLua/Method/MethodArgs.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; - -namespace NLua.Method -{ - /* - * Parameter information - */ - struct MethodArgs - { - // Position of parameter - public int index; - // Type-conversion function - public ExtractValue extractValue; - public bool isParamsArray; - public Type paramsArrayType; - } -} \ No newline at end of file diff --git a/Core/NLua/Method/MethodCache.cs b/Core/NLua/Method/MethodCache.cs deleted file mode 100644 index 7be922b9a592e75d9859e2235d0126a42914acdd..0000000000000000000000000000000000000000 --- a/Core/NLua/Method/MethodCache.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Reflection; -using NLua.Extensions; - -namespace NLua.Method -{ - /* - * Cached method - */ - struct MethodCache - { - private MethodBase _cachedMethod; - - public MethodBase cachedMethod { - get { - return _cachedMethod; - } - set { - _cachedMethod = value; - var mi = value as MethodInfo; - - if (mi != null) { - IsReturnVoid = mi.ReturnType == typeof (void); - } - } - } - - public bool IsReturnVoid; - // List or arguments - public object[] args; - // Positions of out parameters - public int[] outList; - // Types of parameters - public MethodArgs[] argTypes; - } -} \ No newline at end of file diff --git a/Core/NLua/Method/RegisterEventHandler.cs b/Core/NLua/Method/RegisterEventHandler.cs deleted file mode 100644 index 5bea10a4693f489fd819759f7c0c56e8ddec1ffd..0000000000000000000000000000000000000000 --- a/Core/NLua/Method/RegisterEventHandler.cs +++ /dev/null @@ -1,81 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Reflection; - -namespace NLua.Method -{ - /* - * Wrapper class for events that does registration/deregistration - * of event handlers. - * - * Author: Fabio Mascarenhas - * Version: 1.0 - */ - class RegisterEventHandler - { - private EventHandlerContainer pendingEvents; - private EventInfo eventInfo; - private object target; - - public RegisterEventHandler (EventHandlerContainer pendingEvents, object target, EventInfo eventInfo) - { - this.target = target; - this.eventInfo = eventInfo; - this.pendingEvents = pendingEvents; - } - - /* - * Adds a new event handler - */ - public Delegate Add (LuaFunction function) - { - //CP: Fix by Ben Bryant for event handling with one parameter - //link: http://luaforge.net/forum/message.php?msg_id=9266 - Delegate handlerDelegate = CodeGeneration.Instance.GetDelegate (eventInfo.EventHandlerType, function); - eventInfo.AddEventHandler (target, handlerDelegate); - pendingEvents.Add (handlerDelegate, this); - - return handlerDelegate; - } - - /* - * Removes an existing event handler - */ - public void Remove (Delegate handlerDelegate) - { - RemovePending (handlerDelegate); - pendingEvents.Remove (handlerDelegate); - } - - /* - * Removes an existing event handler (without updating the pending handlers list) - */ - internal void RemovePending (Delegate handlerDelegate) - { - eventInfo.RemoveEventHandler (target, handlerDelegate); - } - } -} \ No newline at end of file diff --git a/Core/NLua/NLua.Android.csproj b/Core/NLua/NLua.Android.csproj deleted file mode 100644 index 95da21ec6673b1a965840f703e9e68622d691c46..0000000000000000000000000000000000000000 --- a/Core/NLua/NLua.Android.csproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - Debug - AnyCPU - 10.0.0 - 2.0 - {92E4BB6F-130D-4EB6-9F0E-80CD213ACE81} - {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - NLua.Android - Resources\Resource.designer.cs - Resource - Resources - Assets - True - NLua.Android - v4.0.3 - true - key.snk - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - None - false - - - true - bin\Release - prompt - 4 - false - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {7648657A-8012-49FE-B7BF-BC90F77AD742} - KeraLua.Android - - - {15166620-0EDC-4F70-8551-590818DF7C67} - KopiLua.Android - - - \ No newline at end of file diff --git a/Core/NLua/NLua.Net35.csproj b/Core/NLua/NLua.Net35.csproj deleted file mode 100644 index 8067dacf0b44a42c3ed15a92abb72e09ed55a9fa..0000000000000000000000000000000000000000 --- a/Core/NLua/NLua.Net35.csproj +++ /dev/null @@ -1,126 +0,0 @@ - - - - Debug - AnyCPU - 9.0.21022 - 2.0 - {F55CABBB-4108-4A39-94E1-581FD46DC021} - Library - Properties - NLua - NLua - 2.x - v3.5 - - - True - full - False - ..\..\Run\Debug\net35\ - DEBUG;NET_3_5 - prompt - 4 - true - - - none - True - ..\..\Run\Release\net35\ - RELEASE;NET_3_5 - prompt - 4 - AnyCPU - - - true - bin\DebugKopiLua\ - DEBUG;NET_3_5;USE_KOPILUA - true - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - bin\ReleaseKopiLua\ - NET_3_5;USE_KOPILUA - - - true - - - key.snk - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {47153754-10f5-44d8-b578-f5a32b69061a} - KeraLua.Net35 - - - {e8ddbc21-ef74-4aba-9c49-bfc702be25d8} - KopiLua.Net35 - - - - - - diff --git a/Core/NLua/NLua.Net40.csproj b/Core/NLua/NLua.Net40.csproj deleted file mode 100644 index 8730dc0c3c9714919ca03a87b51e29d943a510a2..0000000000000000000000000000000000000000 --- a/Core/NLua/NLua.Net40.csproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - Debug - AnyCPU - {F55CABBB-4108-4A39-94E1-581FD46DC021} - Library - Properties - NLua - NLua - 2.x - v4.0 - - - - True - full - False - ..\..\Run\Debug\net40\ - DEBUG - prompt - 4 - true - - - none - True - ..\..\Run\Release\net40\ - RELEASE - prompt - 4 - AnyCPU - - - true - bin\DebugKopiLua\ - DEBUG;USE_KOPILUA - true - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - 4 - false - - - bin\ReleaseKopiLua\ - USE_KOPILUA - 4 - false - - - true - - - key.snk - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {47153754-10F5-44D8-B578-F5A32B69061A} - KeraLua.Net40 - - - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8} - KopiLua.Net40 - - - - - - \ No newline at end of file diff --git a/Core/NLua/NLua.Net45.csproj b/Core/NLua/NLua.Net45.csproj deleted file mode 100644 index 10f12f11da0685ca164ceb8c8effbe299f4bb885..0000000000000000000000000000000000000000 --- a/Core/NLua/NLua.Net45.csproj +++ /dev/null @@ -1,133 +0,0 @@ - - - - Debug - AnyCPU - {F55CABBB-4108-4A39-94E1-581FD46DC021} - Library - Properties - NLua - NLua - 1.3.2 - v4.5 - - - - True - full - False - ..\..\Run\Debug\net45\ - DEBUG - prompt - 4 - true - false - - - none - True - ..\..\Run\Release\net45\ - RELEASE - prompt - 4 - AnyCPU - false - - - true - bin\DebugKopiLua\ - DEBUG;USE_KOPILUA - true - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false - 4 - false - - - bin\ReleaseKopiLua\ - USE_KOPILUA - false - 4 - false - - - true - - - key.snk - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {47153754-10F5-44D8-B578-F5A32B69061A} - KeraLua.Net45 - - - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8} - KopiLua.Net45 - - - - - - \ No newline at end of file diff --git a/Core/NLua/NLua.WP7.csproj b/Core/NLua/NLua.WP7.csproj deleted file mode 100644 index 026631a465e60fbeb6ca2c482edde393e6fbabb6..0000000000000000000000000000000000000000 --- a/Core/NLua/NLua.WP7.csproj +++ /dev/null @@ -1,111 +0,0 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {380F9E4E-274F-4355-90C1-D196E785F751} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - NLua.WP7 - NLua.WP7 - v4.0 - $(TargetFrameworkVersion) - WindowsPhone71 - Silverlight - false - true - true - - - true - full - false - Bin\Debug - TRACE;DEBUG;SILVERLIGHT;WINDOWS_PHONE;USE_KOPILUA - true - true - prompt - 4 - - - pdbonly - true - Bin\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE;USE_KOPILUA - true - true - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {330E0C63-4160-46E0-BBDA-325185A4AB7A} - KopiLua-wp7 - - - - - - - \ No newline at end of file diff --git a/Core/NLua/NLua.WP8.csproj b/Core/NLua/NLua.WP8.csproj deleted file mode 100755 index cf90a28d873f39542e5e7a8771cb4d3496b2292e..0000000000000000000000000000000000000000 --- a/Core/NLua/NLua.WP8.csproj +++ /dev/null @@ -1,146 +0,0 @@ - - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {1E72B073-2154-4329-BC8D-94F19F91C945} - Library - Properties - NLua - NLua.WP8 - en-US - 8.1 - 12 - 512 - {76F1466A-8B6D-4E39-A767-685A06062A39};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - true - full - false - bin\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE;NETFX_CORE;WINDOWS_PHONE_APP - prompt - 4 - - - true - bin\ARM\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP - ;2008 - full - ARM - false - prompt - true - - - bin\ARM\Release\ - TRACE;NETFX_CORE;WINDOWS_PHONE_APP - true - ;2008 - pdbonly - ARM - false - prompt - true - - - true - bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP - ;2008 - full - x86 - false - prompt - true - - - bin\x86\Release\ - TRACE;NETFX_CORE;WINDOWS_PHONE_APP - true - ;2008 - pdbonly - x86 - false - prompt - true - - - - - {1f139ccb-195b-402d-8776-7a15a3e05886} - KeraLua.WP8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 12.0 - - - WindowsPhoneApp - - - - \ No newline at end of file diff --git a/Core/NLua/NLua.WPSL8.csproj b/Core/NLua/NLua.WPSL8.csproj deleted file mode 100644 index 88846b2d98b3531c60877813caf5b86d2e92ede0..0000000000000000000000000000000000000000 --- a/Core/NLua/NLua.WPSL8.csproj +++ /dev/null @@ -1,155 +0,0 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - NLua.WPSL8 - NLua.WPSL8 - WindowsPhone - v8.1 - - - false - true - 12.0 - true - - en-US - - - true - full - false - Bin\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - true - full - false - Bin\x86\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - - pdbonly - true - Bin\x86\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - - true - full - false - Bin\ARM\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - - pdbonly - true - Bin\ARM\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {ABD36435-56AD-4940-B51A-10AEECA46C01} - lua52 - - - {2C343545-0778-49BB-9665-1FA656013466} - KeraLua.WPSL8 - - - - - - - \ No newline at end of file diff --git a/Core/NLua/NLua.iOS.csproj b/Core/NLua/NLua.iOS.csproj deleted file mode 100644 index 1fd477acea4a04ff138a4df9760bef335a726428..0000000000000000000000000000000000000000 --- a/Core/NLua/NLua.iOS.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - Debug - AnyCPU - {7064B157-DD57-4828-94C5-CA149B25CB40} - {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - NLua.iOS - Resources - NLua.iOS - Xamarin.iOS - v1.0 - - - True - full - False - bin\Debug - DEBUG;MONOTOUCH; - prompt - 4 - False - - - none - True - bin\Release - prompt - 4 - False - MONOTOUCH; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {3F57C208-AA13-4B67-B3E7-ED41307F00A0} - KeraLua.iOS - - - - \ No newline at end of file diff --git a/Core/NLua/ObjectTranslator.cs b/Core/NLua/ObjectTranslator.cs deleted file mode 100755 index d0efd8f05897572d7d605ed000526b2be03d777d..0000000000000000000000000000000000000000 --- a/Core/NLua/ObjectTranslator.cs +++ /dev/null @@ -1,1089 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.IO; -using System.Reflection; -using System.Diagnostics; -using System.Collections; -using System.Collections.Generic; -using NLua.Method; -using NLua.Exceptions; -using NLua.Extensions; - -#if MONOTOUCH - using ObjCRuntime; -#endif - -namespace NLua -{ - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - using LuaNativeFunction = KopiLua.LuaNativeFunction; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - using LuaNativeFunction = KeraLua.LuaNativeFunction; - #endif - - /* - * Passes objects from the CLR to Lua and vice-versa - * - * Author: Fabio Mascarenhas - * Version: 1.0 - */ - public class ObjectTranslator - { - // Compare cache entries by exact reference to avoid unwanted aliases - private class ReferenceComparer : IEqualityComparer - { - public new bool Equals(object x, object y) - { - if (x != null && y != null && x.GetType() == y.GetType() && x.GetType().IsValueType && y.GetType().IsValueType) - return x.Equals(y); // Special case for boxed value types - return Object.ReferenceEquals(x, y); - } - - public int GetHashCode(object obj) - { - return obj.GetHashCode(); - } - } - - LuaNativeFunction registerTableFunction, unregisterTableFunction, getMethodSigFunction, - getConstructorSigFunction, importTypeFunction, loadAssemblyFunction, ctypeFunction, enumFromIntFunction; - // object to object # - readonly Dictionary objectsBackMap = new Dictionary (new ReferenceComparer()); - // object # to object (FIXME - it should be possible to get object address as an object #) - readonly Dictionary objects = new Dictionary (); - internal EventHandlerContainer pendingEvents = new EventHandlerContainer (); - MetaFunctions metaFunctions; - List assemblies; - internal CheckType typeChecker; - internal Lua interpreter; - /// - /// We want to ensure that objects always have a unique ID - /// - int nextObj = 0; - - public MetaFunctions MetaFunctionsInstance { - get { - return metaFunctions; - } - } - - public Lua Interpreter { - get { - return interpreter; - } - } - - public ObjectTranslator (Lua interpreter, LuaState luaState) - { - this.interpreter = interpreter; - typeChecker = new CheckType (this); - metaFunctions = new MetaFunctions (this); - assemblies = new List (); - - importTypeFunction = new LuaNativeFunction (ObjectTranslator.ImportType); - loadAssemblyFunction = new LuaNativeFunction (ObjectTranslator.LoadAssembly); - registerTableFunction = new LuaNativeFunction (ObjectTranslator.RegisterTable); - unregisterTableFunction = new LuaNativeFunction (ObjectTranslator.UnregisterTable); - getMethodSigFunction = new LuaNativeFunction (ObjectTranslator.GetMethodSignature); - getConstructorSigFunction = new LuaNativeFunction (ObjectTranslator.GetConstructorSignature); - ctypeFunction = new LuaNativeFunction (ObjectTranslator.CType); - enumFromIntFunction = new LuaNativeFunction (ObjectTranslator.EnumFromInt); - - CreateLuaObjectList (luaState); - CreateIndexingMetaFunction (luaState); - CreateBaseClassMetatable (luaState); - CreateClassMetatable (luaState); - CreateFunctionMetatable (luaState); - SetGlobalFunctions (luaState); - } - - /* - * Sets up the list of objects in the Lua side - */ - private void CreateLuaObjectList (LuaState luaState) - { - LuaLib.LuaPushString (luaState, "luaNet_objects"); - LuaLib.LuaNewTable (luaState); - LuaLib.LuaNewTable (luaState); - LuaLib.LuaPushString (luaState, "__mode"); - LuaLib.LuaPushString (luaState, "v"); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaSetMetatable (luaState, -2); - LuaLib.LuaSetTable (luaState, (int)LuaIndexes.Registry); - } - - /* - * Registers the indexing function of CLR objects - * passed to Lua - */ - private void CreateIndexingMetaFunction (LuaState luaState) - { - LuaLib.LuaPushString (luaState, "luaNet_indexfunction"); - LuaLib.LuaLDoString (luaState, MetaFunctions.LuaIndexFunction); - LuaLib.LuaRawSet (luaState, (int)LuaIndexes.Registry); - } - - /* - * Creates the metatable for superclasses (the base - * field of registered tables) - */ - private void CreateBaseClassMetatable (LuaState luaState) - { - LuaLib.LuaLNewMetatable (luaState, "luaNet_searchbase"); - LuaLib.LuaPushString (luaState, "__gc"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.GcFunction); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaPushString (luaState, "__tostring"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.ToStringFunction); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaPushString (luaState, "__index"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.BaseIndexFunction); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaPushString (luaState, "__newindex"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.NewIndexFunction); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaSetTop (luaState, -2); - } - - /* - * Creates the metatable for type references - */ - private void CreateClassMetatable (LuaState luaState) - { - LuaLib.LuaLNewMetatable (luaState, "luaNet_class"); - LuaLib.LuaPushString (luaState, "__gc"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.GcFunction); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaPushString (luaState, "__tostring"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.ToStringFunction); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaPushString (luaState, "__index"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.ClassIndexFunction); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaPushString (luaState, "__newindex"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.ClassNewindexFunction); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaPushString (luaState, "__call"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.CallConstructorFunction); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaSetTop (luaState, -2); - } - - /* - * Registers the global functions used by NLua - */ - private void SetGlobalFunctions (LuaState luaState) - { - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.IndexFunction); - LuaLib.LuaSetGlobal (luaState, "get_object_member"); - LuaLib.LuaPushStdCallCFunction (luaState, importTypeFunction); - LuaLib.LuaSetGlobal (luaState, "import_type"); - LuaLib.LuaPushStdCallCFunction (luaState, loadAssemblyFunction); - LuaLib.LuaSetGlobal (luaState, "load_assembly"); - LuaLib.LuaPushStdCallCFunction (luaState, registerTableFunction); - LuaLib.LuaSetGlobal (luaState, "make_object"); - LuaLib.LuaPushStdCallCFunction (luaState, unregisterTableFunction); - LuaLib.LuaSetGlobal (luaState, "free_object"); - LuaLib.LuaPushStdCallCFunction (luaState, getMethodSigFunction); - LuaLib.LuaSetGlobal (luaState, "get_method_bysig"); - LuaLib.LuaPushStdCallCFunction (luaState, getConstructorSigFunction); - LuaLib.LuaSetGlobal (luaState, "get_constructor_bysig"); - LuaLib.LuaPushStdCallCFunction (luaState,ctypeFunction); - LuaLib.LuaSetGlobal (luaState,"ctype"); - LuaLib.LuaPushStdCallCFunction (luaState,enumFromIntFunction); - LuaLib.LuaSetGlobal(luaState,"enum"); - } - - /* - * Creates the metatable for delegates - */ - private void CreateFunctionMetatable (LuaState luaState) - { - LuaLib.LuaLNewMetatable (luaState, "luaNet_function"); - LuaLib.LuaPushString (luaState, "__gc"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.GcFunction); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaPushString (luaState, "__call"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.ExecuteDelegateFunction); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaSetTop (luaState, -2); - } - - /* - * Passes errors (argument e) to the Lua interpreter - */ - internal void ThrowError (LuaState luaState, object e) - { - - // We use this to remove anything pushed by luaL_where - int oldTop = LuaLib.LuaGetTop (luaState); - - // Stack frame #1 is our C# wrapper, so not very interesting to the user - // Stack frame #2 must be the lua code that called us, so that's what we want to use - LuaLib.LuaLWhere (luaState, 1); - var curlev = PopValues (luaState, oldTop); - - // Determine the position in the script where the exception was triggered - string errLocation = string.Empty; - - if (curlev.Length > 0) - errLocation = curlev [0].ToString (); - - string message = e as string; - - if (message != null) { - // Wrap Lua error (just a string) and store the error location - if (interpreter.UseTraceback) message += Environment.NewLine + interpreter.GetDebugTraceback(); - e = new LuaScriptException (message, errLocation); - } else { - var ex = e as Exception; - - if (ex != null) { - // Wrap generic .NET exception as an InnerException and store the error location - if (interpreter.UseTraceback) ex.Data["Traceback"] = interpreter.GetDebugTraceback(); - e = new LuaScriptException (ex, errLocation); - } - } - - Push (luaState, e); - LuaLib.LuaError (luaState); - } - - /* - * Implementation of load_assembly. Throws an error - * if the assembly is not found. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int LoadAssembly (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return translator.LoadAssemblyInternal (luaState); - } - - private int LoadAssemblyInternal (LuaState luaState) - { - try { - string assemblyName = LuaLib.LuaToString (luaState, 1).ToString (); - Assembly assembly = null; - Exception exception = null; - - try { -#if NETFX_CORE - assembly = Assembly.Load (new AssemblyName (assemblyName)); -#else - assembly = Assembly.Load (assemblyName); -#endif - } catch (BadImageFormatException) { - // The assemblyName was invalid. It is most likely a path. - } catch (FileNotFoundException e) { - exception = e; - } - -#if !SILVERLIGHT && !NETFX_CORE - if (assembly == null) { - try { - assembly = Assembly.Load (AssemblyName.GetAssemblyName (assemblyName)); - } catch (FileNotFoundException e) { - exception = e; - } - if (assembly == null) { - - AssemblyName mscor = assemblies [0].GetName (); - AssemblyName name = new AssemblyName (); - name.Name = assemblyName; - name.CultureInfo = mscor.CultureInfo; - name.Version = mscor.Version; - name.SetPublicKeyToken (mscor.GetPublicKeyToken ()); - name.SetPublicKey (mscor.GetPublicKey ()); - assembly = Assembly.Load (name); - - if (assembly != null) - exception = null; - } - if (exception != null) - ThrowError (luaState, exception); - } -#endif - if (assembly != null && !assemblies.Contains (assembly)) - assemblies.Add (assembly); - } catch (Exception e) { - ThrowError (luaState, e); - } - - return 0; - } - - internal Type FindType (string className) - { - foreach (var assembly in assemblies) { - var klass = assembly.GetType (className); - - if (klass != null) - return klass; - } - return null; - } - - public bool IsExtensionMethodPresent (Type type, string name) - { - return GetExtensionMethod (type, name) != null; - } - - public MethodInfo GetExtensionMethod (Type type, string name) - { - return type.GetExtensionMethod (name, assemblies); - } - - /* - * Implementation of import_type. Returns nil if the - * type is not found. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int ImportType (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return translator.ImportTypeInternal (luaState); - } - - private int ImportTypeInternal (LuaState luaState) - { - string className = LuaLib.LuaToString (luaState, 1).ToString (); - var klass = FindType (className); - - if (klass != null) - PushType (luaState, klass); - else - LuaLib.LuaPushNil (luaState); - - return 1; - } - - /* - * Implementation of make_object. Registers a table (first - * argument in the stack) as an object subclassing the - * type passed as second argument in the stack. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int RegisterTable (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return translator.RegisterTableInternal (luaState); - } - - private int RegisterTableInternal (LuaState luaState) - { - if (LuaLib.LuaType (luaState, 1) == LuaTypes.Table) { - var luaTable = GetTable (luaState, 1); - string superclassName = LuaLib.LuaToString (luaState, 2).ToString (); - - if (superclassName != null) { - var klass = FindType (superclassName); - - if (klass != null) { - // Creates and pushes the object in the stack, setting - // it as the metatable of the first argument - object obj = CodeGeneration.Instance.GetClassInstance (klass, luaTable); - PushObject (luaState, obj, "luaNet_metatable"); - LuaLib.LuaNewTable (luaState); - LuaLib.LuaPushString (luaState, "__index"); - LuaLib.LuaPushValue (luaState, -3); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaPushString (luaState, "__newindex"); - LuaLib.LuaPushValue (luaState, -3); - LuaLib.LuaSetTable (luaState, -3); - LuaLib.LuaSetMetatable (luaState, 1); - // Pushes the object again, this time as the base field - // of the table and with the luaNet_searchbase metatable - LuaLib.LuaPushString (luaState, "base"); - int index = AddObject (obj); - PushNewObject (luaState, obj, index, "luaNet_searchbase"); - LuaLib.LuaRawSet (luaState, 1); - } else - ThrowError (luaState, "register_table: can not find superclass '" + superclassName + "'"); - } else - ThrowError (luaState, "register_table: superclass name can not be null"); - } else - ThrowError (luaState, "register_table: first arg is not a table"); - - return 0; - } - - /* - * Implementation of free_object. Clears the metatable and the - * base field, freeing the created object for garbage-collection - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int UnregisterTable (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return translator.UnregisterTableInternal (luaState); - } - - private int UnregisterTableInternal (LuaState luaState) - { - try { - if (LuaLib.LuaGetMetatable (luaState, 1) != 0) { - LuaLib.LuaPushString (luaState, "__index"); - LuaLib.LuaGetTable (luaState, -2); - object obj = GetRawNetObject (luaState, -1); - - if (obj == null) - ThrowError (luaState, "unregister_table: arg is not valid table"); - - var luaTableField = obj.GetType ().GetField ("__luaInterface_luaTable"); - - if (luaTableField == null) - ThrowError (luaState, "unregister_table: arg is not valid table"); - - luaTableField.SetValue (obj, null); - LuaLib.LuaPushNil (luaState); - LuaLib.LuaSetMetatable (luaState, 1); - LuaLib.LuaPushString (luaState, "base"); - LuaLib.LuaPushNil (luaState); - LuaLib.LuaSetTable (luaState, 1); - } else - ThrowError (luaState, "unregister_table: arg is not valid table"); - } catch (Exception e) { - ThrowError (luaState, e.Message); - } - - return 0; - } - - /* - * Implementation of get_method_bysig. Returns nil - * if no matching method is not found. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int GetMethodSignature (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return translator.GetMethodSignatureInternal (luaState); - } - - private int GetMethodSignatureInternal (LuaState luaState) - { - ProxyType klass; - object target; - int udata = LuaLib.LuaNetCheckUData (luaState, 1, "luaNet_class"); - - if (udata != -1) { - klass = (ProxyType)objects [udata]; - target = null; - } else { - target = GetRawNetObject (luaState, 1); - - if (target == null) { - ThrowError (luaState, "get_method_bysig: first arg is not type or object reference"); - LuaLib.LuaPushNil (luaState); - return 1; - } - - klass = new ProxyType(target.GetType ()); - } - - string methodName = LuaLib.LuaToString (luaState, 2).ToString (); - var signature = new Type[LuaLib.LuaGetTop (luaState) - 2]; - - for (int i = 0; i < signature.Length; i++) - signature [i] = FindType (LuaLib.LuaToString (luaState, i + 3).ToString ()); - - try { - var method = klass.GetMethod (methodName, BindingFlags.Public | BindingFlags.Static | - BindingFlags.Instance, signature); - PushFunction (luaState, new LuaNativeFunction ((new LuaMethodWrapper (this, target, klass, method)).invokeFunction)); - } catch (Exception e) { - ThrowError (luaState, e); - LuaLib.LuaPushNil (luaState); - } - - return 1; - } - - /* - * Implementation of get_constructor_bysig. Returns nil - * if no matching constructor is found. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int GetConstructorSignature (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return translator.GetConstructorSignatureInternal (luaState); - } - - private int GetConstructorSignatureInternal (LuaState luaState) - { - ProxyType klass = null; - int udata = LuaLib.LuaNetCheckUData (luaState, 1, "luaNet_class"); - - if (udata != -1) - klass = (ProxyType)objects [udata]; - - if (klass == null) - ThrowError (luaState, "get_constructor_bysig: first arg is invalid type reference"); - - var signature = new Type[LuaLib.LuaGetTop (luaState) - 1]; - - for (int i = 0; i < signature.Length; i++) - signature [i] = FindType (LuaLib.LuaToString (luaState, i + 2).ToString ()); - - try { - ConstructorInfo constructor = klass.UnderlyingSystemType.GetConstructor (signature); - PushFunction (luaState, new LuaNativeFunction ((new LuaMethodWrapper (this, null, klass, constructor)).invokeFunction)); - } catch (Exception e) { - ThrowError (luaState, e); - LuaLib.LuaPushNil (luaState); - } - - return 1; - } - - /* - * Pushes a type reference into the stack - */ - internal void PushType (LuaState luaState, Type t) - { - PushObject (luaState, new ProxyType (t), "luaNet_class"); - } - - /* - * Pushes a delegate into the stack - */ - internal void PushFunction (LuaState luaState, LuaNativeFunction func) - { - PushObject (luaState, func, "luaNet_function"); - } - - - /* - * Pushes a CLR object into the Lua stack as an userdata - * with the provided metatable - */ - internal void PushObject (LuaState luaState, object o, string metatable) - { - int index = -1; - - // Pushes nil - if (o == null) { - LuaLib.LuaPushNil (luaState); - return; - } - - // Object already in the list of Lua objects? Push the stored reference. -#if NETFX_CORE - bool found = (!o.GetType().GetTypeInfo().IsValueType || o.GetType().GetTypeInfo().IsEnum) && objectsBackMap.TryGetValue (o, out index); -#else - bool found = (!o.GetType().IsValueType || o.GetType().IsEnum) && objectsBackMap.TryGetValue(o, out index); -#endif - - if (found) { - LuaLib.LuaLGetMetatable (luaState, "luaNet_objects"); - LuaLib.LuaRawGetI (luaState, -1, index); - - // Note: starting with lua5.1 the garbage collector may remove weak reference items (such as our luaNet_objects values) when the initial GC sweep - // occurs, but the actual call of the __gc finalizer for that object may not happen until a little while later. During that window we might call - // this routine and find the element missing from luaNet_objects, but collectObject() has not yet been called. In that case, we go ahead and call collect - // object here - // did we find a non nil object in our table? if not, we need to call collect object - var type = LuaLib.LuaType (luaState, -1); - if (type != LuaTypes.Nil) { - LuaLib.LuaRemove (luaState, -2); // drop the metatable - we're going to leave our object on the stack - return; - } - - // MetaFunctions.dumpStack(this, luaState); - LuaLib.LuaRemove (luaState, -1); // remove the nil object value - LuaLib.LuaRemove (luaState, -1); // remove the metatable - CollectObject (o, index); // Remove from both our tables and fall out to get a new ID - } - - index = AddObject (o); - PushNewObject (luaState, o, index, metatable); - } - - /* - * Pushes a new object into the Lua stack with the provided - * metatable - */ - private void PushNewObject (LuaState luaState, object o, int index, string metatable) - { - if (metatable == "luaNet_metatable") { - // Gets or creates the metatable for the object's type - LuaLib.LuaLGetMetatable (luaState, o.GetType ().AssemblyQualifiedName); - - if (LuaLib.LuaIsNil (luaState, -1)) { - LuaLib.LuaSetTop (luaState, -2); - LuaLib.LuaLNewMetatable (luaState, o.GetType ().AssemblyQualifiedName); - LuaLib.LuaPushString (luaState, "cache"); - LuaLib.LuaNewTable (luaState); - LuaLib.LuaRawSet (luaState, -3); - LuaLib.LuaPushLightUserData (luaState, LuaLib.LuaNetGetTag ()); - LuaLib.LuaPushNumber (luaState, 1); - LuaLib.LuaRawSet (luaState, -3); - LuaLib.LuaPushString (luaState, "__index"); - LuaLib.LuaPushString (luaState, "luaNet_indexfunction"); - LuaLib.LuaRawGet (luaState, (int)LuaIndexes.Registry); - LuaLib.LuaRawSet (luaState, -3); - LuaLib.LuaPushString (luaState, "__gc"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.GcFunction); - LuaLib.LuaRawSet (luaState, -3); - LuaLib.LuaPushString (luaState, "__tostring"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.ToStringFunction); - LuaLib.LuaRawSet (luaState, -3); - LuaLib.LuaPushString (luaState, "__newindex"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.NewIndexFunction); - LuaLib.LuaRawSet (luaState, -3); - // Bind C# operator with Lua metamethods (__add, __sub, __mul) - RegisterOperatorsFunctions (luaState, o.GetType ()); - RegisterCallMethodForDelegate (luaState, o); - } - } else - LuaLib.LuaLGetMetatable (luaState, metatable); - - // Stores the object index in the Lua list and pushes the - // index into the Lua stack - LuaLib.LuaLGetMetatable (luaState, "luaNet_objects"); - LuaLib.LuaNetNewUData (luaState, index); - LuaLib.LuaPushValue (luaState, -3); - LuaLib.LuaRemove (luaState, -4); - LuaLib.LuaSetMetatable (luaState, -2); - LuaLib.LuaPushValue (luaState, -1); - LuaLib.LuaRawSetI (luaState, -3, index); - LuaLib.LuaRemove (luaState, -2); - } - - void RegisterCallMethodForDelegate (LuaState luaState, object o) - { - if (!(o is Delegate)) - return; - - LuaLib.LuaPushString (luaState, "__call"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.CallDelegateFunction); - LuaLib.LuaRawSet (luaState, -3); - } - - void RegisterOperatorsFunctions (LuaState luaState, Type type) - { - if (type.HasAdditionOpertator ()) { - LuaLib.LuaPushString (luaState, "__add"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.AddFunction); - LuaLib.LuaRawSet (luaState, -3); - } - if (type.HasSubtractionOpertator ()) { - LuaLib.LuaPushString (luaState, "__sub"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.SubtractFunction); - LuaLib.LuaRawSet (luaState, -3); - } - if (type.HasMultiplyOpertator ()) { - LuaLib.LuaPushString (luaState, "__mul"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.MultiplyFunction); - LuaLib.LuaRawSet (luaState, -3); - } - if (type.HasDivisionOpertator ()) { - LuaLib.LuaPushString (luaState, "__div"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.DivisionFunction); - LuaLib.LuaRawSet (luaState, -3); - } - if (type.HasModulusOpertator ()) { - LuaLib.LuaPushString (luaState, "__mod"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.ModulosFunction); - LuaLib.LuaRawSet (luaState, -3); - } - if (type.HasUnaryNegationOpertator ()) { - LuaLib.LuaPushString (luaState, "__unm"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.UnaryNegationFunction); - LuaLib.LuaRawSet (luaState, -3); - } - if (type.HasEqualityOpertator ()) { - LuaLib.LuaPushString (luaState, "__eq"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.EqualFunction); - LuaLib.LuaRawSet (luaState, -3); - } - if (type.HasLessThanOpertator ()) { - LuaLib.LuaPushString (luaState, "__lt"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.LessThanFunction); - LuaLib.LuaRawSet (luaState, -3); - } - if (type.HasLessThanOrEqualOpertator ()) { - LuaLib.LuaPushString (luaState, "__le"); - LuaLib.LuaPushStdCallCFunction (luaState, metaFunctions.LessThanOrEqualFunction); - LuaLib.LuaRawSet (luaState, -3); - } - } - - /* - * Gets an object from the Lua stack with the desired type, if it matches, otherwise - * returns null. - */ - internal object GetAsType (LuaState luaState, int stackPos, Type paramType) - { - var extractor = typeChecker.CheckLuaType (luaState, stackPos, paramType); - return extractor != null ? extractor (luaState, stackPos) : null; - } - - /// - /// Given the Lua int ID for an object remove it from our maps - /// - /// - internal void CollectObject (int udata) - { - object o; - bool found = objects.TryGetValue (udata, out o); - - // The other variant of collectObject might have gotten here first, in that case we will silently ignore the missing entry - if (found) - CollectObject (o, udata); - } - - /// - /// Given an object reference, remove it from our maps - /// - /// - private void CollectObject (object o, int udata) - { - objects.Remove (udata); -#if NETFX_CORE - if (!o.GetType ().GetTypeInfo ().IsValueType || o.GetType().GetTypeInfo().IsEnum) -#else - if (!o.GetType ().IsValueType || o.GetType().IsEnum) -#endif - objectsBackMap.Remove (o); - } - - private int AddObject (object obj) - { - // New object: inserts it in the list - int index = nextObj++; - objects [index] = obj; -#if NETFX_CORE - if (!obj.GetType ().GetTypeInfo().IsValueType || obj.GetType ().GetTypeInfo().IsEnum) -#else - if (!obj.GetType().IsValueType || obj.GetType().IsEnum) -#endif - - objectsBackMap [obj] = index; - return index; - } - - /* - * Gets an object from the Lua stack according to its Lua type. - */ - internal object GetObject (LuaState luaState, int index) - { - var type = LuaLib.LuaType (luaState, index); - - switch (type) { - case LuaTypes.Number: - { - return LuaLib.LuaToNumber (luaState, index); - } - case LuaTypes.String: - { - return LuaLib.LuaToString (luaState, index); - } - case LuaTypes.Boolean: - { - return LuaLib.LuaToBoolean (luaState, index); - } - case LuaTypes.Table: - { - return GetTable (luaState, index); - } - case LuaTypes.Function: - { - return GetFunction (luaState, index); - } - case LuaTypes.UserData: - { - int udata = LuaLib.LuaNetToNetObject (luaState, index); - return udata != -1 ? objects [udata] : GetUserData (luaState, index); - } - default: - return null; - } - } - - /* - * Gets the table in the index positon of the Lua stack. - */ - internal LuaTable GetTable (LuaState luaState, int index) - { - LuaLib.LuaPushValue (luaState, index); - int reference = LuaLib.LuaRef (luaState, 1); - if (reference == -1) - return null; - return new LuaTable (reference, interpreter); - } - - /* - * Gets the userdata in the index positon of the Lua stack. - */ - internal LuaUserData GetUserData (LuaState luaState, int index) - { - LuaLib.LuaPushValue (luaState, index); - int reference = LuaLib.LuaRef (luaState, 1); - if (reference == -1) - return null; - return new LuaUserData(reference, interpreter); - } - - /* - * Gets the function in the index positon of the Lua stack. - */ - internal LuaFunction GetFunction (LuaState luaState, int index) - { - LuaLib.LuaPushValue (luaState, index); - int reference = LuaLib.LuaRef (luaState, 1); - if (reference == -1) - return null; - return new LuaFunction (reference, interpreter); - } - - /* - * Gets the CLR object in the index positon of the Lua stack. Returns - * delegates as Lua functions. - */ - internal object GetNetObject (LuaState luaState, int index) - { - int idx = LuaLib.LuaNetToNetObject (luaState, index); - return idx != -1 ? objects [idx] : null; - } - - /* - * Gets the CLR object in the index position of the Lua stack. Returns - * delegates as is. - */ - internal object GetRawNetObject (LuaState luaState, int index) - { - int udata = LuaLib.LuaNetRawNetObj (luaState, index); - return udata != -1 ? objects [udata] : null; - } - - - /* - * Gets the values from the provided index to - * the top of the stack and returns them in an array. - */ - internal object[] PopValues (LuaState luaState, int oldTop) - { - int newTop = LuaLib.LuaGetTop (luaState); - - if (oldTop == newTop) - return null; - else { - var returnValues = new List (); - for (int i = oldTop+1; i <= newTop; i++) - returnValues.Add (GetObject (luaState, i)); - - LuaLib.LuaSetTop (luaState, oldTop); - return returnValues.ToArray (); - } - } - - /* - * Gets the values from the provided index to - * the top of the stack and returns them in an array, casting - * them to the provided types. - */ - internal object[] PopValues (LuaState luaState, int oldTop, Type[] popTypes) - { - int newTop = LuaLib.LuaGetTop (luaState); - - if (oldTop == newTop) - return null; - else { - int iTypes; - var returnValues = new List (); - - if (popTypes [0] == typeof(void)) - iTypes = 1; - else - iTypes = 0; - - for (int i = oldTop+1; i <= newTop; i++) { - returnValues.Add (GetAsType (luaState, i, popTypes [iTypes])); - iTypes++; - } - - LuaLib.LuaSetTop (luaState, oldTop); - return returnValues.ToArray (); - } - } - - // kevinh - the following line doesn't work for remoting proxies - they always return a match for 'is' - // else if(o is ILuaGeneratedType) - private static bool IsILua (object o) - { - if (o is ILuaGeneratedType) { - // Make sure we are _really_ ILuaGenerated - var typ = o.GetType (); -#if NETFX_CORE - return typ.ImplementInterface ("ILuaGeneratedType"); -#else - return typ.GetInterface ("ILuaGeneratedType", true) != null; -#endif - } - return false; - } - - /* - * Pushes the object into the Lua stack according to its type. - */ - internal void Push (LuaState luaState, object o) - { - if (o == null) - LuaLib.LuaPushNil (luaState); - else if (o is sbyte || o is byte || o is short || o is ushort || - o is int || o is uint || o is long || o is float || - o is ulong || o is decimal || o is double) { - double d = Convert.ToDouble (o); - LuaLib.LuaPushNumber (luaState, d); - } else if (o is char) { - double d = (char)o; - LuaLib.LuaPushNumber (luaState, d); - } else if (o is string) { - string str = (string)o; - LuaLib.LuaPushString (luaState, str); - } else if (o is bool) { - bool b = (bool)o; - LuaLib.LuaPushBoolean (luaState, b); - } else if (IsILua (o)) - (((ILuaGeneratedType)o).LuaInterfaceGetLuaTable ()).Push (luaState); - else if (o is LuaTable) - ((LuaTable)o).Push (luaState); - else if (o is LuaNativeFunction) - PushFunction (luaState, (LuaNativeFunction)o); - else if (o is LuaFunction) - ((LuaFunction)o).Push (luaState); - else - PushObject (luaState, o, "luaNet_metatable"); - } - - /* - * Checks if the method matches the arguments in the Lua stack, getting - * the arguments if it does. - */ - internal bool MatchParameters (LuaState luaState, MethodBase method, ref MethodCache methodCache) - { - return metaFunctions.MatchParameters (luaState, method, ref methodCache); - } - - internal Array TableToArray(Func luaParamValue, Type paramArrayType, int startIndex, int count) { - return metaFunctions.TableToArray(luaParamValue,paramArrayType, startIndex, count); - } - - private Type TypeOf (LuaState luaState, int idx) - { - int udata = LuaLib.LuaNetCheckUData (luaState, 1, "luaNet_class"); - if (udata == -1) - return null; - - ProxyType pt = (ProxyType)objects [udata]; - return pt.UnderlyingSystemType; - } - - static int PushError (LuaState luaState, string msg) - { - LuaLib.LuaPushNil (luaState); - LuaLib.LuaPushString (luaState, msg); - return 2; - } - -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int CType (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return translator.CTypeInternal (luaState); - } - - int CTypeInternal (LuaState luaState) - { - Type t = TypeOf (luaState, 1); - if (t == null) - return PushError (luaState, "Not a CLR Class"); - - PushObject (luaState, t, "luaNet_metatable"); - return 1; - } - -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] -#endif - private static int EnumFromInt (LuaState luaState) - { - var translator = ObjectTranslatorPool.Instance.Find (luaState); - return translator.EnumFromIntInternal (luaState); - } - - int EnumFromIntInternal (LuaState luaState) - { - Type t = TypeOf (luaState, 1); - if (t == null || !t.IsEnum ()) - return PushError (luaState, "Not an Enum."); - - object res = null; - LuaTypes lt = LuaLib.LuaType (luaState, 2); - if (lt == LuaTypes.Number) { - int ival = (int)LuaLib.LuaToNumber (luaState, 2); - res = Enum.ToObject (t, ival); - } else - if (lt == LuaTypes.String) { - string sflags = LuaLib.LuaToString (luaState, 2); - string err = null; - try { - res = Enum.Parse (t, sflags, true); - } catch (ArgumentException e) { - err = e.Message; - } - if (err != null) - return PushError (luaState, err); - } else { - return PushError (luaState, "Second argument must be a integer or a string."); - } - PushObject (luaState, res, "luaNet_metatable"); - return 1; - } - } -} \ No newline at end of file diff --git a/Core/NLua/ObjectTranslatorPool.cs b/Core/NLua/ObjectTranslatorPool.cs deleted file mode 100644 index 19e92d568f08b6a20c12bc7bb165ac0c9b0d8e20..0000000000000000000000000000000000000000 --- a/Core/NLua/ObjectTranslatorPool.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -#if WINDOWS_PHONE || NET_3_5 -using System.Collections.Generic; -#else -using System.Collections.Concurrent; -#endif - -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -namespace NLua -{ - #if USE_KOPILUA - using LuaCore = KopiLua.Lua; - using LuaState = KopiLua.LuaState; - #else - using LuaCore = KeraLua.Lua; - using LuaState = KeraLua.LuaState; - #endif - - internal class ObjectTranslatorPool - { - private static volatile ObjectTranslatorPool instance = new ObjectTranslatorPool (); -#if WINDOWS_PHONE || NET_3_5 - private Dictionary translators = new Dictionary(); -#else - private ConcurrentDictionary translators = new ConcurrentDictionary(); -#endif - - public static ObjectTranslatorPool Instance - { - get - { - return instance; - } - } - - public ObjectTranslatorPool () - { - } - - public void Add (LuaState luaState, ObjectTranslator translator) - { -#if WINDOWS_PHONE || NET_3_5 - lock (translators) - translators.Add (luaState, translator); -#else - if (!translators.TryAdd (luaState, translator)) - throw new ArgumentException ("An item with the same key has already been added. ", "luaState"); -#endif - } - - public ObjectTranslator Find (LuaState luaState) - { -#if WINDOWS_PHONE || NET_3_5 - lock (translators) - { -#endif - ObjectTranslator translator; - - if (!translators.TryGetValue (luaState, out translator)) - { - LuaState main = LuaCore.LuaNetGetMainState (luaState); - - if (!translators.TryGetValue (main, out translator)) - translator = null; - } - - return translator; -#if WINDOWS_PHONE || NET_3_5 - } -#endif - } - - public void Remove (LuaState luaState) - { -#if WINDOWS_PHONE || NET_3_5 - lock (translators) - { - if (!translators.ContainsKey (luaState)) - return; - - translators.Remove (luaState); - } -#else - ObjectTranslator translator; - translators.TryRemove (luaState, out translator); -#endif - } - } -} - diff --git a/Core/NLua/Platform/BindFlags.cs b/Core/NLua/Platform/BindFlags.cs deleted file mode 100755 index c9e4f2b01c9d80790f3edbc44c9c914018cc63ae..0000000000000000000000000000000000000000 --- a/Core/NLua/Platform/BindFlags.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -#if !UNITY_3D -namespace System.Reflection -{ - public enum BindingFlags - { - Instance = 4, - Static = 8, - Public = 16, - } -} -#endif \ No newline at end of file diff --git a/Core/NLua/Platform/CLSCompliantAttribute.cs b/Core/NLua/Platform/CLSCompliantAttribute.cs deleted file mode 100644 index 458bb8d7d460b2c48a343db547940072e707aa9f..0000000000000000000000000000000000000000 --- a/Core/NLua/Platform/CLSCompliantAttribute.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -#if UNITY_3D -namespace NLua { - /// - /// Disables CLS Compliance in Unity3D. - /// - [Serializable] - [AttributeUsage(AttributeTargets.All)] - [ComVisible(true)] - public class CLSCompliantAttribute : Attribute { - private bool _compliant; - public CLSCompliantAttribute(bool isCompliant) { _compliant = isCompliant; } - public bool IsCompliant { get { return _compliant; } } - } -} -#endif \ No newline at end of file diff --git a/Core/NLua/Properties/AssemblyInfo.cs b/Core/NLua/Properties/AssemblyInfo.cs deleted file mode 100644 index 90ec98d8357e438b439c09f0d7f1091c2e5c6762..0000000000000000000000000000000000000000 --- a/Core/NLua/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using NLua.Config; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("NLua")] -[assembly: AssemblyDescription(Consts.NLuaDescription)] -[assembly: AssemblyConfiguration(Consts.NLuaConfiguration)] -[assembly: AssemblyCompany(Consts.NLuaCompany)] -[assembly: AssemblyProduct(Consts.NLuaProduct)] -[assembly: AssemblyCopyright(Consts.NLuaCopyright)] -[assembly: AssemblyTrademark(Consts.NLuaTrademark)] - -[assembly: CLSCompliant(true)] - -// 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)] - -// 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(Consts.NLuaVersion)] -[assembly: AssemblyFileVersion(Consts.NLuaFileVersion)] \ No newline at end of file diff --git a/Core/NLua/ProxyType.cs b/Core/NLua/ProxyType.cs deleted file mode 100755 index 3b5017f8b013c35d526ab3edb523ae10032316b2..0000000000000000000000000000000000000000 --- a/Core/NLua/ProxyType.cs +++ /dev/null @@ -1,89 +0,0 @@ -/* - * This file is part of NLua. - * - * Copyright (c) 2015 Vinicius Jarina (viniciusjarina@gmail.com) - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -using System; -using System.Globalization; -using System.Reflection; - -#if NETFX_CORE -using NLua.Extensions; -#endif - -namespace NLua -{ - /// - /// Summary description for ProxyType. - /// - public class ProxyType - { - private Type proxy; - - public ProxyType (Type proxy) - { - this.proxy = proxy; - } - - /// - /// Provide human readable short hand for this proxy object - /// - /// - public override string ToString () - { - return "ProxyType(" + UnderlyingSystemType + ")"; - } - - public Type UnderlyingSystemType { - get { return proxy; } - } - - public override bool Equals (object obj) - { - if (obj is Type) - return proxy.Equals ((Type)obj); - if (obj is ProxyType) - return proxy.Equals (((ProxyType)obj).UnderlyingSystemType); - return proxy.Equals (obj); - } - - public override int GetHashCode () - { - return proxy.GetHashCode (); - } - - public MemberInfo[] GetMember (string name, BindingFlags bindingAttr) - { - return proxy.GetMember (name, bindingAttr); - } - - public MethodInfo GetMethod (string name, BindingFlags bindingAttr, Type[] signature) - { -#if NETFX_CORE - return proxy.GetMethod (name, bindingAttr, signature); -#else - return proxy.GetMethod (name, bindingAttr, null, signature, null); -#endif - } - } -} \ No newline at end of file diff --git a/Core/NLua/key.snk b/Core/NLua/key.snk deleted file mode 100644 index 61c4269f23e9565372cbcebf64fc17f171f21aed..0000000000000000000000000000000000000000 Binary files a/Core/NLua/key.snk and /dev/null differ diff --git a/Core/NLua/nlua.net40.pc.in b/Core/NLua/nlua.net40.pc.in deleted file mode 100644 index b81e248c620aa4b306228a96279211e2fa0b36a3..0000000000000000000000000000000000000000 --- a/Core/NLua/nlua.net40.pc.in +++ /dev/null @@ -1,6 +0,0 @@ -Name: NLua.Net40 -Description: NLua.Net40 -Version: 2.x - -Requires: -Libs: -r:@expanded_libdir@/@PACKAGE@/NLua.dll diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..eebc41670061ebcf09b9e462dd86bea6339adde7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2019 Vinicius Jarina (viniciusjarina@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/Makefile.Android b/Makefile.Android deleted file mode 100644 index 273a4950030364c508b5d0c59b96c6284d4a4d0d..0000000000000000000000000000000000000000 --- a/Makefile.Android +++ /dev/null @@ -1,9 +0,0 @@ -PROJECT=NLua.Android.sln -MDTOOL=/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool - -all: build - -run run-test: run-device - -build: - $(MDTOOL) -v build -t:Build "-c:Release" $(PROJECT) diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 26358a3439927f0e7f24c89411fdc05baf174a97..0000000000000000000000000000000000000000 --- a/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ - -EXTRA_DIST = expansions.m4 lib/nunit/nunit.framework.dll - -#Warning: This is an automatically generated file, do not edit! -if ENABLE_DEBUG - SUBDIRS = Core NLuaTest ConsoleTest Applications/LuaRunner -endif -if ENABLE_DEBUGKOPILUA - SUBDIRS = Core NLuaTest ConsoleTest Applications/LuaRunner -endif -if ENABLE_RELEASE - SUBDIRS = Core NLuaTest ConsoleTest Applications/LuaRunner -endif -if ENABLE_RELEASEKOPILUA - SUBDIRS = Core NLuaTest ConsoleTest Applications/LuaRunner -endif -if ENABLE_DEBUG_X64 - SUBDIRS = Core NLuaTest ConsoleTest Applications/LuaRunner -endif -if ENABLE_RELEASE_X64 - SUBDIRS = Core NLuaTest ConsoleTest Applications/LuaRunner -endif -if ENABLE_DEBUGKOPILUA_X64 - SUBDIRS = Core NLuaTest ConsoleTest Applications/LuaRunner -endif -if ENABLE_RELEASEKOPILUA_X64 - SUBDIRS = Core NLuaTest ConsoleTest Applications/LuaRunner -endif diff --git a/Makefile.iOS b/Makefile.iOS deleted file mode 100644 index 43979e3858738088020f1c8d4fec282e48b11ac7..0000000000000000000000000000000000000000 --- a/Makefile.iOS +++ /dev/null @@ -1,30 +0,0 @@ -PROJECT=NLua.iOS.sln -MDTOOL=/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool -MTOUCH=/Developer/MonoTouch/usr/bin/mtouch -TOUCH_SERVER=./Touch.Server/bin/Debug/Touch.Server.exe - -all: build-simulator build-device - -run run-test: run-device - -touch-server: - cd Touch.Server && xbuild - -build-simulator: - $(MDTOOL) -v build -t:Build "-c:Release|iPhoneSimulator" $(PROJECT) - -run-simulator: build-simulator touch-server - rm -f sim-results.log - mono --debug $(TOUCH_SERVER) --launchsim ios/NLuaTestsiOS/bin/iPhoneSimulator/Release/NLuaTest.app -autoexit -logfile=sim-results.log - cat sim-results.log - -build-device: - $(MDTOOL) -v build -t:Build "-c:Release|iPhone" $(PROJECT) - -run-device: build-device touch-server - $(MTOUCH) --installdev ios/NLuaTestsiOS/bin/iPhone/Release/NLuaTest.app - # kill an existing instance (based on the bundle id) - $(MTOUCH) --killdev org.nlua.nluatest - rm -f dev-results.log - mono --debug $(TOUCH_SERVER) --launchdev org.nlua.nluatest -autoexit -logfile=dev-results.log - cat dev-results.log diff --git a/Makefile.include b/Makefile.include deleted file mode 100644 index 30241663f50dc072599e44030a28efbb27ba8d7c..0000000000000000000000000000000000000000 --- a/Makefile.include +++ /dev/null @@ -1,119 +0,0 @@ -VALID_CULTURES = ar bg ca zh-CHS zh-Hans cs da de el en es fi fr he hu is it ja ko nl no pl pt rm ro ru hr sk sq sv th tr ur id uk be sl et lv lt tg fa vi hy az eu mk tn xh zu af ka fo hi mt se ga ms kk ky sw uz bn pa gu or ta te kn ml as mr mn bo cy km lo gl kok si am tzm ne ps fil ha yo nso kl ig ii br gsw sah rw gd ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR rm-CH ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR ur-PK id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT tg-Cyrl-TJ fa-IR vi-VN hy-AM az-Latn-AZ eu-ES mk-MK tn-ZA xh-ZA zu-ZA af-ZA ka-GE fo-FO hi-IN mt-MT se-NO sw-KE uz-Latn-UZ bn-IN gu-IN or-IN ta-IN te-IN kn-IN ml-IN as-IN mr-IN bo-CN cy-GB km-KH lo-LA gl-ES kok-IN si-LK am-ET ne-NP ps-AF fil-PH ha-Latn-NG yo-NG nso-ZA kl-GL ig-NG ii-CN br-FR sah-RU rw-RW gd-GB ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI az-Cyrl-AZ ga-IE uz-Cyrl-UZ bn-BD ar-EG zh-HK de-AT en-AU es-ES fr-CA se-FI ar-LY zh-SG de-LU en-CA es-GT fr-CH hr-BA ar-DZ zh-MO de-LI en-NZ es-CR fr-LU bs-Latn-BA ar-MA en-IE es-PA fr-MC sr-Latn-BA ar-TN en-ZA es-DO sr-Cyrl-BA ar-OM en-JM es-VE bs-Cyrl-BA ar-YE es-CO sr-Latn-RS ar-SY en-BZ es-PE sr-Cyrl-RS ar-JO en-TT es-AR sr-Latn-ME ar-LB en-ZW es-EC sr-Cyrl-ME ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA en-IN es-BO es-SV en-SG es-HN es-NI es-PR es-US bs-Cyrl bs-Latn sr-Cyrl sr-Latn az-Cyrl zh nn bs az-Latn uz-Cyrl mn-Cyrl zh-Hant zh-CHT nb sr tg-Cyrl uz-Latn tzm-Latn ha-Latn - -s2q=$(subst \ ,?,$1) -q2s=$(subst ?,\ ,$1) -# use this when result will be quoted -unesc2=$(subst ?, ,$1) - -build_sources = $(FILES) $(GENERATED_FILES) -build_sources_esc= $(call s2q,$(build_sources)) -# use unesc2, as build_sources_embed is quoted -build_sources_embed= $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) - -comma__=, -get_resource_name = $(firstword $(subst $(comma__), ,$1)) -get_culture = $(lastword $(subst ., ,$(basename $1))) -is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) - -RESOURCES_ESC=$(call s2q,$(RESOURCES)) - -build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) -build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) -build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) -build_others_list = $(build_non_culture_others_list) -build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) - -# resgen all .resx resources -build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) -build_resx_resources_esc = $(build_resx_files:.resx=.resources) -build_resx_resources = $(call q2s,$(build_resx_resources_esc)) - -# embed resources for the main assembly -build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) -# use unesc2, as build_resx_resources_embed is quoted -build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) -build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) -build_others_resources = $(build_others_files) -# use unesc2, as build_others_resources_embed is quoted -build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) - -build_resources = $(build_resx_resources) $(build_others_resources) -build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) - -# -usesourcepath is available only for resgen2 -emit_resgen_target_1=$(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' -emit_resgen_target_2=$(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' - -emit_resgen_target=$(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) -emit_resgen_targets=$(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) - -build_references_ref = $(call q2s,$(foreach ref, $(call s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) -build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref))) -build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), -r:$(ref))) - -s2q2s=$(call unesc2,$(call s2q,$1)) -cp_actual=test -z $1 || cp $1 $2 -cp=$(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') - -rm_actual=test -z '$1' || rm -f '$2' -rm=$(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) - -EXTRA_DIST += $(build_sources) $(build_resx_files) $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) $(DATA_FILES) $(build_culture_res_files) -CLEANFILES += $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) $(build_satellite_assembly_list) -DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* - -programfilesdir = $(pkglibdir) -programfiles_DATA = $(ASSEMBLY) -bin_SCRIPTS = $(BINARIES) - -programfilesdir = @libdir@/@PACKAGE@ -programfiles_DATA = $(PROGRAMFILES) -linuxpkgconfigdir = @libdir@/pkgconfig -linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) - - -# macros - -# $(call emit-deploy-target,deploy-variable-name) -define emit-deploy-target -$($1): $($1_SOURCE) - mkdir -p '$$(shell dirname '$$@')' - cp '$$<' '$$@' -endef - -# $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) -# assumes that for a wrapper foo.pc its source template is foo.pc.in -# if $3 is non-empty then wrapper is marked exec -define emit-deploy-wrapper -$($1): $2 - mkdir -p '$$(shell dirname '$$@')' - cp '$$<' '$$@' - $(if $3,chmod +x '$$@') - -endef - -# generating satellite assemblies - -culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) -cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) -culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) -culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') -build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) -build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) -install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) - -$(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) -$(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) - -$(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): - mkdir -p '$(@D)' - $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) - -$(install_satellite_assembly_list): - mkdir -p '$(@D)' - cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ - -install-satellite-assemblies: $(install_satellite_assembly_list) - -uninstall-satellite-assemblies: - rm -rf $(install_satellite_assembly_list) \ No newline at end of file diff --git a/NLua.Android.sln b/NLua.Android.sln deleted file mode 100644 index 4b7a694459851ee6e76be6e315a6587fd366aa3c..0000000000000000000000000000000000000000 --- a/NLua.Android.sln +++ /dev/null @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.Android", "Core\NLua\NLua.Android.csproj", "{92E4BB6F-130D-4EB6-9F0E-80CD213ACE81}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeraLua.Android", "Core\KeraLua\src\KeraLua.Android.csproj", "{7648657A-8012-49FE-B7BF-BC90F77AD742}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KopiLua.Android", "Core\KopiLua\KopiLua\KopiLua.Android.csproj", "{15166620-0EDC-4F70-8551-590818DF7C67}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLuaTest.Android", "NLuaTests.Android\NLuaTest.Android.csproj", "{401B1795-0B7C-4F20-AE9D-F8685D15A825}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {15166620-0EDC-4F70-8551-590818DF7C67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {15166620-0EDC-4F70-8551-590818DF7C67}.Debug|Any CPU.Build.0 = Debug|Any CPU - {15166620-0EDC-4F70-8551-590818DF7C67}.Release|Any CPU.ActiveCfg = Release|Any CPU - {15166620-0EDC-4F70-8551-590818DF7C67}.Release|Any CPU.Build.0 = Release|Any CPU - {401B1795-0B7C-4F20-AE9D-F8685D15A825}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {401B1795-0B7C-4F20-AE9D-F8685D15A825}.Debug|Any CPU.Build.0 = Debug|Any CPU - {401B1795-0B7C-4F20-AE9D-F8685D15A825}.Release|Any CPU.ActiveCfg = Release|Any CPU - {401B1795-0B7C-4F20-AE9D-F8685D15A825}.Release|Any CPU.Build.0 = Release|Any CPU - {7648657A-8012-49FE-B7BF-BC90F77AD742}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7648657A-8012-49FE-B7BF-BC90F77AD742}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7648657A-8012-49FE-B7BF-BC90F77AD742}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7648657A-8012-49FE-B7BF-BC90F77AD742}.Release|Any CPU.Build.0 = Release|Any CPU - {92E4BB6F-130D-4EB6-9F0E-80CD213ACE81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {92E4BB6F-130D-4EB6-9F0E-80CD213ACE81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {92E4BB6F-130D-4EB6-9F0E-80CD213ACE81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {92E4BB6F-130D-4EB6-9F0E-80CD213ACE81}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = NLuaTests.Android\NLuaTest.Android.csproj - EndGlobalSection -EndGlobal diff --git a/NLua.Net35.sln b/NLua.Net35.sln deleted file mode 100644 index e21ea1e16d983b5ffd884f177077d8de3427be82..0000000000000000000000000000000000000000 --- a/NLua.Net35.sln +++ /dev/null @@ -1,202 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{0E28CF40-4DFA-46FE-95BB-E90648DFE6F5}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Applications", "Applications", "{B13128D8-A4F3-4C53-A4C6-F2EA34F527BD}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{B8664957-CB71-4F11-A4DB-59E7514BC5F3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KopiLua.Net35", "Core\KopiLua\KopiLua\KopiLua.Net35.csproj", "{E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.Net35", "Core\NLua\NLua.Net35.csproj", "{F55CABBB-4108-4A39-94E1-581FD46DC021}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeraLua.Net35", "Core\KeraLua\src\KeraLua.Net35.csproj", "{47153754-10F5-44D8-B578-F5A32B69061A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLuaTest.35", "NLuaTest\NLuaTest.35.csproj", "{D5FCADFA-5047-40C2-B392-256875862920}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - DebugKopiLua|Any CPU = DebugKopiLua|Any CPU - Release|Any CPU = Release|Any CPU - ReleaseKopiLua|Any CPU = ReleaseKopiLua|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Release|Any CPU.Build.0 = Release|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Release|Any CPU.Build.0 = Release|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Release|Any CPU.Build.0 = Release|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Release|Any CPU.Build.0 = Release|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8} = {B8664957-CB71-4F11-A4DB-59E7514BC5F3} - {F55CABBB-4108-4A39-94E1-581FD46DC021} = {B8664957-CB71-4F11-A4DB-59E7514BC5F3} - {47153754-10F5-44D8-B578-F5A32B69061A} = {B8664957-CB71-4F11-A4DB-59E7514BC5F3} - {D5FCADFA-5047-40C2-B392-256875862920} = {0E28CF40-4DFA-46FE-95BB-E90648DFE6F5} - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = NLuaTest\NLuaTest.csproj - Policies = $0 - $0.TextStylePolicy = $3 - $1.inheritsSet = null - $1.scope = text/x-csharp - $0.CSharpFormattingPolicy = $2 - $2.AfterDelegateDeclarationParameterComma = True - $2.inheritsSet = Mono - $2.inheritsScope = text/x-csharp - $2.scope = text/x-csharp - $3.inheritsSet = Mono - $3.inheritsScope = text/plain - $3.scope = text/plain - $0.StandardHeader = $4 - $4.Text = - $4.IncludeInNewFiles = True - $0.NameConventionPolicy = $5 - $5.Rules = $6 - $6.NamingRule = $26 - $7.Name = Namespaces - $7.AffectedEntity = Namespace - $7.VisibilityMask = VisibilityMask - $7.NamingStyle = PascalCase - $7.IncludeInstanceMembers = True - $7.IncludeStaticEntities = True - $8.Name = Types - $8.AffectedEntity = Class, Struct, Enum, Delegate - $8.VisibilityMask = Public - $8.NamingStyle = PascalCase - $8.IncludeInstanceMembers = True - $8.IncludeStaticEntities = True - $9.Name = Interfaces - $9.RequiredPrefixes = $10 - $10.String = I - $9.AffectedEntity = Interface - $9.VisibilityMask = Public - $9.NamingStyle = PascalCase - $9.IncludeInstanceMembers = True - $9.IncludeStaticEntities = True - $11.Name = Attributes - $11.RequiredSuffixes = $12 - $12.String = Attribute - $11.AffectedEntity = CustomAttributes - $11.VisibilityMask = Public - $11.NamingStyle = PascalCase - $11.IncludeInstanceMembers = True - $11.IncludeStaticEntities = True - $13.Name = Event Arguments - $13.RequiredSuffixes = $14 - $14.String = EventArgs - $13.AffectedEntity = CustomEventArgs - $13.VisibilityMask = Public - $13.NamingStyle = PascalCase - $13.IncludeInstanceMembers = True - $13.IncludeStaticEntities = True - $15.Name = Exceptions - $15.RequiredSuffixes = $16 - $16.String = Exception - $15.AffectedEntity = CustomExceptions - $15.VisibilityMask = VisibilityMask - $15.NamingStyle = PascalCase - $15.IncludeInstanceMembers = True - $15.IncludeStaticEntities = True - $17.Name = Methods - $17.AffectedEntity = Methods - $17.VisibilityMask = Protected, Public - $17.NamingStyle = PascalCase - $17.IncludeInstanceMembers = True - $17.IncludeStaticEntities = True - $18.Name = Static Readonly Fields - $18.AffectedEntity = ReadonlyField - $18.VisibilityMask = Protected, Public - $18.NamingStyle = PascalCase - $18.IncludeInstanceMembers = False - $18.IncludeStaticEntities = True - $19.Name = Fields - $19.AffectedEntity = Field - $19.VisibilityMask = Protected, Public - $19.NamingStyle = PascalCase - $19.IncludeInstanceMembers = True - $19.IncludeStaticEntities = True - $20.Name = ReadOnly Fields - $20.AffectedEntity = ReadonlyField - $20.VisibilityMask = Protected, Public - $20.NamingStyle = PascalCase - $20.IncludeInstanceMembers = True - $20.IncludeStaticEntities = False - $21.Name = Constant Fields - $21.AffectedEntity = ConstantField - $21.VisibilityMask = Protected, Public - $21.NamingStyle = PascalCase - $21.IncludeInstanceMembers = True - $21.IncludeStaticEntities = True - $22.Name = Properties - $22.AffectedEntity = Property - $22.VisibilityMask = Protected, Public - $22.NamingStyle = PascalCase - $22.IncludeInstanceMembers = True - $22.IncludeStaticEntities = True - $23.Name = Events - $23.AffectedEntity = Event - $23.VisibilityMask = Protected, Public - $23.NamingStyle = PascalCase - $23.IncludeInstanceMembers = True - $23.IncludeStaticEntities = True - $24.Name = Enum Members - $24.AffectedEntity = EnumMember - $24.VisibilityMask = VisibilityMask - $24.NamingStyle = PascalCase - $24.IncludeInstanceMembers = True - $24.IncludeStaticEntities = True - $25.Name = Parameters - $25.AffectedEntity = Parameter - $25.VisibilityMask = VisibilityMask - $25.NamingStyle = CamelCase - $25.IncludeInstanceMembers = True - $25.IncludeStaticEntities = True - $26.Name = Type Parameters - $26.RequiredPrefixes = $27 - $27.String = T - $26.AffectedEntity = TypeParameter - $26.VisibilityMask = VisibilityMask - $26.NamingStyle = PascalCase - $26.IncludeInstanceMembers = True - $26.IncludeStaticEntities = True - $0.DotNetNamingPolicy = $28 - $28.DirectoryNamespaceAssociation = None - $28.ResourceNamePolicy = FileFormatDefault - description = NLua - version = 2.x - EndGlobalSection -EndGlobal diff --git a/NLua.Net40.sln b/NLua.Net40.sln deleted file mode 100644 index 79771474a6dd2382de1a3121e9c23bc4067719c4..0000000000000000000000000000000000000000 --- a/NLua.Net40.sln +++ /dev/null @@ -1,153 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{0E28CF40-4DFA-46FE-95BB-E90648DFE6F5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLuaTest.40", "NLuaTest\NLuaTest.40.csproj", "{D5FCADFA-5047-40C2-B392-256875862920}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleTest.40", "ConsoleTest\ConsoleTest.40.csproj", "{A42D438C-34B3-4D3D-8165-8D3779FE16A7}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Applications", "Applications", "{B13128D8-A4F3-4C53-A4C6-F2EA34F527BD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.40", "Applications\LuaRunner\NLua.40.csproj", "{3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{B8664957-CB71-4F11-A4DB-59E7514BC5F3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KopiLua.Net40", "Core\KopiLua\KopiLua\KopiLua.Net40.csproj", "{E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.Net40", "Core\NLua\NLua.Net40.csproj", "{F55CABBB-4108-4A39-94E1-581FD46DC021}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeraLua.Net40", "Core\KeraLua\src\KeraLua.Net40.csproj", "{47153754-10F5-44D8-B578-F5A32B69061A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - DebugKopiLua|Any CPU = DebugKopiLua|Any CPU - Release|Any CPU = Release|Any CPU - ReleaseKopiLua|Any CPU = ReleaseKopiLua|Any CPU - Debug|x64 = Debug|x64 - Release|x64 = Release|x64 - DebugKopiLua|x64 = DebugKopiLua|x64 - ReleaseKopiLua|x64 = ReleaseKopiLua|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Debug|x64.ActiveCfg = Debug|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Debug|x64.Build.0 = Debug|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.DebugKopiLua|x64.ActiveCfg = DebugKopiLua|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.DebugKopiLua|x64.Build.0 = DebugKopiLua|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Release|Any CPU.Build.0 = Release|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Release|x64.ActiveCfg = Release|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Release|x64.Build.0 = Release|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.ReleaseKopiLua|x64.ActiveCfg = ReleaseKopiLua|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.ReleaseKopiLua|x64.Build.0 = ReleaseKopiLua|x64 - {47153754-10F5-44D8-B578-F5A32B69061A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Debug|x64.ActiveCfg = Debug|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Debug|x64.Build.0 = Debug|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.DebugKopiLua|x64.ActiveCfg = DebugKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.DebugKopiLua|x64.Build.0 = DebugKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Release|Any CPU.Build.0 = Release|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Release|x64.ActiveCfg = Release|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Release|x64.Build.0 = Release|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.ReleaseKopiLua|x64.ActiveCfg = ReleaseKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.ReleaseKopiLua|x64.Build.0 = ReleaseKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Debug|x64.ActiveCfg = Debug|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Debug|x64.Build.0 = Debug|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.DebugKopiLua|x64.ActiveCfg = DebugKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.DebugKopiLua|x64.Build.0 = DebugKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Release|Any CPU.Build.0 = Release|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Release|x64.ActiveCfg = Release|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Release|x64.Build.0 = Release|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.ReleaseKopiLua|x64.ActiveCfg = ReleaseKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.ReleaseKopiLua|x64.Build.0 = ReleaseKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Debug|x64.ActiveCfg = Debug|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Debug|x64.Build.0 = Debug|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.DebugKopiLua|x64.ActiveCfg = DebugKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.DebugKopiLua|x64.Build.0 = DebugKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Release|Any CPU.Build.0 = Release|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Release|x64.ActiveCfg = Release|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Release|x64.Build.0 = Release|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.ReleaseKopiLua|x64.ActiveCfg = ReleaseKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.ReleaseKopiLua|x64.Build.0 = ReleaseKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Debug|x64.ActiveCfg = Debug|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Debug|x64.Build.0 = Debug|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.DebugKopiLua|x64.ActiveCfg = DebugKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.DebugKopiLua|x64.Build.0 = DebugKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Release|Any CPU.Build.0 = Release|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Release|x64.ActiveCfg = Release|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Release|x64.Build.0 = Release|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.ReleaseKopiLua|x64.ActiveCfg = ReleaseKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.ReleaseKopiLua|x64.Build.0 = ReleaseKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Debug|x64.ActiveCfg = Debug|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Debug|x64.Build.0 = Debug|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.DebugKopiLua|x64.ActiveCfg = DebugKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.DebugKopiLua|x64.Build.0 = DebugKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Release|Any CPU.Build.0 = Release|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Release|x64.ActiveCfg = Release|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Release|x64.Build.0 = Release|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.ReleaseKopiLua|x64.ActiveCfg = ReleaseKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.ReleaseKopiLua|x64.Build.0 = ReleaseKopiLua|Any CPU - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {D5FCADFA-5047-40C2-B392-256875862920} = {0E28CF40-4DFA-46FE-95BB-E90648DFE6F5} - {A42D438C-34B3-4D3D-8165-8D3779FE16A7} = {0E28CF40-4DFA-46FE-95BB-E90648DFE6F5} - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5} = {B13128D8-A4F3-4C53-A4C6-F2EA34F527BD} - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8} = {B8664957-CB71-4F11-A4DB-59E7514BC5F3} - {F55CABBB-4108-4A39-94E1-581FD46DC021} = {B8664957-CB71-4F11-A4DB-59E7514BC5F3} - {47153754-10F5-44D8-B578-F5A32B69061A} = {B8664957-CB71-4F11-A4DB-59E7514BC5F3} - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = Applications\LuaRunner\NLua.40.csproj - Policies = $0 - $0.TextStylePolicy = $1 - $1.FileWidth = 120 - $1.TabsToSpaces = False - $1.inheritsSet = VisualStudio - $1.inheritsScope = text/plain - description = NLua - version = 2.x - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/NLua.Net45.sln b/NLua.Net45.sln deleted file mode 100644 index 790ff01eb557863bbf824a50fe884f709957dd92..0000000000000000000000000000000000000000 --- a/NLua.Net45.sln +++ /dev/null @@ -1,172 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -VisualStudioVersion = 12.0.30723.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{0E28CF45-4DFA-46FE-95BB-E90648DFE6F5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleTest", "ConsoleTest\ConsoleTest.csproj", "{A42D438C-34B3-4D3D-8165-8D3779FE16A7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLuaTest", "NLuaTest\NLuaTest.csproj", "{D5FCADFA-5047-40C2-B392-256875862920}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Applications", "Applications", "{B13128D8-A4F3-4C53-A4C6-F2EA34F527BD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua", "Applications\LuaRunner\NLua.csproj", "{3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{B8664957-CB71-4F11-A4DB-59E7514BC5F3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KopiLua.Net45", "Core\KopiLua\KopiLua\KopiLua.Net45.csproj", "{E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.Net45", "Core\NLua\NLua.Net45.csproj", "{F55CABBB-4108-4A39-94E1-581FD46DC021}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeraLua.Net45", "Core\KeraLua\src\KeraLua.Net45.csproj", "{47153754-10F5-44D8-B578-F5A32B69061A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - DebugKopiLua|Any CPU = DebugKopiLua|Any CPU - DebugKopiLua|x64 = DebugKopiLua|x64 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - ReleaseKopiLua|Any CPU = ReleaseKopiLua|Any CPU - ReleaseKopiLua|x64 = ReleaseKopiLua|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Debug|x64.ActiveCfg = Debug|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Debug|x64.Build.0 = Debug|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.DebugKopiLua|x64.ActiveCfg = DebugKopiLua|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.DebugKopiLua|x64.Build.0 = DebugKopiLua|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Release|Any CPU.Build.0 = Release|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Release|x64.ActiveCfg = Release|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Release|x64.Build.0 = Release|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.ReleaseKopiLua|x64.ActiveCfg = ReleaseKopiLua|x64 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.ReleaseKopiLua|x64.Build.0 = ReleaseKopiLua|x64 - {47153754-10F5-44D8-B578-F5A32B69061A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Debug|x64.ActiveCfg = Debug|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Debug|x64.Build.0 = Debug|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.DebugKopiLua|x64.ActiveCfg = DebugKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.DebugKopiLua|x64.Build.0 = DebugKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Release|Any CPU.Build.0 = Release|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Release|x64.ActiveCfg = Release|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.Release|x64.Build.0 = Release|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.ReleaseKopiLua|x64.ActiveCfg = ReleaseKopiLua|Any CPU - {47153754-10F5-44D8-B578-F5A32B69061A}.ReleaseKopiLua|x64.Build.0 = ReleaseKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Debug|x64.ActiveCfg = Debug|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Debug|x64.Build.0 = Debug|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.DebugKopiLua|x64.ActiveCfg = DebugKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.DebugKopiLua|x64.Build.0 = DebugKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Release|Any CPU.Build.0 = Release|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Release|x64.ActiveCfg = Release|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.Release|x64.Build.0 = Release|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.ReleaseKopiLua|x64.ActiveCfg = ReleaseKopiLua|Any CPU - {A42D438C-34B3-4D3D-8165-8D3779FE16A7}.ReleaseKopiLua|x64.Build.0 = ReleaseKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Debug|x64.ActiveCfg = Debug|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.DebugKopiLua|x64.ActiveCfg = DebugKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Release|Any CPU.Build.0 = Release|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.Release|x64.ActiveCfg = Release|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {D5FCADFA-5047-40C2-B392-256875862920}.ReleaseKopiLua|x64.ActiveCfg = ReleaseKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Debug|x64.ActiveCfg = Debug|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Debug|x64.Build.0 = Debug|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.DebugKopiLua|x64.ActiveCfg = DebugKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.DebugKopiLua|x64.Build.0 = DebugKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Release|Any CPU.Build.0 = Release|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Release|x64.ActiveCfg = Release|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Release|x64.Build.0 = Release|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.ReleaseKopiLua|x64.ActiveCfg = ReleaseKopiLua|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.ReleaseKopiLua|x64.Build.0 = ReleaseKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Debug|x64.ActiveCfg = Debug|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Debug|x64.Build.0 = Debug|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.DebugKopiLua|Any CPU.ActiveCfg = DebugKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.DebugKopiLua|Any CPU.Build.0 = DebugKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.DebugKopiLua|x64.ActiveCfg = DebugKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.DebugKopiLua|x64.Build.0 = DebugKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Release|Any CPU.Build.0 = Release|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Release|x64.ActiveCfg = Release|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Release|x64.Build.0 = Release|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.ReleaseKopiLua|Any CPU.ActiveCfg = ReleaseKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.ReleaseKopiLua|Any CPU.Build.0 = ReleaseKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.ReleaseKopiLua|x64.ActiveCfg = ReleaseKopiLua|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.ReleaseKopiLua|x64.Build.0 = ReleaseKopiLua|Any CPU - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {A42D438C-34B3-4D3D-8165-8D3779FE16A7} = {0E28CF45-4DFA-46FE-95BB-E90648DFE6F5} - {D5FCADFA-5047-40C2-B392-256875862920} = {0E28CF45-4DFA-46FE-95BB-E90648DFE6F5} - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5} = {B13128D8-A4F3-4C53-A4C6-F2EA34F527BD} - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8} = {B8664957-CB71-4F11-A4DB-59E7514BC5F3} - {F55CABBB-4108-4A39-94E1-581FD46DC021} = {B8664957-CB71-4F11-A4DB-59E7514BC5F3} - {47153754-10F5-44D8-B578-F5A32B69061A} = {B8664957-CB71-4F11-A4DB-59E7514BC5F3} - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = ConsoleTest\ConsoleTest.csproj - Policies = $0 - $0.TextStylePolicy = $1 - $1.FileWidth = 120 - $1.TabsToSpaces = False - $1.inheritsSet = VisualStudio - $1.inheritsScope = text/plain - $0.DotNetNamingPolicy = $2 - $2.DirectoryNamespaceAssociation = None - $2.ResourceNamePolicy = FileFormatDefault - $0.TextStylePolicy = $3 - $3.FileWidth = 120 - $3.TabsToSpaces = False - $3.EolMarker = Windows - $3.inheritsSet = VisualStudio - $3.inheritsScope = text/plain - $3.scope = text/x-csharp - $0.CSharpFormattingPolicy = $4 - $4.AfterDelegateDeclarationParameterComma = True - $4.inheritsSet = Mono - $4.inheritsScope = text/x-csharp - $4.scope = text/x-csharp - $0.TextStylePolicy = $5 - $5.FileWidth = 120 - $5.TabsToSpaces = False - $5.inheritsSet = VisualStudio - $5.inheritsScope = text/plain - $5.scope = text/plain - description = NLua - version = 1.3.2 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/NLua.WP7.sln b/NLua.WP7.sln deleted file mode 100644 index 1b059748a5834505f4f1bf8959b1be4ac790bd41..0000000000000000000000000000000000000000 --- a/NLua.WP7.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 Express for Windows Phone -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.WP7", "Core\NLua\NLua.WP7.csproj", "{380F9E4E-274F-4355-90C1-D196E785F751}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KopiLua-wp7", "Core\KopiLua\KopiLua\KopiLua-wp7.csproj", "{330E0C63-4160-46E0-BBDA-325185A4AB7A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {380F9E4E-274F-4355-90C1-D196E785F751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {380F9E4E-274F-4355-90C1-D196E785F751}.Debug|Any CPU.Build.0 = Debug|Any CPU - {380F9E4E-274F-4355-90C1-D196E785F751}.Release|Any CPU.ActiveCfg = Release|Any CPU - {380F9E4E-274F-4355-90C1-D196E785F751}.Release|Any CPU.Build.0 = Release|Any CPU - {330E0C63-4160-46E0-BBDA-325185A4AB7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {330E0C63-4160-46E0-BBDA-325185A4AB7A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {330E0C63-4160-46E0-BBDA-325185A4AB7A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {330E0C63-4160-46E0-BBDA-325185A4AB7A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/NLua.WP8.sln b/NLua.WP8.sln deleted file mode 100755 index d80316c316d3cd85207d0de18576573b0ece8439..0000000000000000000000000000000000000000 --- a/NLua.WP8.sln +++ /dev/null @@ -1,88 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua52", "Core\KeraLua\external\lua\wp8_build\lua\lua52\lua52.vcxproj", "{51334677-A80F-40F7-8CFE-5DA0A92AC0C6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeraLua.WP8", "Core\KeraLua\src\WP8\KeraLua.WP8.csproj", "{1F139CCB-195B-402D-8776-7A15A3E05886}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.WP8", "Core\NLua\NLua.WP8.csproj", "{1E72B073-2154-4329-BC8D-94F19F91C945}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Debug|ARM.ActiveCfg = Debug|ARM - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Debug|ARM.Build.0 = Debug|ARM - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Debug|Win32.ActiveCfg = Debug|Win32 - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Debug|Win32.Build.0 = Debug|Win32 - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Debug|x86.ActiveCfg = Debug|Win32 - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Debug|x86.Build.0 = Debug|Win32 - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Release|Any CPU.ActiveCfg = Release|Win32 - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Release|ARM.ActiveCfg = Release|ARM - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Release|ARM.Build.0 = Release|ARM - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Release|Mixed Platforms.Build.0 = Release|Win32 - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Release|Win32.ActiveCfg = Release|Win32 - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Release|Win32.Build.0 = Release|Win32 - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Release|x86.ActiveCfg = Release|Win32 - {51334677-A80F-40F7-8CFE-5DA0A92AC0C6}.Release|x86.Build.0 = Release|Win32 - {1F139CCB-195B-402D-8776-7A15A3E05886}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F139CCB-195B-402D-8776-7A15A3E05886}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F139CCB-195B-402D-8776-7A15A3E05886}.Debug|ARM.ActiveCfg = Debug|ARM - {1F139CCB-195B-402D-8776-7A15A3E05886}.Debug|ARM.Build.0 = Debug|ARM - {1F139CCB-195B-402D-8776-7A15A3E05886}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {1F139CCB-195B-402D-8776-7A15A3E05886}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {1F139CCB-195B-402D-8776-7A15A3E05886}.Debug|Win32.ActiveCfg = Debug|x86 - {1F139CCB-195B-402D-8776-7A15A3E05886}.Debug|Win32.Build.0 = Debug|x86 - {1F139CCB-195B-402D-8776-7A15A3E05886}.Debug|x86.ActiveCfg = Debug|x86 - {1F139CCB-195B-402D-8776-7A15A3E05886}.Debug|x86.Build.0 = Debug|x86 - {1F139CCB-195B-402D-8776-7A15A3E05886}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F139CCB-195B-402D-8776-7A15A3E05886}.Release|Any CPU.Build.0 = Release|Any CPU - {1F139CCB-195B-402D-8776-7A15A3E05886}.Release|ARM.ActiveCfg = Release|ARM - {1F139CCB-195B-402D-8776-7A15A3E05886}.Release|ARM.Build.0 = Release|ARM - {1F139CCB-195B-402D-8776-7A15A3E05886}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {1F139CCB-195B-402D-8776-7A15A3E05886}.Release|Mixed Platforms.Build.0 = Release|x86 - {1F139CCB-195B-402D-8776-7A15A3E05886}.Release|Win32.ActiveCfg = Release|x86 - {1F139CCB-195B-402D-8776-7A15A3E05886}.Release|Win32.Build.0 = Release|x86 - {1F139CCB-195B-402D-8776-7A15A3E05886}.Release|x86.ActiveCfg = Release|x86 - {1F139CCB-195B-402D-8776-7A15A3E05886}.Release|x86.Build.0 = Release|x86 - {1E72B073-2154-4329-BC8D-94F19F91C945}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E72B073-2154-4329-BC8D-94F19F91C945}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E72B073-2154-4329-BC8D-94F19F91C945}.Debug|ARM.ActiveCfg = Debug|ARM - {1E72B073-2154-4329-BC8D-94F19F91C945}.Debug|ARM.Build.0 = Debug|ARM - {1E72B073-2154-4329-BC8D-94F19F91C945}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {1E72B073-2154-4329-BC8D-94F19F91C945}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {1E72B073-2154-4329-BC8D-94F19F91C945}.Debug|Win32.ActiveCfg = Debug|x86 - {1E72B073-2154-4329-BC8D-94F19F91C945}.Debug|Win32.Build.0 = Debug|x86 - {1E72B073-2154-4329-BC8D-94F19F91C945}.Debug|x86.ActiveCfg = Debug|x86 - {1E72B073-2154-4329-BC8D-94F19F91C945}.Debug|x86.Build.0 = Debug|x86 - {1E72B073-2154-4329-BC8D-94F19F91C945}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E72B073-2154-4329-BC8D-94F19F91C945}.Release|Any CPU.Build.0 = Release|Any CPU - {1E72B073-2154-4329-BC8D-94F19F91C945}.Release|ARM.ActiveCfg = Release|ARM - {1E72B073-2154-4329-BC8D-94F19F91C945}.Release|ARM.Build.0 = Release|ARM - {1E72B073-2154-4329-BC8D-94F19F91C945}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {1E72B073-2154-4329-BC8D-94F19F91C945}.Release|Mixed Platforms.Build.0 = Release|x86 - {1E72B073-2154-4329-BC8D-94F19F91C945}.Release|Win32.ActiveCfg = Release|x86 - {1E72B073-2154-4329-BC8D-94F19F91C945}.Release|Win32.Build.0 = Release|x86 - {1E72B073-2154-4329-BC8D-94F19F91C945}.Release|x86.ActiveCfg = Release|x86 - {1E72B073-2154-4329-BC8D-94F19F91C945}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/NLua.WPSL8.sln b/NLua.WPSL8.sln deleted file mode 100644 index 83124caf60683cdaf59d1d7d03c31a8e85dcfe70..0000000000000000000000000000000000000000 --- a/NLua.WPSL8.sln +++ /dev/null @@ -1,96 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.WPSL8", "Core\NLua\NLua.WPSL8.csproj", "{9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeraLua.WPSL8", "Core\KeraLua\src\WP8\KeraLua.WPSL8.csproj", "{2C343545-0778-49BB-9665-1FA656013466}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua52", "Core\KeraLua\external\lua\wpsl8_build\lua\lua52\lua52.vcxproj", "{ABD36435-56AD-4940-B51A-10AEECA46C01}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Debug|ARM.ActiveCfg = Debug|ARM - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Debug|ARM.Build.0 = Debug|ARM - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Debug|Win32.ActiveCfg = Debug|x86 - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Debug|Win32.Build.0 = Debug|x86 - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Debug|x64.ActiveCfg = Debug|Any CPU - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Debug|x86.ActiveCfg = Debug|x86 - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Debug|x86.Build.0 = Debug|x86 - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Release|Any CPU.Build.0 = Release|Any CPU - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Release|ARM.ActiveCfg = Release|ARM - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Release|ARM.Build.0 = Release|ARM - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Release|Mixed Platforms.Build.0 = Release|x86 - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Release|Win32.ActiveCfg = Release|x86 - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Release|Win32.Build.0 = Release|x86 - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Release|x64.ActiveCfg = Release|Any CPU - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Release|x86.ActiveCfg = Release|x86 - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7}.Release|x86.Build.0 = Release|x86 - {2C343545-0778-49BB-9665-1FA656013466}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2C343545-0778-49BB-9665-1FA656013466}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2C343545-0778-49BB-9665-1FA656013466}.Debug|ARM.ActiveCfg = Debug|ARM - {2C343545-0778-49BB-9665-1FA656013466}.Debug|ARM.Build.0 = Debug|ARM - {2C343545-0778-49BB-9665-1FA656013466}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {2C343545-0778-49BB-9665-1FA656013466}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {2C343545-0778-49BB-9665-1FA656013466}.Debug|Win32.ActiveCfg = Debug|x86 - {2C343545-0778-49BB-9665-1FA656013466}.Debug|Win32.Build.0 = Debug|x86 - {2C343545-0778-49BB-9665-1FA656013466}.Debug|x64.ActiveCfg = Debug|Any CPU - {2C343545-0778-49BB-9665-1FA656013466}.Debug|x86.ActiveCfg = Debug|x86 - {2C343545-0778-49BB-9665-1FA656013466}.Debug|x86.Build.0 = Debug|x86 - {2C343545-0778-49BB-9665-1FA656013466}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2C343545-0778-49BB-9665-1FA656013466}.Release|Any CPU.Build.0 = Release|Any CPU - {2C343545-0778-49BB-9665-1FA656013466}.Release|ARM.ActiveCfg = Release|ARM - {2C343545-0778-49BB-9665-1FA656013466}.Release|ARM.Build.0 = Release|ARM - {2C343545-0778-49BB-9665-1FA656013466}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {2C343545-0778-49BB-9665-1FA656013466}.Release|Mixed Platforms.Build.0 = Release|x86 - {2C343545-0778-49BB-9665-1FA656013466}.Release|Win32.ActiveCfg = Release|x86 - {2C343545-0778-49BB-9665-1FA656013466}.Release|Win32.Build.0 = Release|x86 - {2C343545-0778-49BB-9665-1FA656013466}.Release|x64.ActiveCfg = Release|Any CPU - {2C343545-0778-49BB-9665-1FA656013466}.Release|x86.ActiveCfg = Release|x86 - {2C343545-0778-49BB-9665-1FA656013466}.Release|x86.Build.0 = Release|x86 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Debug|ARM.ActiveCfg = Debug|ARM - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Debug|ARM.Build.0 = Debug|ARM - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Debug|Win32.ActiveCfg = Debug|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Debug|Win32.Build.0 = Debug|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Debug|x64.ActiveCfg = Debug|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Debug|x86.ActiveCfg = Debug|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Debug|x86.Build.0 = Debug|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Release|Any CPU.ActiveCfg = Release|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Release|ARM.ActiveCfg = Release|ARM - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Release|ARM.Build.0 = Release|ARM - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Release|Mixed Platforms.Build.0 = Release|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Release|Win32.ActiveCfg = Release|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Release|Win32.Build.0 = Release|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Release|x64.ActiveCfg = Release|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Release|x86.ActiveCfg = Release|Win32 - {ABD36435-56AD-4940-B51A-10AEECA46C01}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/NLua.iOS.sln b/NLua.iOS.sln deleted file mode 100644 index 074723e08f44899cbc5b46ce826ada21fdb3f36d..0000000000000000000000000000000000000000 --- a/NLua.iOS.sln +++ /dev/null @@ -1,123 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.iOS", "Core\NLua\NLua.iOS.csproj", "{7064B157-DD57-4828-94C5-CA149B25CB40}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KopiLua.iOS", "Core\KopiLua\KopiLua\KopiLua.iOS.csproj", "{44DA9778-C0B0-4C6F-8617-79BA2E0F1361}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeraLua.iOS", "Core\KeraLua\src\KeraLua.iOS.csproj", "{3F57C208-AA13-4B67-B3E7-ED41307F00A0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLuaTest", "ios\NLuaTestsiOS\NLuaTest.csproj", "{2DC0E43A-21B8-41FF-8793-60AB50350977}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Ad-Hoc|Any CPU = Ad-Hoc|Any CPU - Ad-Hoc|iPhone = Ad-Hoc|iPhone - Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator - AppStore|Any CPU = AppStore|Any CPU - AppStore|iPhone = AppStore|iPhone - AppStore|iPhoneSimulator = AppStore|iPhoneSimulator - Debug|Any CPU = Debug|Any CPU - Debug|iPhone = Debug|iPhone - Debug|iPhoneSimulator = Debug|iPhoneSimulator - Release|Any CPU = Release|Any CPU - Release|iPhone = Release|iPhone - Release|iPhoneSimulator = Release|iPhoneSimulator - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977}.AppStore|Any CPU.ActiveCfg = AppStore|iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977}.AppStore|iPhone.ActiveCfg = AppStore|iPhone - {2DC0E43A-21B8-41FF-8793-60AB50350977}.AppStore|iPhone.Build.0 = AppStore|iPhone - {2DC0E43A-21B8-41FF-8793-60AB50350977}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Debug|iPhone.ActiveCfg = Debug|iPhone - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Debug|iPhone.Build.0 = Debug|iPhone - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Release|Any CPU.Build.0 = Release|iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Release|iPhone.ActiveCfg = Release|iPhone - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Release|iPhone.Build.0 = Release|iPhone - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.AppStore|Any CPU.Build.0 = Debug|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.AppStore|iPhone.Build.0 = Release|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Debug|iPhone.Build.0 = Debug|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Release|Any CPU.Build.0 = Release|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Release|iPhone.ActiveCfg = Release|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Release|iPhone.Build.0 = Release|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {3F57C208-AA13-4B67-B3E7-ED41307F00A0}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.AppStore|Any CPU.Build.0 = Release|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.AppStore|iPhone.Build.0 = Debug|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Debug|Any CPU.Build.0 = Debug|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Debug|iPhone.Build.0 = Debug|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Release|Any CPU.ActiveCfg = Release|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Release|Any CPU.Build.0 = Release|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Release|iPhone.ActiveCfg = Release|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Release|iPhone.Build.0 = Release|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {44DA9778-C0B0-4C6F-8617-79BA2E0F1361}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.AppStore|Any CPU.Build.0 = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.AppStore|iPhone.Build.0 = Debug|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Debug|iPhone.Build.0 = Debug|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Release|Any CPU.Build.0 = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Release|iPhone.ActiveCfg = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Release|iPhone.Build.0 = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = ios\NLuaTestsiOS\NLuaTest.csproj - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/NLua.nuspec b/NLua.nuspec new file mode 100644 index 0000000000000000000000000000000000000000..65278faeaeb1df6dc3546947b02cb334d66dfa4d --- /dev/null +++ b/NLua.nuspec @@ -0,0 +1,41 @@ + + + + NLua + 1.4.1 + NLua + Vinicius Jarina + https://github.com/nlua/NLua/blob/master/LICENSE + https://github.com/nlua/NLua + https://raw.githubusercontent.com/nlua/NLua/master/NLua.png + false + NLua Package. + NLua allow use Lua from C#, using Windows, Linux, Mac, iOS , Android. + Release: 2bffe65 + Copyright © NLua 2019 + lua nlua + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NLua.png b/NLua.png new file mode 100644 index 0000000000000000000000000000000000000000..cc035bdf6f5199248f7f8cc78411755a631b2ddb Binary files /dev/null and b/NLua.png differ diff --git a/NLua.sln b/NLua.sln new file mode 100644 index 0000000000000000000000000000000000000000..72da5c3375f65a8b2464663dacb62aff763c3585 --- /dev/null +++ b/NLua.sln @@ -0,0 +1,164 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NLua", "NLua", "{4A43DAAC-F9FF-4EB1-BFBD-FB4655CCE1F7}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "NLua.Shared", "src\NLua.Shared.shproj", "{BD205AD6-760E-48F3-BAB2-21447396BD17}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{BDBA9844-3BD3-436C-AB8A-8E78C810A710}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua", "build\net45\NLua.csproj", "{C45805A8-6436-4738-BD9F-4632EEA63BBC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLuaTest", "tests\build\net45\NLuaTest.csproj", "{20AE709C-FB97-48E3-89B0-A34A5C3DA1DB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NLua.NetCore", "build\netcore\NLua.NetCore.csproj", "{A1944148-0AD8-4DEF-A245-60C7A8AE8AA7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NLua.netstandard2.0", "build\netstandard2.0\NLua.netstandard2.0.csproj", "{6784E262-4845-4B08-8AD1-6319E76AF579}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.Android", "build\Android\NLua.Android.csproj", "{4B766E88-5872-4437-882D-C887A3C0CDF7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.XamariniOS", "build\XamariniOS\NLua.XamariniOS.csproj", "{8FAFDF62-E07E-487A-863C-74F308AE7BA6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.TVOS", "build\TVOS\NLua.TVOS.csproj", "{9238F6AA-2D63-4804-99D1-C279871F5669}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.WatchOS", "build\WatchOS\NLua.WatchOS.csproj", "{BF6A650F-AA7A-4A08-8ADA-08D9E73E1238}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLua.XamarinMac", "build\XamarinMac\NLua.XamarinMac.csproj", "{CFE2185E-C344-4503-9B94-9046744CEF37}" +EndProject +Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + src\NLua.Core.projitems*{4b766e88-5872-4437-882d-c887a3c0cdf7}*SharedItemsImports = 4 + src\NLua.Core.projitems*{8fafdf62-e07e-487a-863c-74f308ae7ba6}*SharedItemsImports = 4 + src\NLua.Core.projitems*{9238f6aa-2d63-4804-99d1-c279871f5669}*SharedItemsImports = 4 + src\NLua.Core.projitems*{bd205ad6-760e-48f3-bab2-21447396bd17}*SharedItemsImports = 13 + src\NLua.Core.projitems*{bf6a650f-aa7a-4a08-8ada-08d9e73e1238}*SharedItemsImports = 4 + src\NLua.Core.projitems*{c45805a8-6436-4738-bd9f-4632eea63bbc}*SharedItemsImports = 4 + src\NLua.Core.projitems*{cfe2185e-c344-4503-9b94-9046744cef37}*SharedItemsImports = 4 + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + DebugAndroid|Any CPU = DebugAndroid|Any CPU + DebugCore|Any CPU = DebugCore|Any CPU + DebugMac|Any CPU = DebugMac|Any CPU + Release|Any CPU = Release|Any CPU + ReleaseAndroid|Any CPU = ReleaseAndroid|Any CPU + ReleaseCore|Any CPU = ReleaseCore|Any CPU + ReleaseMac|Any CPU = ReleaseMac|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C45805A8-6436-4738-BD9F-4632EEA63BBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C45805A8-6436-4738-BD9F-4632EEA63BBC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C45805A8-6436-4738-BD9F-4632EEA63BBC}.DebugAndroid|Any CPU.ActiveCfg = Debug|Any CPU + {C45805A8-6436-4738-BD9F-4632EEA63BBC}.DebugCore|Any CPU.ActiveCfg = Debug|Any CPU + {C45805A8-6436-4738-BD9F-4632EEA63BBC}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {C45805A8-6436-4738-BD9F-4632EEA63BBC}.DebugMac|Any CPU.Build.0 = Debug|Any CPU + {C45805A8-6436-4738-BD9F-4632EEA63BBC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C45805A8-6436-4738-BD9F-4632EEA63BBC}.Release|Any CPU.Build.0 = Release|Any CPU + {C45805A8-6436-4738-BD9F-4632EEA63BBC}.ReleaseAndroid|Any CPU.ActiveCfg = Release|Any CPU + {C45805A8-6436-4738-BD9F-4632EEA63BBC}.ReleaseCore|Any CPU.ActiveCfg = Release|Any CPU + {C45805A8-6436-4738-BD9F-4632EEA63BBC}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {C45805A8-6436-4738-BD9F-4632EEA63BBC}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB}.DebugAndroid|Any CPU.ActiveCfg = Debug|Any CPU + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB}.DebugCore|Any CPU.ActiveCfg = Debug|Any CPU + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB}.DebugMac|Any CPU.Build.0 = Debug|Any CPU + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB}.Release|Any CPU.Build.0 = Release|Any CPU + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB}.ReleaseAndroid|Any CPU.ActiveCfg = Release|Any CPU + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB}.ReleaseCore|Any CPU.ActiveCfg = Release|Any CPU + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU + {A1944148-0AD8-4DEF-A245-60C7A8AE8AA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1944148-0AD8-4DEF-A245-60C7A8AE8AA7}.DebugAndroid|Any CPU.ActiveCfg = Debug|Any CPU + {A1944148-0AD8-4DEF-A245-60C7A8AE8AA7}.DebugCore|Any CPU.ActiveCfg = Debug|Any CPU + {A1944148-0AD8-4DEF-A245-60C7A8AE8AA7}.DebugCore|Any CPU.Build.0 = Debug|Any CPU + {A1944148-0AD8-4DEF-A245-60C7A8AE8AA7}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {A1944148-0AD8-4DEF-A245-60C7A8AE8AA7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1944148-0AD8-4DEF-A245-60C7A8AE8AA7}.ReleaseAndroid|Any CPU.ActiveCfg = Release|Any CPU + {A1944148-0AD8-4DEF-A245-60C7A8AE8AA7}.ReleaseCore|Any CPU.ActiveCfg = Release|Any CPU + {A1944148-0AD8-4DEF-A245-60C7A8AE8AA7}.ReleaseCore|Any CPU.Build.0 = Release|Any CPU + {A1944148-0AD8-4DEF-A245-60C7A8AE8AA7}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {6784E262-4845-4B08-8AD1-6319E76AF579}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6784E262-4845-4B08-8AD1-6319E76AF579}.DebugAndroid|Any CPU.ActiveCfg = Debug|Any CPU + {6784E262-4845-4B08-8AD1-6319E76AF579}.DebugCore|Any CPU.ActiveCfg = Debug|Any CPU + {6784E262-4845-4B08-8AD1-6319E76AF579}.DebugCore|Any CPU.Build.0 = Debug|Any CPU + {6784E262-4845-4B08-8AD1-6319E76AF579}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {6784E262-4845-4B08-8AD1-6319E76AF579}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6784E262-4845-4B08-8AD1-6319E76AF579}.ReleaseAndroid|Any CPU.ActiveCfg = Release|Any CPU + {6784E262-4845-4B08-8AD1-6319E76AF579}.ReleaseCore|Any CPU.ActiveCfg = Release|Any CPU + {6784E262-4845-4B08-8AD1-6319E76AF579}.ReleaseCore|Any CPU.Build.0 = Release|Any CPU + {6784E262-4845-4B08-8AD1-6319E76AF579}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {4B766E88-5872-4437-882D-C887A3C0CDF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B766E88-5872-4437-882D-C887A3C0CDF7}.DebugAndroid|Any CPU.ActiveCfg = Debug|Any CPU + {4B766E88-5872-4437-882D-C887A3C0CDF7}.DebugAndroid|Any CPU.Build.0 = Debug|Any CPU + {4B766E88-5872-4437-882D-C887A3C0CDF7}.DebugCore|Any CPU.ActiveCfg = Debug|Any CPU + {4B766E88-5872-4437-882D-C887A3C0CDF7}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {4B766E88-5872-4437-882D-C887A3C0CDF7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B766E88-5872-4437-882D-C887A3C0CDF7}.ReleaseAndroid|Any CPU.ActiveCfg = Release|Any CPU + {4B766E88-5872-4437-882D-C887A3C0CDF7}.ReleaseAndroid|Any CPU.Build.0 = Release|Any CPU + {4B766E88-5872-4437-882D-C887A3C0CDF7}.ReleaseCore|Any CPU.ActiveCfg = Release|Any CPU + {4B766E88-5872-4437-882D-C887A3C0CDF7}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {8FAFDF62-E07E-487A-863C-74F308AE7BA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8FAFDF62-E07E-487A-863C-74F308AE7BA6}.DebugAndroid|Any CPU.ActiveCfg = Debug|Any CPU + {8FAFDF62-E07E-487A-863C-74F308AE7BA6}.DebugCore|Any CPU.ActiveCfg = Debug|Any CPU + {8FAFDF62-E07E-487A-863C-74F308AE7BA6}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {8FAFDF62-E07E-487A-863C-74F308AE7BA6}.DebugMac|Any CPU.Build.0 = Debug|Any CPU + {8FAFDF62-E07E-487A-863C-74F308AE7BA6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8FAFDF62-E07E-487A-863C-74F308AE7BA6}.ReleaseAndroid|Any CPU.ActiveCfg = Release|Any CPU + {8FAFDF62-E07E-487A-863C-74F308AE7BA6}.ReleaseCore|Any CPU.ActiveCfg = Release|Any CPU + {8FAFDF62-E07E-487A-863C-74F308AE7BA6}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {8FAFDF62-E07E-487A-863C-74F308AE7BA6}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU + {9238F6AA-2D63-4804-99D1-C279871F5669}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9238F6AA-2D63-4804-99D1-C279871F5669}.DebugAndroid|Any CPU.ActiveCfg = Debug|Any CPU + {9238F6AA-2D63-4804-99D1-C279871F5669}.DebugCore|Any CPU.ActiveCfg = Debug|Any CPU + {9238F6AA-2D63-4804-99D1-C279871F5669}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {9238F6AA-2D63-4804-99D1-C279871F5669}.DebugMac|Any CPU.Build.0 = Debug|Any CPU + {9238F6AA-2D63-4804-99D1-C279871F5669}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9238F6AA-2D63-4804-99D1-C279871F5669}.ReleaseAndroid|Any CPU.ActiveCfg = Release|Any CPU + {9238F6AA-2D63-4804-99D1-C279871F5669}.ReleaseCore|Any CPU.ActiveCfg = Release|Any CPU + {9238F6AA-2D63-4804-99D1-C279871F5669}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {9238F6AA-2D63-4804-99D1-C279871F5669}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU + {BF6A650F-AA7A-4A08-8ADA-08D9E73E1238}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BF6A650F-AA7A-4A08-8ADA-08D9E73E1238}.DebugAndroid|Any CPU.ActiveCfg = Debug|Any CPU + {BF6A650F-AA7A-4A08-8ADA-08D9E73E1238}.DebugCore|Any CPU.ActiveCfg = Debug|Any CPU + {BF6A650F-AA7A-4A08-8ADA-08D9E73E1238}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {BF6A650F-AA7A-4A08-8ADA-08D9E73E1238}.DebugMac|Any CPU.Build.0 = Debug|Any CPU + {BF6A650F-AA7A-4A08-8ADA-08D9E73E1238}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BF6A650F-AA7A-4A08-8ADA-08D9E73E1238}.ReleaseAndroid|Any CPU.ActiveCfg = Release|Any CPU + {BF6A650F-AA7A-4A08-8ADA-08D9E73E1238}.ReleaseCore|Any CPU.ActiveCfg = Release|Any CPU + {BF6A650F-AA7A-4A08-8ADA-08D9E73E1238}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {BF6A650F-AA7A-4A08-8ADA-08D9E73E1238}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU + {CFE2185E-C344-4503-9B94-9046744CEF37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFE2185E-C344-4503-9B94-9046744CEF37}.DebugAndroid|Any CPU.ActiveCfg = Debug|Any CPU + {CFE2185E-C344-4503-9B94-9046744CEF37}.DebugCore|Any CPU.ActiveCfg = Debug|Any CPU + {CFE2185E-C344-4503-9B94-9046744CEF37}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {CFE2185E-C344-4503-9B94-9046744CEF37}.DebugMac|Any CPU.Build.0 = Debug|Any CPU + {CFE2185E-C344-4503-9B94-9046744CEF37}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFE2185E-C344-4503-9B94-9046744CEF37}.ReleaseAndroid|Any CPU.ActiveCfg = Release|Any CPU + {CFE2185E-C344-4503-9B94-9046744CEF37}.ReleaseCore|Any CPU.ActiveCfg = Release|Any CPU + {CFE2185E-C344-4503-9B94-9046744CEF37}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {CFE2185E-C344-4503-9B94-9046744CEF37}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {BD205AD6-760E-48F3-BAB2-21447396BD17} = {4A43DAAC-F9FF-4EB1-BFBD-FB4655CCE1F7} + {C45805A8-6436-4738-BD9F-4632EEA63BBC} = {4A43DAAC-F9FF-4EB1-BFBD-FB4655CCE1F7} + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB} = {BDBA9844-3BD3-436C-AB8A-8E78C810A710} + {A1944148-0AD8-4DEF-A245-60C7A8AE8AA7} = {4A43DAAC-F9FF-4EB1-BFBD-FB4655CCE1F7} + {6784E262-4845-4B08-8AD1-6319E76AF579} = {4A43DAAC-F9FF-4EB1-BFBD-FB4655CCE1F7} + {4B766E88-5872-4437-882D-C887A3C0CDF7} = {4A43DAAC-F9FF-4EB1-BFBD-FB4655CCE1F7} + {8FAFDF62-E07E-487A-863C-74F308AE7BA6} = {4A43DAAC-F9FF-4EB1-BFBD-FB4655CCE1F7} + {9238F6AA-2D63-4804-99D1-C279871F5669} = {4A43DAAC-F9FF-4EB1-BFBD-FB4655CCE1F7} + {BF6A650F-AA7A-4A08-8ADA-08D9E73E1238} = {4A43DAAC-F9FF-4EB1-BFBD-FB4655CCE1F7} + {CFE2185E-C344-4503-9B94-9046744CEF37} = {4A43DAAC-F9FF-4EB1-BFBD-FB4655CCE1F7} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4720E610-698B-48DD-BBD7-03AC99E9BC90} + EndGlobalSection +EndGlobal diff --git a/NLua.sln.DotSettings.user b/NLua.sln.DotSettings.user new file mode 100644 index 0000000000000000000000000000000000000000..883fa02ceab080d035ba5e9702defe142db7d315 --- /dev/null +++ b/NLua.sln.DotSettings.user @@ -0,0 +1,11 @@ + + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="False" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + True \ No newline at end of file diff --git a/NLua.snk b/NLua.snk new file mode 100644 index 0000000000000000000000000000000000000000..13116fb6125f4949c71b062396374b5442936bf1 Binary files /dev/null and b/NLua.snk differ diff --git a/NLuaTest.WP8/App.xaml b/NLuaTest.WP8/App.xaml deleted file mode 100644 index 7f3068458589264a512b3860262fc5a257ba6b10..0000000000000000000000000000000000000000 --- a/NLuaTest.WP8/App.xaml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/NLuaTest.WP8/App.xaml.cs b/NLuaTest.WP8/App.xaml.cs deleted file mode 100644 index af8bfbcdebbff510f7c05bc3d402ddd37ec1e13d..0000000000000000000000000000000000000000 --- a/NLuaTest.WP8/App.xaml.cs +++ /dev/null @@ -1,221 +0,0 @@ -using System; -using System.Diagnostics; -using System.Resources; -using System.Windows; -using System.Windows.Markup; -using System.Windows.Navigation; -using Microsoft.Phone.Controls; -using Microsoft.Phone.Shell; - - -namespace NLuaTest -{ - public partial class App : Application - { - /// - /// Provides easy access to the root frame of the Phone Application. - /// - /// The root frame of the Phone Application. - public static PhoneApplicationFrame RootFrame { get; private set; } - - /// - /// Constructor for the Application object. - /// - public App() - { - // Global handler for uncaught exceptions. - UnhandledException += Application_UnhandledException; - - // Standard XAML initialization - // InitializeComponent(); - - // Phone-specific initialization - InitializePhoneApplication(); - - // Language display initialization - InitializeLanguage(); - - // Show graphics profiling information while debugging. - if (Debugger.IsAttached) - { - // Display the current frame rate counters. - Application.Current.Host.Settings.EnableFrameRateCounter = true; - - // Show the areas of the app that are being redrawn in each frame. - //Application.Current.Host.Settings.EnableRedrawRegions = true; - - // Enable non-production analysis visualization mode, - // which shows areas of a page that are handed off to GPU with a colored overlay. - //Application.Current.Host.Settings.EnableCacheVisualization = true; - - // Prevent the screen from turning off while under the debugger by disabling - // the application's idle detection. - // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run - // and consume battery power when the user is not using the phone. - PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; - } - - } - - // Code to execute when the application is launching (eg, from Start) - // This code will not execute when the application is reactivated - private void Application_Launching(object sender, LaunchingEventArgs e) - { - } - - // Code to execute when the application is activated (brought to foreground) - // This code will not execute when the application is first launched - private void Application_Activated(object sender, ActivatedEventArgs e) - { - } - - // Code to execute when the application is deactivated (sent to background) - // This code will not execute when the application is closing - private void Application_Deactivated(object sender, DeactivatedEventArgs e) - { - } - - // Code to execute when the application is closing (eg, user hit Back) - // This code will not execute when the application is deactivated - private void Application_Closing(object sender, ClosingEventArgs e) - { - } - - // Code to execute if a navigation fails - private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) - { - if (Debugger.IsAttached) - { - // A navigation has failed; break into the debugger - Debugger.Break(); - } - } - - // Code to execute on Unhandled Exceptions - private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - if (Debugger.IsAttached) - { - // An unhandled exception has occurred; break into the debugger - Debugger.Break(); - } - } - - #region Phone application initialization - - // Avoid double-initialization - private bool phoneApplicationInitialized = false; - - // Do not add any additional code to this method - private void InitializePhoneApplication() - { - if (phoneApplicationInitialized) - return; - - // Create the frame but don't set it as RootVisual yet; this allows the splash - // screen to remain active until the application is ready to render. - RootFrame = new PhoneApplicationFrame(); - RootFrame.Navigated += CompleteInitializePhoneApplication; - - // Handle navigation failures - RootFrame.NavigationFailed += RootFrame_NavigationFailed; - - // Handle reset requests for clearing the backstack - RootFrame.Navigated += CheckForResetNavigation; - - // Ensure we don't initialize again - phoneApplicationInitialized = true; - } - - // Do not add any additional code to this method - private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) - { - // Set the root visual to allow the application to render - if (RootVisual != RootFrame) - RootVisual = RootFrame; - - // Remove this handler since it is no longer needed - RootFrame.Navigated -= CompleteInitializePhoneApplication; - } - - private void CheckForResetNavigation(object sender, NavigationEventArgs e) - { - // If the app has received a 'reset' navigation, then we need to check - // on the next navigation to see if the page stack should be reset - if (e.NavigationMode == NavigationMode.Reset) - RootFrame.Navigated += ClearBackStackAfterReset; - } - - private void ClearBackStackAfterReset(object sender, NavigationEventArgs e) - { - // Unregister the event so it doesn't get called again - RootFrame.Navigated -= ClearBackStackAfterReset; - - // Only clear the stack for 'new' (forward) and 'refresh' navigations - if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh) - return; - - // For UI consistency, clear the entire page stack - while (RootFrame.RemoveBackEntry() != null) - { - ; // do nothing - } - } - - #endregion - - // Initialize the app's font and flow direction as defined in its localized resource strings. - // - // To ensure that the font of your application is aligned with its supported languages and that the - // FlowDirection for each of those languages follows its traditional direction, ResourceLanguage - // and ResourceFlowDirection should be initialized in each resx file to match these values with that - // file's culture. For example: - // - // AppResources.es-ES.resx - // ResourceLanguage's value should be "es-ES" - // ResourceFlowDirection's value should be "LeftToRight" - // - // AppResources.ar-SA.resx - // ResourceLanguage's value should be "ar-SA" - // ResourceFlowDirection's value should be "RightToLeft" - // - // For more info on localizing Windows Phone apps see http://go.microsoft.com/fwlink/?LinkId=262072. - // - private void InitializeLanguage() - { - try - { - // Set the font to match the display language defined by the - // ResourceLanguage resource string for each supported language. - // - // Fall back to the font of the neutral language if the Display - // language of the phone is not supported. - // - // If a compiler error is hit then ResourceLanguage is missing from - // the resource file. - - // Set the FlowDirection of all elements under the root frame based - // on the ResourceFlowDirection resource string for each - // supported language. - // - // If a compiler error is hit then ResourceFlowDirection is missing from - // the resource file. - - } - catch - { - // If an exception is caught here it is most likely due to either - // ResourceLangauge not being correctly set to a supported language - // code or ResourceFlowDirection is set to a value other than LeftToRight - // or RightToLeft. - - if (Debugger.IsAttached) - { - Debugger.Break(); - } - - throw; - } - } - } -} \ No newline at end of file diff --git a/NLuaTest.WP8/Assets/AlignmentGrid.png b/NLuaTest.WP8/Assets/AlignmentGrid.png deleted file mode 100644 index f7d2e97804e451530960b57429a2b0a26c86f5d7..0000000000000000000000000000000000000000 Binary files a/NLuaTest.WP8/Assets/AlignmentGrid.png and /dev/null differ diff --git a/NLuaTest.WP8/Assets/ApplicationIcon.png b/NLuaTest.WP8/Assets/ApplicationIcon.png deleted file mode 100644 index 7d95d4e0810f4a4c85b5bb631ddd4d3a6be24ca7..0000000000000000000000000000000000000000 Binary files a/NLuaTest.WP8/Assets/ApplicationIcon.png and /dev/null differ diff --git a/NLuaTest.WP8/Assets/Tiles/FlipCycleTileLarge.png b/NLuaTest.WP8/Assets/Tiles/FlipCycleTileLarge.png deleted file mode 100644 index e0c59ac014604b803533ef2debb7c10874a2f607..0000000000000000000000000000000000000000 Binary files a/NLuaTest.WP8/Assets/Tiles/FlipCycleTileLarge.png and /dev/null differ diff --git a/NLuaTest.WP8/Assets/Tiles/FlipCycleTileMedium.png b/NLuaTest.WP8/Assets/Tiles/FlipCycleTileMedium.png deleted file mode 100644 index e93b89d600641c9d5b05f94493a9fde6afa850e8..0000000000000000000000000000000000000000 Binary files a/NLuaTest.WP8/Assets/Tiles/FlipCycleTileMedium.png and /dev/null differ diff --git a/NLuaTest.WP8/Assets/Tiles/FlipCycleTileSmall.png b/NLuaTest.WP8/Assets/Tiles/FlipCycleTileSmall.png deleted file mode 100644 index 550b1b5e8d003a61a751d27fc699c5931af855c0..0000000000000000000000000000000000000000 Binary files a/NLuaTest.WP8/Assets/Tiles/FlipCycleTileSmall.png and /dev/null differ diff --git a/NLuaTest.WP8/LocalizedStrings.cs b/NLuaTest.WP8/LocalizedStrings.cs deleted file mode 100644 index c502780b762d403059b2100760712fbfaaf6ed05..0000000000000000000000000000000000000000 --- a/NLuaTest.WP8/LocalizedStrings.cs +++ /dev/null @@ -1,12 +0,0 @@ - - -namespace NLuaTest -{ - /// - /// Provides access to string resources. - /// - public class LocalizedStrings - { - - } -} \ No newline at end of file diff --git a/NLuaTest.WP8/MainPage.xaml b/NLuaTest.WP8/MainPage.xaml deleted file mode 100644 index 53eb00d4ab11db1fce7d78cabd6a6c097153188d..0000000000000000000000000000000000000000 --- a/NLuaTest.WP8/MainPage.xaml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/NLuaTest.WP8/MainPage.xaml.cs b/NLuaTest.WP8/MainPage.xaml.cs deleted file mode 100644 index 76ee2c8fcf0ba25329097b3deebad03678fbf6a8..0000000000000000000000000000000000000000 --- a/NLuaTest.WP8/MainPage.xaml.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Navigation; -using Microsoft.Phone.Controls; -using Microsoft.Phone.Shell; -using System.Threading; -using Microsoft.VisualStudio.TestPlatform.Core; -using vstest_executionengine_platformbridge; -using Microsoft.VisualStudio.TestPlatform.TestExecutor; -using System.Reflection; - -namespace NLuaTest -{ - public partial class MainPage : PhoneApplicationPage - { - // Constructor - public MainPage() - { - // InitializeComponent(); - - var wrapper = new TestExecutorServiceWrapper(); - new Thread(new ServiceMain((param0, param1) => wrapper.SendMessage((ContractName)param0, param1)).Run).Start(); - - } - } -} \ No newline at end of file diff --git a/NLuaTest.WP8/NLuaTest.WP8.csproj b/NLuaTest.WP8/NLuaTest.WP8.csproj deleted file mode 100644 index 740fd42e0165d496bc298ea46abc7fe69458b43d..0000000000000000000000000000000000000000 --- a/NLuaTest.WP8/NLuaTest.WP8.csproj +++ /dev/null @@ -1,167 +0,0 @@ - - - - Debug - x86 - 10.0.20506 - 2.0 - {0AF57940-43F8-492B-9684-0369259C990B} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - NLuaTest - NLuaTest - WindowsPhone - v8.0 - $(TargetFrameworkVersion) - true - true - - - true - true - TestApp1_$(Configuration)_$(Platform).xap - Properties\AppManifest.xml - TestApp1.App - false - 11.0 - true - - - true - full - false - Bin\x86\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\x86\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - true - full - false - Bin\ARM\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\ARM\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - - LoadFileTests.cs - - - Core.cs - - - Entity.cs - - - LuaTests.cs - - - TestLua.cs - - - App.xaml - - - - MainPage.xaml - - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - Resources\test.lua - PreserveNewest - - - - Designer - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - {ABD36435-56AD-4940-B51A-10AEECA46C01} - lua52 - - - {2C343545-0778-49BB-9665-1FA656013466} - KeraLua.WP8 - - - {9F7E0FFB-FC0E-485B-A1E8-FE04A94E40E7} - NLua.WP8 - - - - - MSTest for Managed Projects - - - Microsoft Visual Studio Windows Phone Test Core - - - - - - - - - - \ No newline at end of file diff --git a/NLuaTest.WP8/Properties/AppManifest.xml b/NLuaTest.WP8/Properties/AppManifest.xml deleted file mode 100644 index 6712a117839325b3d857001847396798160b3a6f..0000000000000000000000000000000000000000 --- a/NLuaTest.WP8/Properties/AppManifest.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/NLuaTest.WP8/Properties/WMAppManifest.xml b/NLuaTest.WP8/Properties/WMAppManifest.xml deleted file mode 100644 index b450c477168ba7c4989967bc617d49e0b1ef93b1..0000000000000000000000000000000000000000 --- a/NLuaTest.WP8/Properties/WMAppManifest.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - Assets\ApplicationIcon.png - - - - - - - - - - - - - - Assets\Tiles\FlipCycleTileSmall.png - 0 - Assets\Tiles\FlipCycleTileMedium.png - TestApp1 - - - - - - - - - - - vstest_executionengine_platformbridge.dll - - - - - - - - - - - - \ No newline at end of file diff --git a/NLuaTest/AAACodeGenTests.cs b/NLuaTest/AAACodeGenTests.cs deleted file mode 100644 index 7e9f22f2a7421e12e4abdcc31e70f7fc2dd9419e..0000000000000000000000000000000000000000 --- a/NLuaTest/AAACodeGenTests.cs +++ /dev/null @@ -1,192 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using NUnit.Framework; -using NLuaTest.Mock; -using System.Reflection; -using System.Threading; -using NLua; -using NLua.Exceptions; - - -namespace NLuaTest -{ - [TestFixture] - public class AAACodeGenTests - { - /* - * Tests passing a Lua function to a delegate - * with value-type arguments - */ - [Test] - public void LuaDelegateValueTypes () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x,y) return x+y; end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callDelegate1(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("delegate returned: "+a); - } - } - /* - * Tests passing a Lua function to a delegate - * with value-type arguments and out params - */ - [Test] - public void LuaDelegateValueTypesOutParam () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x) return x,x*2; end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callDelegate2(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (6, a); - //Console.WriteLine("delegate returned: "+a); - } - } - /* - * Tests passing a Lua function to a delegate - * with value-type arguments and ref params - */ - [Test] - public void LuaDelegateValueTypesByRefParam () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x,y) return x+y; end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callDelegate3(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("delegate returned: "+a); - } - } - /* - * Tests passing a Lua function to a delegate - * with value-type arguments that returns a reference type - */ - [Test] - public void LuaDelegateValueTypesReturnReferenceType () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x,y) return TestClass(x+y); end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callDelegate4(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("delegate returned: "+a); - } - } - /* - * Tests passing a Lua function to a delegate - * with reference type arguments - */ - [Test] - public void LuaDelegateReferenceTypes () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x,y) return x.testval+y.testval; end"); - lua.DoString ("a=test:callDelegate5(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("delegate returned: "+a); - } - } - /* - * Tests passing a Lua function to a delegate - * with reference type arguments and an out param - */ - [Test] - public void LuaDelegateReferenceTypesOutParam () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x) return x,TestClass(x*2); end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callDelegate6(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (6, a); - //Console.WriteLine("delegate returned: "+a); - } - } - /* - * Tests passing a Lua function to a delegate - * with reference type arguments and a ref param - */ - [Test] - public void LuaDelegateReferenceTypesByRefParam () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x,y) return TestClass(x+y.testval); end"); - lua.DoString ("a=test:callDelegate7(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("delegate returned: "+a); - } - } - - - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with value-type params - */ - [Test] - public void NLuaAAValueTypes () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("itest={}"); - lua.DoString ("function itest:test1(x,y) return x+y; end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callInterface1(itest)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("interface returned: "+a); - } - } - - /* - * Tests making an object from a Lua table and calling the base - * class version of one of the methods the table overrides. - */ - [Test] - public void LuaTableBaseMethod () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test={}"); - lua.DoString ("function test:overridableMethod(x,y) print(self[base]); return 6 end"); - lua.DoString ("luanet.make_object(test,'NLuaTest.Mock.TestClass')"); - lua.DoString ("a=TestClass.callOverridable(test,2,3)"); - int a = (int)lua.GetNumber ("a"); - lua.DoString ("luanet.free_object(test)"); - Assert.AreEqual (6, a); - } - } - } -} - diff --git a/NLuaTest/LoadFileTests.cs b/NLuaTest/LoadFileTests.cs deleted file mode 100755 index 0f4f9e35401d244dff12d245e74e7bf652ab2a2f..0000000000000000000000000000000000000000 --- a/NLuaTest/LoadFileTests.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using NLua; - -using NLuaTest.Mock; - -#if WINDOWS_PHONE -using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; -using SetUp = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestInitializeAttribute; -using TearDown = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestCleanupAttribute; -using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute; -using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute; -#else -using NUnit.Framework; -#endif - -#if MONOTOUCH -using Foundation; -using MonoTouch; -#endif - -namespace LoadFileTests -{ - [TestFixture] - #if MONOTOUCH - [Preserve (AllMembers = true)] - #endif - public class LoadLuaFile - { - /* - * Tests capturing an exception - */ - [Test] - public void TestLoadFile () - { - using (Lua lua = new Lua ()) { - lua.LoadCLRPackage (); - - lua.DoFile ("test.lua"); - - int width = (int)(double)lua ["width"]; - int height = (int)(double)lua ["height"]; - string message = (string)lua ["message"]; - int color_g = (int)(double)lua ["color.g"]; - LuaFunction func = (LuaFunction)lua ["func"]; - object[] res = func.Call (12, 34); - int x = (int)(double)res [0]; - int y = (int)(double)res [1]; - //function func(x,y) - // return x,x+y - //end - - Assert.AreEqual (100, width); - Assert.AreEqual (200, height); - Assert.AreEqual ("Hello World!", message); - Assert.AreEqual (20, color_g); - Assert.AreEqual (12, x); - Assert.AreEqual (46, y); - } - } - - - [Test] - public void TestBinaryLoadFile () - { - using (Lua lua = new Lua ()) { - lua.LoadCLRPackage (); - if (IntPtr.Size == 4) - lua.DoFile ("test_32.luac"); - else - lua.DoFile ("test_64.luac"); - - int width = (int)(double)lua ["width"]; - int height = (int)(double)lua ["height"]; - string message = (string)lua ["message"]; - int color_g = (int)(double)lua ["color.g"]; - LuaFunction func = (LuaFunction)lua ["func"]; - object[] res = func.Call (12, 34); - int x = (int)(double)res [0]; - int y = (int)(double)res [1]; - //function func(x,y) - // return x,x+y - //end - - Assert.AreEqual (100, width); - Assert.AreEqual (200, height); - Assert.AreEqual ("Hello World!", message); - Assert.AreEqual (20, color_g); - Assert.AreEqual (12, x); - Assert.AreEqual (46, y); - } - } - } -} - diff --git a/NLuaTest/Makefile.am b/NLuaTest/Makefile.am deleted file mode 100644 index 8497a0f3abd8eefca5b6c448641dddba8721687e..0000000000000000000000000000000000000000 --- a/NLuaTest/Makefile.am +++ /dev/null @@ -1,281 +0,0 @@ - -EXTRA_DIST = - -# Warning: This is an automatically generated file, do not edit! - -if ENABLE_DEBUG -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE" -ASSEMBLY = ../tests/NLuaTest.dll -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll \ - ../Core/KopiLua/Bin/Debug/net40/KopiLua.dll \ - ../Run/Debug/net40/NLua.dll -BUILD_DIR = ../tests/ - -NLUATEST_DLL_MDB_SOURCE=../tests/NLuaTest.dll.mdb -NLUATEST_DLL_MDB=$(BUILD_DIR)/NLuaTest.dll.mdb -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../Core/KopiLua/Bin/Debug/net40/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../Core/KopiLua/Bin/Debug/net40/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb -NLUA_DLL_SOURCE=../Run/Debug/net40/NLua.dll -NLUA_DLL_MDB_SOURCE=../Run/Debug/net40/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb - -endif - -if ENABLE_DEBUGKOPILUA -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE" -ASSEMBLY = bin/DebugKopiLua/NLuaTest.dll -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../Core/KeraLua/src/bin/DebugKopiLua/KeraLua.dll \ - ../Core/KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll \ - ../Core/NLua/bin/DebugKopiLua/NLua.dll -BUILD_DIR = bin/DebugKopiLua/ - -NLUATEST_DLL_MDB_SOURCE=bin/DebugKopiLua/NLuaTest.dll.mdb -NLUATEST_DLL_MDB=$(BUILD_DIR)/NLuaTest.dll.mdb -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/DebugKopiLua/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../Core/KeraLua/src/bin/DebugKopiLua/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../Core/KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../Core/KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb -NLUA_DLL_SOURCE=../Core/NLua/bin/DebugKopiLua/NLua.dll -NLUA_DLL_MDB_SOURCE=../Core/NLua/bin/DebugKopiLua/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb - -endif - -if ENABLE_RELEASE -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:TRACE" -ASSEMBLY = ../tests/NLuaTest.dll -ASSEMBLY_MDB = -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../Core/KeraLua/src/bin/Release/net40/KeraLua.dll \ - ../Core/KopiLua/Bin/Release/net40/KopiLua.dll \ - ../Run/Release/net40/NLua.dll -BUILD_DIR = ../tests/ - -NLUATEST_DLL_MDB= -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/Release/net40/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../Core/KopiLua/Bin/Release/net40/KopiLua.dll -KOPILUA_DLL_MDB= -NLUA_DLL_SOURCE=../Run/Release/net40/NLua.dll -NLUA_DLL_MDB= - -endif - -if ENABLE_RELEASEKOPILUA -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:USE_KOPILUA" -ASSEMBLY = ../tests/NLuaTest.dll -ASSEMBLY_MDB = -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../Core/KeraLua/src/bin/ReleaseKopiLua/KeraLua.dll \ - ../Core/KopiLua/KopiLua/bin/ReleaseKopiLua/KopiLua.dll \ - ../Core/NLua/bin/ReleaseKopiLua/NLua.dll -BUILD_DIR = ../tests/ - -NLUATEST_DLL_MDB= -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/ReleaseKopiLua/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../Core/KopiLua/KopiLua/bin/ReleaseKopiLua/KopiLua.dll -KOPILUA_DLL_MDB= -NLUA_DLL_SOURCE=../Core/NLua/bin/ReleaseKopiLua/NLua.dll -NLUA_DLL_MDB= - -endif - -if ENABLE_DEBUG_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE" -ASSEMBLY = ../tests/NLuaTest.dll -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll \ - ../Core/KopiLua/Bin/Debug/net40/KopiLua.dll \ - ../Run/Debug/net40/NLua.dll -BUILD_DIR = ../tests/ - -NLUATEST_DLL_MDB_SOURCE=../tests/NLuaTest.dll.mdb -NLUATEST_DLL_MDB=$(BUILD_DIR)/NLuaTest.dll.mdb -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../Core/KeraLua/src/bin/Debug/net40/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../Core/KopiLua/Bin/Debug/net40/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../Core/KopiLua/Bin/Debug/net40/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb -NLUA_DLL_SOURCE=../Run/Debug/net40/NLua.dll -NLUA_DLL_MDB_SOURCE=../Run/Debug/net40/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb - -endif - -if ENABLE_RELEASE_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:TRACE" -ASSEMBLY = ../tests/NLuaTest.dll -ASSEMBLY_MDB = -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../Core/KeraLua/src/bin/Release/net40/KeraLua.dll \ - ../Core/KopiLua/Bin/Release/net40/KopiLua.dll \ - ../Run/Release/net40/NLua.dll -BUILD_DIR = ../tests/ - -NLUATEST_DLL_MDB= -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/Release/net40/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../Core/KopiLua/Bin/Release/net40/KopiLua.dll -KOPILUA_DLL_MDB= -NLUA_DLL_SOURCE=../Run/Release/net40/NLua.dll -NLUA_DLL_MDB= - -endif - -if ENABLE_DEBUGKOPILUA_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE" -ASSEMBLY = bin/DebugKopiLua/NLuaTest.dll -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../Core/KeraLua/src/bin/DebugKopiLua/KeraLua.dll \ - ../Core/KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll \ - ../Core/NLua/bin/DebugKopiLua/NLua.dll -BUILD_DIR = bin/DebugKopiLua/ - -NLUATEST_DLL_MDB_SOURCE=bin/DebugKopiLua/NLuaTest.dll.mdb -NLUATEST_DLL_MDB=$(BUILD_DIR)/NLuaTest.dll.mdb -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/DebugKopiLua/KeraLua.dll -KERALUA_DLL_MDB_SOURCE=../Core/KeraLua/src/bin/DebugKopiLua/KeraLua.dll.mdb -KERALUA_DLL_MDB=$(BUILD_DIR)/KeraLua.dll.mdb -KOPILUA_DLL_SOURCE=../Core/KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../Core/KopiLua/KopiLua/bin/DebugKopiLua/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb -NLUA_DLL_SOURCE=../Core/NLua/bin/DebugKopiLua/NLua.dll -NLUA_DLL_MDB_SOURCE=../Core/NLua/bin/DebugKopiLua/NLua.dll.mdb -NLUA_DLL_MDB=$(BUILD_DIR)/NLua.dll.mdb - -endif - -if ENABLE_RELEASEKOPILUA_X64 -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:USE_KOPILUA" -ASSEMBLY = ../tests/NLuaTest.dll -ASSEMBLY_MDB = -COMPILE_TARGET = library -PROJECT_REFERENCES = \ - ../Core/KeraLua/src/bin/ReleaseKopiLua/KeraLua.dll \ - ../Core/KopiLua/KopiLua/bin/ReleaseKopiLua/KopiLua.dll \ - ../Core/NLua/bin/ReleaseKopiLua/NLua.dll -BUILD_DIR = ../tests/ - -NLUATEST_DLL_MDB= -NUNIT_FRAMEWORK_DLL_SOURCE=../packages/NUnit.2.6.2/lib/nunit.framework.dll -KERALUA_DLL_SOURCE=../Core/KeraLua/src/bin/ReleaseKopiLua/KeraLua.dll -KERALUA_DLL_MDB= -KOPILUA_DLL_SOURCE=../Core/KopiLua/KopiLua/bin/ReleaseKopiLua/KopiLua.dll -KOPILUA_DLL_MDB= -NLUA_DLL_SOURCE=../Core/NLua/bin/ReleaseKopiLua/NLua.dll -NLUA_DLL_MDB= - -endif - -AL=al -SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll - -PROGRAMFILES = \ - $(NLUATEST_DLL_MDB) \ - $(NUNIT_FRAMEWORK_DLL) \ - $(KERALUA_DLL) \ - $(KERALUA_DLL_MDB) \ - $(KOPILUA_DLL) \ - $(KOPILUA_DLL_MDB) \ - $(NLUA_DLL) \ - $(NLUA_DLL_MDB) - -LINUX_PKGCONFIG = \ - $(NLUATEST_40_PC) - - -RESGEN=resgen2 - -all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) - -FILES = \ - ../tests/Entity.cs \ - ../tests/LuaTests.cs \ - ../tests/TestLua.cs \ - ../tests/Core.cs \ - LoadFileTests.cs \ - Properties/AssemblyInfo.cs \ - AAACodeGenTests.cs - -DATA_FILES = - -RESOURCES = - -EXTRAS = \ - packages.config \ - nluatest.40.pc.in - -REFERENCES = \ - System \ - System.Data \ - System.Numerics \ - System.Xml - -DLL_REFERENCES = \ - ../lib/nunit/nunit.framework.dll - -CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) - -include $(top_srcdir)/Makefile.include - -NUNIT_FRAMEWORK_DLL = $(BUILD_DIR)/nunit.framework.dll -KERALUA_DLL = $(BUILD_DIR)/KeraLua.dll -KOPILUA_DLL = $(BUILD_DIR)/KopiLua.dll -NLUA_DLL = $(BUILD_DIR)/NLua.dll -NLUATEST_40_PC = $(BUILD_DIR)/nluatest.40.pc - -$(eval $(call emit-deploy-target,NUNIT_FRAMEWORK_DLL)) -$(eval $(call emit-deploy-target,KERALUA_DLL)) -$(eval $(call emit-deploy-target,KERALUA_DLL_MDB)) -$(eval $(call emit-deploy-target,KOPILUA_DLL)) -$(eval $(call emit-deploy-target,KOPILUA_DLL_MDB)) -$(eval $(call emit-deploy-target,NLUA_DLL)) -$(eval $(call emit-deploy-target,NLUA_DLL_MDB)) -$(eval $(call emit-deploy-wrapper,NLUATEST_40_PC,nluatest.40.pc)) - - -$(eval $(call emit_resgen_targets)) -$(build_xamlg_list): %.xaml.g.cs: %.xaml - xamlg '$<' - -$(ASSEMBLY_MDB): $(ASSEMBLY) - -$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) - mkdir -p $(shell dirname $(ASSEMBLY)) - $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) diff --git a/NLuaTest/NLuaTest.35.csproj b/NLuaTest/NLuaTest.35.csproj deleted file mode 100755 index 180d30932d95d39d6c96240d78fe2412fc19477a..0000000000000000000000000000000000000000 --- a/NLuaTest/NLuaTest.35.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - {D5FCADFA-5047-40C2-B392-256875862920} - Library - Properties - NLuaTest - NLuaTest - 512 - 2.x - v3.5 - - - - True - full - False - ..\tests\ - TRACE;DEBUG;NET_3_5 - prompt - 4 - - - pdbonly - True - ..\tests\ - TRACE;NET_3_5 - prompt - 4 - - - true - bin\DebugKopiLua\ - TRACE;DEBUG;NET_3_5;USE_KOPILUA - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - 4 - false - - - ..\tests\ - 4 - true - NET_3_5;USE_KOPILUA - - - - - - - - ..\packages\NUnit.2.6.2\lib\nunit.framework.dll - - - - - Entity.cs - - - LuaTests.cs - - - TestLua.cs - - - Core.cs - - - - - - - - - - - {47153754-10f5-44d8-b578-f5a32b69061a} - KeraLua.Net35 - - - {e8ddbc21-ef74-4aba-9c49-bfc702be25d8} - KopiLua.Net35 - - - {f55cabbb-4108-4a39-94e1-581fd46dc021} - NLua.Net35 - - - - - \ No newline at end of file diff --git a/NLuaTest/NLuaTest.40.csproj b/NLuaTest/NLuaTest.40.csproj deleted file mode 100644 index b45f17d9aa0d4824d857a4e59cf5d498e136fd2f..0000000000000000000000000000000000000000 --- a/NLuaTest/NLuaTest.40.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - {D5FCADFA-5047-40C2-B392-256875862920} - Library - Properties - NLuaTest - NLuaTest - 512 - 2.x - v4.0 - - - - True - full - False - ..\tests\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - True - ..\tests\ - TRACE - prompt - 4 - - - true - bin\DebugKopiLua\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - 4 - false - - - ..\tests\ - 4 - true - USE_KOPILUA - - - - - - - - ..\packages\NUnit.2.6.2\lib\nunit.framework.dll - - - - - Entity.cs - - - LuaTests.cs - - - TestLua.cs - - - Core.cs - - - - - - - - {47153754-10F5-44D8-B578-F5A32B69061A} - KeraLua.Net40 - - - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8} - KopiLua.Net40 - - - {F55CABBB-4108-4A39-94E1-581FD46DC021} - NLua.Net40 - - - - - - - - \ No newline at end of file diff --git a/NLuaTest/NLuaTest.csproj b/NLuaTest/NLuaTest.csproj deleted file mode 100644 index deba93b2a75d0ba9be43f86d56a7fa9aa8ed407c..0000000000000000000000000000000000000000 --- a/NLuaTest/NLuaTest.csproj +++ /dev/null @@ -1,106 +0,0 @@ - - - - Debug - AnyCPU - {D5FCADFA-5047-40C2-B392-256875862920} - Library - Properties - NLuaTest - NLuaTest - 512 - 1.3.2 - v4.5 - - - - True - full - False - ..\tests\ - DEBUG;TRACE - prompt - 4 - false - x86 - - - pdbonly - True - ..\tests\ - TRACE - prompt - 4 - false - - - true - bin\DebugKopiLua\ - TRACE;DEBUG;USE_KOPILUA - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - 4 - false - false - - - ..\tests\ - 4 - true - false - USE_KOPILUA - - - - - - - - ..\packages\NUnit.2.6.2\lib\nunit.framework.dll - - - - - Entity.cs - - - LuaTests.cs - - - TestLua.cs - - - Core.cs - - - - - - - - - - - - - {47153754-10F5-44D8-B578-F5A32B69061A} - KeraLua.Net45 - - - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8} - KopiLua.Net45 - - - {F55CABBB-4108-4A39-94E1-581FD46DC021} - NLua.Net45 - - - \ No newline at end of file diff --git a/NLuaTest/Properties/AssemblyInfo.cs b/NLuaTest/Properties/AssemblyInfo.cs deleted file mode 100644 index 00bfdc1a1822a12df5e49119710beecb2bc351c0..0000000000000000000000000000000000000000 --- a/NLuaTest/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 ("NLuaTest")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("NLuaTest")] -[assembly: AssemblyCopyright ("Copyright © 2013")] -[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 ("eaeb5ab2-711e-46eb-955f-fbb7b581e7aa")] - -// 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/NLuaTest/nluatest.40.pc.in b/NLuaTest/nluatest.40.pc.in deleted file mode 100644 index 0c7cec196ac519cbab6a621adb582083c03ca90b..0000000000000000000000000000000000000000 --- a/NLuaTest/nluatest.40.pc.in +++ /dev/null @@ -1,6 +0,0 @@ -Name: NLuaTest.40 -Description: NLuaTest.40 -Version: 2.x - -Requires: -Libs: -r:@expanded_libdir@/@PACKAGE@/NLuaTest.dll diff --git a/NLuaTest/packages.config b/NLuaTest/packages.config deleted file mode 100755 index 617647af21e5a049f980b069e273345479fe4af8..0000000000000000000000000000000000000000 --- a/NLuaTest/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/NLuaTests.Android/Assets/AboutAssets.txt b/NLuaTests.Android/Assets/AboutAssets.txt deleted file mode 100644 index a9b0638eb1b0333e29892a9339245be20903b721..0000000000000000000000000000000000000000 --- a/NLuaTests.Android/Assets/AboutAssets.txt +++ /dev/null @@ -1,19 +0,0 @@ -Any raw assets you want to be deployed with your application can be placed in -this directory (and child directories) and given a Build Action of "AndroidAsset". - -These files will be deployed with your package and will be accessible using Android's -AssetManager, like this: - -public class ReadAsset : Activity -{ - protected override void OnCreate (Bundle bundle) - { - base.OnCreate (bundle); - - InputStream input = Assets.Open ("my_asset.txt"); - } -} - -Additionally, some Android functions will automatically load asset files: - -Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); diff --git a/NLuaTests.Android/MainActivity.cs b/NLuaTests.Android/MainActivity.cs deleted file mode 100644 index df7ba1787dd3f215440ea8072f101f3a2932b441..0000000000000000000000000000000000000000 --- a/NLuaTests.Android/MainActivity.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Reflection; -using Android.App; -using Android.OS; -using Xamarin.Android.NUnitLite; - -namespace NLuaTests.Android -{ - [Activity (Label = "NLuaTests.Android", MainLauncher = true)] - public class MainActivity : TestSuiteActivity - { - protected override void OnCreate (Bundle bundle) - { - // tests can be inside the main assembly - AddTest (Assembly.GetExecutingAssembly ()); - // or in any reference assemblies - // AddTest (typeof (Your.Library.TestClass).Assembly); - - // Once you called base.OnCreate(), you cannot add more assemblies. - base.OnCreate (bundle); - } - } -} - diff --git a/NLuaTests.Android/NLuaTest.Android.csproj b/NLuaTests.Android/NLuaTest.Android.csproj deleted file mode 100644 index 067547fa813c4289ac5959238fd5e7b8e3671420..0000000000000000000000000000000000000000 --- a/NLuaTests.Android/NLuaTest.Android.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {401B1795-0B7C-4F20-AE9D-F8685D15A825} - {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - NLuaTests.Android - True - Resources\Resource.designer.cs - Resource - Resources - Assets - NLuaTest - v4.0.3 - Properties\AndroidManifest.xml - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - None - false - armeabi,armeabi-v7a,x86 - - - full - true - bin\Release - prompt - 4 - false - false - armeabi;armeabi-v7a;x86 - - - - - - - - - - - - - - - Core.cs - - - Entity.cs - - - LuaTests.cs - - - TestLua.cs - - - - - - - - - - - - - - {92E4BB6F-130D-4EB6-9F0E-80CD213ACE81} - NLua.Android - - - {7648657A-8012-49FE-B7BF-BC90F77AD742} - KeraLua.Android - - - \ No newline at end of file diff --git a/NLuaTests.Android/Properties/AndroidManifest.xml b/NLuaTests.Android/Properties/AndroidManifest.xml deleted file mode 100644 index df18a03df7a5b5e2a789f0d491ddd69de7f819c3..0000000000000000000000000000000000000000 --- a/NLuaTests.Android/Properties/AndroidManifest.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/NLuaTests.Android/Properties/AssemblyInfo.cs b/NLuaTests.Android/Properties/AssemblyInfo.cs deleted file mode 100644 index 66990ce75eb6cf28870fe76b5e7c7b0e671d34c4..0000000000000000000000000000000000000000 --- a/NLuaTests.Android/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using Android.App; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("NLuaTests.Android")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("viniciusjarina")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("1.0.0")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/NLuaTests.Android/Resources/AboutResources.txt b/NLuaTests.Android/Resources/AboutResources.txt deleted file mode 100644 index 10f52d46021dff0e36a01c8aff6a464670c3505d..0000000000000000000000000000000000000000 --- a/NLuaTests.Android/Resources/AboutResources.txt +++ /dev/null @@ -1,44 +0,0 @@ -Images, layout descriptions, binary blobs and string dictionaries can be included -in your application as resource files. Various Android APIs are designed to -operate on the resource IDs instead of dealing with images, strings or binary blobs -directly. - -For example, a sample Android app that contains a user interface layout (main.axml), -an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) -would keep its resources in the "Resources" directory of the application: - -Resources/ - drawable/ - icon.png - - layout/ - main.axml - - values/ - strings.xml - -In order to get the build system to recognize Android resources, set the build action to -"AndroidResource". The native Android APIs do not operate directly with filenames, but -instead operate on resource IDs. When you compile an Android application that uses resources, -the build system will package the resources for distribution and generate a class called "R" -(this is an Android convention) that contains the tokens for each one of the resources -included. For example, for the above Resources layout, this is what the R class would expose: - -public class R { - public class drawable { - public const int icon = 0x123; - } - - public class layout { - public const int main = 0x456; - } - - public class strings { - public const int first_string = 0xabc; - public const int second_string = 0xbcd; - } -} - -You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main -to reference the layout/main.axml file, or R.strings.first_string to reference the first -string in the dictionary file values/strings.xml. diff --git a/NLuaTests.Android/Resources/Resource.designer.cs b/NLuaTests.Android/Resources/Resource.designer.cs deleted file mode 100644 index dc96c225b2a6eb8f4ea4a6bd0737c38b20ae9b33..0000000000000000000000000000000000000000 --- a/NLuaTests.Android/Resources/Resource.designer.cs +++ /dev/null @@ -1,175 +0,0 @@ -#pragma warning disable 1591 -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Mono Runtime Version: 4.0.30319.17020 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -[assembly: Android.Runtime.ResourceDesignerAttribute("NLuaTests.Android.Resource", IsApplication=true)] - -namespace NLuaTests.Android -{ - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] - public partial class Resource - { - - static Resource() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - public static void UpdateIdValues() - { - global::Xamarin.Android.NUnitLite.Resource.Id.OptionHostName = global::NLuaTests.Android.Resource.Id.OptionHostName; - global::Xamarin.Android.NUnitLite.Resource.Id.OptionPort = global::NLuaTests.Android.Resource.Id.OptionPort; - global::Xamarin.Android.NUnitLite.Resource.Id.OptionRemoteServer = global::NLuaTests.Android.Resource.Id.OptionRemoteServer; - global::Xamarin.Android.NUnitLite.Resource.Id.OptionsButton = global::NLuaTests.Android.Resource.Id.OptionsButton; - global::Xamarin.Android.NUnitLite.Resource.Id.ResultFullName = global::NLuaTests.Android.Resource.Id.ResultFullName; - global::Xamarin.Android.NUnitLite.Resource.Id.ResultMessage = global::NLuaTests.Android.Resource.Id.ResultMessage; - global::Xamarin.Android.NUnitLite.Resource.Id.ResultResultState = global::NLuaTests.Android.Resource.Id.ResultResultState; - global::Xamarin.Android.NUnitLite.Resource.Id.ResultRunSingleMethodTest = global::NLuaTests.Android.Resource.Id.ResultRunSingleMethodTest; - global::Xamarin.Android.NUnitLite.Resource.Id.ResultStackTrace = global::NLuaTests.Android.Resource.Id.ResultStackTrace; - global::Xamarin.Android.NUnitLite.Resource.Id.ResultsFailed = global::NLuaTests.Android.Resource.Id.ResultsFailed; - global::Xamarin.Android.NUnitLite.Resource.Id.ResultsId = global::NLuaTests.Android.Resource.Id.ResultsId; - global::Xamarin.Android.NUnitLite.Resource.Id.ResultsIgnored = global::NLuaTests.Android.Resource.Id.ResultsIgnored; - global::Xamarin.Android.NUnitLite.Resource.Id.ResultsInconclusive = global::NLuaTests.Android.Resource.Id.ResultsInconclusive; - global::Xamarin.Android.NUnitLite.Resource.Id.ResultsMessage = global::NLuaTests.Android.Resource.Id.ResultsMessage; - global::Xamarin.Android.NUnitLite.Resource.Id.ResultsPassed = global::NLuaTests.Android.Resource.Id.ResultsPassed; - global::Xamarin.Android.NUnitLite.Resource.Id.ResultsResult = global::NLuaTests.Android.Resource.Id.ResultsResult; - global::Xamarin.Android.NUnitLite.Resource.Id.RunTestsButton = global::NLuaTests.Android.Resource.Id.RunTestsButton; - global::Xamarin.Android.NUnitLite.Resource.Id.TestSuiteListView = global::NLuaTests.Android.Resource.Id.TestSuiteListView; - global::Xamarin.Android.NUnitLite.Resource.Layout.options = global::NLuaTests.Android.Resource.Layout.options; - global::Xamarin.Android.NUnitLite.Resource.Layout.results = global::NLuaTests.Android.Resource.Layout.results; - global::Xamarin.Android.NUnitLite.Resource.Layout.test_result = global::NLuaTests.Android.Resource.Layout.test_result; - global::Xamarin.Android.NUnitLite.Resource.Layout.test_suite = global::NLuaTests.Android.Resource.Layout.test_suite; - } - - public partial class Attribute - { - - static Attribute() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - private Attribute() - { - } - } - - public partial class Drawable - { - - // aapt resource value: 0x7f020000 - public const int Icon = 2130837504; - - static Drawable() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - private Drawable() - { - } - } - - public partial class Id - { - - // aapt resource value: 0x7f040001 - public const int OptionHostName = 2130968577; - - // aapt resource value: 0x7f040002 - public const int OptionPort = 2130968578; - - // aapt resource value: 0x7f040000 - public const int OptionRemoteServer = 2130968576; - - // aapt resource value: 0x7f040010 - public const int OptionsButton = 2130968592; - - // aapt resource value: 0x7f04000b - public const int ResultFullName = 2130968587; - - // aapt resource value: 0x7f04000d - public const int ResultMessage = 2130968589; - - // aapt resource value: 0x7f04000c - public const int ResultResultState = 2130968588; - - // aapt resource value: 0x7f04000a - public const int ResultRunSingleMethodTest = 2130968586; - - // aapt resource value: 0x7f04000e - public const int ResultStackTrace = 2130968590; - - // aapt resource value: 0x7f040006 - public const int ResultsFailed = 2130968582; - - // aapt resource value: 0x7f040003 - public const int ResultsId = 2130968579; - - // aapt resource value: 0x7f040007 - public const int ResultsIgnored = 2130968583; - - // aapt resource value: 0x7f040008 - public const int ResultsInconclusive = 2130968584; - - // aapt resource value: 0x7f040009 - public const int ResultsMessage = 2130968585; - - // aapt resource value: 0x7f040005 - public const int ResultsPassed = 2130968581; - - // aapt resource value: 0x7f040004 - public const int ResultsResult = 2130968580; - - // aapt resource value: 0x7f04000f - public const int RunTestsButton = 2130968591; - - // aapt resource value: 0x7f040011 - public const int TestSuiteListView = 2130968593; - - static Id() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - private Id() - { - } - } - - public partial class Layout - { - - // aapt resource value: 0x7f030000 - public const int options = 2130903040; - - // aapt resource value: 0x7f030001 - public const int results = 2130903041; - - // aapt resource value: 0x7f030002 - public const int test_result = 2130903042; - - // aapt resource value: 0x7f030003 - public const int test_suite = 2130903043; - - static Layout() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - private Layout() - { - } - } - } -} -#pragma warning restore 1591 diff --git a/NLuaTests.Android/Resources/drawable/Icon.png b/NLuaTests.Android/Resources/drawable/Icon.png deleted file mode 100644 index a07c69fa5a0f4da5d5efe96eea12a543154dbab6..0000000000000000000000000000000000000000 Binary files a/NLuaTests.Android/Resources/drawable/Icon.png and /dev/null differ diff --git a/Package.ps1 b/Package.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..b0b89ea94e4370fcce6e24e9dff616a1a13e59ad --- /dev/null +++ b/Package.ps1 @@ -0,0 +1,10 @@ +param ([string] $PackageId, [string] $NuSpecFile) + +. .\BuildFunctions.ps1 + +$hash = Get-Current-Commit-Hash +$releaseNotes = "Release: $($hash)" + +Update-NuSpec-Release-Notes $NuSpecFile $releaseNotes + +& nuget pack $NuSpecFile \ No newline at end of file diff --git a/PreBuild.ps1 b/PreBuild.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..0f2f24491c224e1a39e00bed55152dec8e95d6a7 --- /dev/null +++ b/PreBuild.ps1 @@ -0,0 +1,8 @@ +param ([string] $PackageId, [string] $NuSpecFile) + +. ./BuildFunctions.ps1 + +$nextVersion = Get-Next-Version-String $PackageId + +Update-NuSpec-Version $NuSpecFile $nextVersion +gitversion /updateassemblyinfo diff --git a/ProjectsUsingNLua.md b/ProjectsUsingNLua.md deleted file mode 100644 index b1b27c6b53c479c0d891d5930c7725fc01f87d1e..0000000000000000000000000000000000000000 --- a/ProjectsUsingNLua.md +++ /dev/null @@ -1,34 +0,0 @@ -Projects Using NLua -=================== - -* https://github.com/R1cebank/AmiMat Simple tool to make simple animations -* https://github.com/motord/cottontail -* https://github.com/revcore/revcore Yulgang Emulator Revolution Core -http://revcore.meximas.com -* https://github.com/biscuitWizard/Angels_8 An interactive fiction video game based on post-cyberpunk media such as Transmetropolitan. -* https://github.com/Craftitude-Team/Craftitude New minecraft launcher allowing one-click mod installation and much more! -* https://github.com/noogai03sprojects/AerialArchitect An RTS about building floating cities. -* https://github.com/evoxalien/Lua2012 -* https://github.com/viniciusjarina/SpriteLua NLua + SpriteKit sample. -* https://github.com/codefoco/NLuaBox NLua iOS Application -* https://github.com/drew-r/Goose Runtime C# compilation and integrated Lua scripting for fun and profit. -* https://github.com/cmark89/Eglantine A spooky point-and-click adventure game. -* https://github.com/zeta0134/drunken-archer My individual project for Game Programming at TAMUCC in Spring of 2014 -* https://github.com/MasterQ32/OpenWorld.Engine A C# game engine based on OpenGL and OpenTK. -* https://github.com/nrother/dynamiclua Wrapper for NLua, making access to lua more idomatic from .NET. Heavily using the "dynamic" keyword. -* https://github.com/OpenRA/OpenRA An open-source implementation of the Red Alert engine using .NET/mono and OpenGL. Runs on Windows, Linux and Mac OS X. -http://open-ra.org -* https://github.com/TheBerkin/RNGTV Watch randomly generated TV shows with your friends. -* https://github.com/prabirshrestha/vs-erc ~/.erc for Visual Studio -* https://github.com/umby24/Hypercube Hypercube Classic Minecraft Server -* https://github.com/RustOxide/Oxide Oxide is a modding API for the game Rust. -* https://github.com/drew-r/Maverick -* https://github.com/Schumix/Schumix2 Schumix2 C# IRC Bot and Framework -http://schumix.eu -* https://github.com/bertjohnson/Multipath Video search engine and Plex channel. -http://multipath.tv -* https://github.com/Mitch528/SharpStar A Starbound proxy server with support for Javascript and Lua plugins -* https://github.com/XepicxnoobX/XepicxnoobX.xna.lib General API and Engine -* https://github.com/GregoryLand/Lorei Lorei -* https://github.com/Rush-Forward/Amarathia Amarathia is a time-travel retro 2D MMORPG inspired by Nexus TK and developed by our awesome team of game enthusiasts. -* https://github.com/okdhryk/RtcMyTask diff --git a/Publish.ps1 b/Publish.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..a1efb38f39855de45736a89d3fb2d27120187537 --- /dev/null +++ b/Publish.ps1 @@ -0,0 +1,28 @@ +param ([string] $PackageId) + +. .\BuildFunctions.ps1 + +if (-Not (Test-Should-Deploy)) { + return +} + +$nextVersion = Get-Next-Version-String $PackageId + +if (Test-Package-Already-Published $PackageId $nextVersion) { + return +} + +$versionToUnlist = "" + +if (-Not (Test-Version-Stable-Release $nextVersion)) { + $publishedVersion = Get-Published-PreRelase-Package $PackageId + if (-Not (Test-Version-Stable-Release $publishedVersion)) { + $versionToUnlist = $publishedVersion + } +} + +& nuget push *.nupkg -Source https://www.nuget.org/api/v2/package +# Unlist previous Pre-Release packages. +if ($versionToUnlist -ne "") { + & $nuget delete $versionToUnlist -Source https://www.nuget.org/api/v2/package +} \ No newline at end of file diff --git a/README.md b/README.md index fbdc3098929d30380f737dbf8f540ab3a26cdc2a..b4dfe1bfa2abd2d4d335d8040cc683be3b521351 100644 --- a/README.md +++ b/README.md @@ -1,466 +1,452 @@ -NLua -======== - - -[![Logo](https://secure.gravatar.com/avatar/77ecf0fb9d8419be7715c6e822e66562?s=150)]() - -NLua is a fork project of LuaInterface (from Fábio Mascarenhas/Craig Presti). - -[![Cmd](https://raw.github.com/NLua/NLua/master/NLuaCommand.gif)]() - -Example: using NLua from command line. - -NLua allows the usage of Lua from C#, on Windows, Linux, Mac, iOS , Android, Windows Phone 7 and 8. - -Unity3D support branch: [unity3d](https://github.com/Mervill/Unity3D-NLua) by [Riley G](https://github.com/Mervill/Unity3D-NLua). - - [1]: https://www.dropbox.com/s/w99igtc12uocq4k/NLua.OSX.zip - [2]: http://nvlabs.github.com/cub/download-icon.png (Download for OSX) - - [3]: https://www.dropbox.com/s/s3xte19719446lx/NLua.iOS.zip - [4]: http://nvlabs.github.com/cub/download-icon.png (Download for iOS) - - - [5]: https://www.dropbox.com/s/mjet2sh67e7y6xo/NLua.Android.zip - [6]: http://nvlabs.github.com/cub/download-icon.png (Download for Android) - - [7]: https://www.dropbox.com/s/jkr1pnwvqw6w0r8/NLua.Win32.zip - [8]: http://nvlabs.github.com/cub/download-icon.png (Download for Win32) - - [9]: https://www.dropbox.com/s/xraxkgi2kuwbu4a/NLua.Win64.zip - [10]: http://nvlabs.github.com/cub/download-icon.png (Download for Win64) - - [11]: https://www.dropbox.com/s/do8m3929mf0pwff/NLua.NoPInvoke.zip - [12]: http://nvlabs.github.com/cub/download-icon.png (Download Pure C# - No P/Invoke) - - [13]: https://www.dropbox.com/s/c08wphdmk5o7tdx/NLua.WP7.zip - [14]: http://nvlabs.github.com/cub/download-icon.png (Download for Windows Phone 7) - - [15]: https://www.dropbox.com/s/2pva1tyxpnn7feb/NLua.WPSL8.zip - [16]: http://nvlabs.github.com/cub/download-icon.png (Download for Windows Phone Silverlight 8 (ARM+x86)) - - [17]: https://www.dropbox.com/s/nonijkic8216f7l/NLua.WinRT.zip - [18]: http://nvlabs.github.com/cub/download-icon.png (Download for Windows Phone 8 (RT) (ARM+x86)) - - [19]: https://dl.dropboxusercontent.com/u/17523659/NLua.Unity3D.zip - [20]: http://nvlabs.github.com/cub/download-icon.png (Download for Unity3D) - - -| | Build Status | Download | -| :------ | ------: | :------: | -| **Linux** | [![Linux](https://travis-ci.org/NLua/NLua.svg?branch=master)](https://travis-ci.org/NLua/NLua) | -| **OSX** | [![OSX](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_OSX)](http://codefoco.zapto.org:8085/job/NLua_OSX/) | [![dwn_osx][2]][1] | -| **iOS** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_iOS)](http://codefoco.zapto.org:8085/view/X/job/NLua_iOS/) | [![dwn_ios][4]][3] | -| **Android** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_Android)](http://codefoco.zapto.org:8085/view/X/job/NLua_Android/) | [![dwn_android][6]][5] | -| **Win32** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_Windows)](http://codefoco.zapto.org:8085/view/X/job/NLua_Windows/) | [![dwn_w32][8]][7] | -| **Win64** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_Win64)](http://codefoco.zapto.org:8085/view/X/job/NLua_Win64/) | [![dwn_w64][10]][9] | -| **.NET Pure C#** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_WinSafe)](http://codefoco.zapto.org:8085/view/X/job/NLua_WinSafe/) | [![dwn_winsafe][12]][11] | -| **WP8 (Silverlight)** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_WPSL8)](http://codefoco.zapto.org:8085/view/X/job/NLua_WinSafe/) | [![dwn_wpsl8][16]][15] | -| **WP8 (WinRT)** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_WPSL8)](http://codefoco.zapto.org:8085/view/X/job/NLua_WP8/) | [![dwn_wp8][18]][17] | -| **Windows Phone 7** | | [![dwn_wp7][14]][13] | -| **Unity3D** | | [![dwn_unity3d][20]][19] | - -Example: -You can use/instantiate any .NET class without any previous registration or annotation. -```csharp - public class SomeClass - { - public string MyProperty {get; private set;} - - public SomeClass (string param1 = "defaulValue") - { - MyProperty = param1; - } - - public int Func1 () - { - return 32; - } - - public string AnotherFunc (int val1, string val2) - { - return "Some String"; - } - - public static string StaticMethod (int param) - { - return "Return of Static Method"; - } - -``` - -Creating Lua state: - -```csharp - using NLua; - - Lua state = new Lua () - -``` - -Evaluating simple expressions: -```csharp - var res = state.DoString ("return 10 + 3*(5 + 2)")[0] as double; - // Lua can return multiple values, for this reason DoString return a array of objects -``` - -Passing raw values to the state: - -```csharp - double val = 12.0; - state ["x"] = val; // Create a global value 'x' - var res = state.DoString ("return 10 + x*(5 + 2)")[0] as double; -``` - - -Retrieving global values: - -```csharp - state.DoString ("y = 10 + x*(5 + 2)"); - var y = state ["y"] as double; // Retrieve the value of y -``` - -Retrieving Lua functions: - -```csharp - state.DoString (@" - function ScriptFunc (val1, val2) - if val1 > val2 then - return val1 + 1 - else - return val2 - 1 - end - end - "); - var scriptFunc = state ["ScriptFunc"] as LuaFunction; - var res = (int)scriptFunc.Call (3, 5).First (); - // LuaFunction.Call will also return a array of objects, since a Lua function - // can return multiple values -``` - -##Using the .NET objects.## - -Passing .NET objects to the state: - -```csharp - SomeClass obj = new SomeClass ("Param"); - state ["obj"] = obj; // Create a global value 'obj' of .NET type SomeClass - // This could be any .NET object, from BCL or from your assemblies -``` - -Using .NET assemblies inside Lua: - -To access any .NET assembly to create objects, events etc inside Lua you need to ask NLua to use CLR as a Lua package. -To do this just use the method `LoadCLRPackage` and use the `import` function inside your Lua script to load the Assembly. - -```csharp - state.LoadCLRPackage (); - state.DoString (@" import ('MyAssembly', 'MyNamespace') - import ('System.Web') "); - // import will load any .NET assembly and they will be available inside the Lua context. -``` - -Creating .NET objects: -To create object you only need to use the class name with the `()`. - -```csharp -state.DoString (@" - obj2 = SomeClass() -- you can suppress default values. - client = WebClient() - "); -``` - -Calling instance methods: -To call instance methods you need to use the `:` notation, you can call methods from objects passed to Lua or to objects created inside the Lua context. - -```csharp - state.DoString (@" - local res1 = obj:Func1() - local res2 = obj2:AnotherFunc (10, 'hello') - local res3 = client:DownloadString('http://nlua.org') - "); -``` - -Calling static methods: -You can call static methods using only the class name and the `.` notation from Lua. - -```csharp - state.DoString (@" - local res4 = SomeClass.StaticMethod(4) - "); -``` - -Calling properties: -You can get (or set) any property using `.` notation from Lua. - -```csharp - state.DoString (@" - local res5 = obj.MyProperty - "); -``` - -All methods, events or property need to be public available, NLua will fail to call non-public members. - -If you are using Xamarin.iOS you need to [`Preserve`](http://developer.xamarin.com/guides/ios/advanced_topics/linker/) the class you want to use inside NLua, otherwise the Linker will remove the class from final binary if the class is not in use. - -##Sandboxing## - -There is many ways to sandbox scripts inside your application. I strongly recommend you to use plain Lua to do your sandbox. -You can re-write the `import` function before load the user script and if the user try to import a .NET assembly nothing will happen. - -```csharp - state.DoString (@" - import = function () end - "); -``` -[Lua-Sandbox user-list](http://lua-users.org/wiki/SandBoxes) - - -Copyright (c) 2014 Vinicius Jarina (viniciusjarina@gmail.com) - -NLua 1.3.2 ----------- - -* Migration to unified Xamarin.iOS (iOS) -* Added __call method to call Actions/Funcs from Lua as Lua functions. -* Fixed [#116](https://github.com/NLua/NLua/issues/116) problem accessing base class method -* Fixed [#117](https://github.com/NLua/NLua/issues/117) problem with same method in class and base class -* Fixed [#125](https://github.com/NLua/NLua/issues/125) calling methods with params keyword. - -NLua 1.3.1 ----------- -* Added support to WinRT (Windows Phone 8) -* Added support to Unity3D -* Update Lua 5.2.3 with latest patches -* Fixed support to Unicode strings (UTF-8) -* [Fixed x86/x64 issue](https://github.com/NLua/NLua/issues/67). -* [Fixed overload issue](https://github.com/NLua/NLua/issues/103) -* [Fixed support to Debug and DebugHook APIs](https://github.com/NLua/NLua/issues/31) -* [Added support to operators call](https://github.com/NLua/NLua/issues/57) -* [Fixed access to keys with .](https://github.com/NLua/NLua/issues/68) -* [Fixed issue with ValueTypes](https://github.com/NLua/NLua/issues/73) - -NLua 1.3.0 ----------- -* Update Lua to 5.2.3 -* Update to Xamarin components store. (http://components.xamarin.com/view/NLua) - -NLua 1.2.0 ----------- -* NuGet Package (https://www.nuget.org/packages/NLua/) -* Port to Android 15+ (armeabi, v7a, x86) -* Updated Lua 5.2.2 (patch 7) -* Lot of Bug fixes. - - -NLua 1.1.0 ----------- -* Port to WP7 (Thanks to Mangatome) -* NLua now using Lua 5.2.2 -* Bug fixes. - -NLua 1.0.0 ----------- -* Forked from LuaInterface 2.0.4 -* Added iOS support using KeraLua (C# P/Invoke Lua) - - ->###Help NLua### ->* Contributing -> -------------- -> * NLua uses the Mono Code-Style http://www.mono-project.com/Coding_Guidelines . -> * Please, do not change the line-end or re-indent the code. -> * Run the tests before you push. -> * Avoid pushing style changes (unless they are really needed), renaming and move code. - -Old History ------------ -LuaInterface --------------- - -Copyright (c) 2003-2006 Fabio Mascarenhas de Queiroz - -Maintainer: Craig Presti, craig@vastpark.com - -lua51.dll and lua51.exe are Copyright (c) 2005 Tecgraf, PUC-Rio - - -Getting started with NLua: -------------------------- - -* Look at src/TestNLua/TestLua to see an example of usage from C# -(optionally you can run this from inside the NLua solution using the debugger). -Also provides a good example of how to override .NET methods of Lua and usage of NLua -from within your .NET application. - -* Look at samples/testluaform.lua to see examples of how to use -.NET inside Lua - -* More installation and usage instructions in the doc/guide.pdf file. - -What's new in LuaInterface 2.0.3 ------------------------------- -* Fix: Private methods accessible via LuaInterface -* Fix: Method overload lookup failures -* Fix: Lua DoFile memory leaks when file not found (submitted by Paul Moore) -* Fix: Lua Dispose not freeing memory (submitted by Paul Moore) -* Fix: Better support for accessing indexers -* Fix: Parsing error for MBCS characters (qingrui.li) -* Fix: Dispose errors originating from LuaTable, LuaFunction, LuaUserData -* Fix: LuaInterface no longer disposes the state when passed one via the overloaded constructor -* Added: LoadString and LoadFile (submitted by Paul Moore) -* Added: Overloaded DoString -* Added: Lua debugging support (rostermeier) - - -What's new in LuaInterface 2.0.1 ------------------------------- -* Apparently the 2.0 built binaries had an issue for some users, this is just a rebuild with the lua sources pulled into the LuaInterface.zip - -What's new in LuaInterface 2.0 ------------------------------- -* The base lua5.1.2 library is now built as entirely manged code. LuaInterface is now pure CIL -* Various adapters to connect the older x86 version of lua are no longer needed -* Performance fixes contributed by Toby Lawrence, Oliver Nemoz and Craig Presti - -What's new in LuaInterface 1.5.3 ----------- -* Internal lua panics (due to API violations) now throw LuaExceptions into .net -* If .net code throws an exception into Lua and lua does not handle it, the -original exception is forwarded back out to .net land. -* Fix bug in the Lua 5.1.1 gmatch C code - it was improperly assuming gmatch -only works with tables. - -What's new in LuaInterface 1.5.2 ----------- -* Overriding C# methods from Lua is fixed (broken with .net 2.0!) -* Registering static C# functions for Lua is fixed (broken with Lua-5.1.1) -* Rebuilt to fix linking problems with the binaries included in 1.5.1 -* RegisterFunction has been leaking things onto the stack - -What's new in LuaInterface 1.5.1 ----------- -Fix a serious bug w.r.t. garbage collection - made especially apparent -with the new lua5.1 switch: If you were *very* unlucky with timing -sometimes Lua would loose track of pointers to CLR functions. - -When I added support for static methods, I allowed the user to use either a -colon or a dot to separate the method from the class name. This was not -correct - it broke disambiguation between overloaded static methods. -Therefore, LuaInterface is now more strict: If you want to call a static -method, you must use dot to separate the method name from the class name. Of -course you can still use a colon if an _instance_ is being used. - -Static method calls are now much faster (due to better caching). - -What's new in LuaInterface 1.5 ----------- -LuaInterface is now updated to be based on Lua5.1.1. You can either use -your own build/binaries for Lua5.1.1 or use the version distributed here. -(Lots of thanks to Steffen Itterheim for this work!) - -LuaInterface.Lua no longer has OpenLibs etc... The base mechanism for -library loading for Lua has changed, and we haven't yet broken apart -the library loading for LuaInterface. Instead, all standard Lua libraries -are automatically loaded at start up. - -Fixed a bug where calls of some static methods would reference an -invalid pointer. - -Fixed a bug when strings with embedded null characters are passed in or -out of Lua (Thanks to Daniel N�ri for the report & fix!) - -The native components in LuaInterface (i.e. Lua51 and the loader) are -both built as release builds - to prevent problems loading standard -windows libraries. - -Note: You do not need to download/build lua-5.1.1.zip unless you want to -modify Lua internals (a built version of lua51.dll is included in the -regular LuaInterface distribution) - -What's New in LuaInterface 1.4 ----------- - -Note: Fabio area of interest has moved off in other directions (hopefully only temporarily). -I've talked with Fabio and he's said he's okay with me doing a new release with various fixes -I've made over the last few months. Changes since 1.3: - -Visual Studio 2005/.Net 2.0 is supported. - -Compat-5.1 is modified to expect backslash as the path seperator. - -LuaInterface will now work correctly with Generic C# classes. - -CLR inner types are now supported. - -Fixed a problem where sometimes Lua proxy objects would be associated with the wrong CLR object. - -If a CLR class has an array accessor, the elements can be accessed using the regular Lua indexing -interface. - -Add CLRPackage.lua to the samples directory. This class makes it much easier to automatically -load referenced assemblies. In the next release this loading will be automatic. - -To see an quick demonstration of LuaInterface, cd into nlua/samples and then -type: ..\..\Built\debug\LuaRunner.exe testluaform.lua - -Various other minor fixes that I've forgotten. I'll keep better track next time. - -Note: LuaInterface is still based on Lua 5.0.2. If someone really wants us to upgrade to Lua 5.1 -please send me a note. In the mean time, I'm also distributing a version of -Lua 5.0.2 with an appropriate VS 2005 project file. You do not need to -download this file unless you want to modify Lua internals (a built version -of lua50.dll is included in the regular LuaInterface distribution) - -What's New in LuaInterface 1.3 ----------- - -LuaInterface now works with LuaBinaries Release 2 (http://luabinaries.luaforge.net) -and Compat-5.1 Release 3 (http://luaforge.net/projects/compat). The loader DLL is now -called luanet.dll, and does not need a nlua.lua file anymore -(just put LuaInterface.dll in the GAC, luanet.dll in your package.cpath, and -do require"luanet"). - -Fixed a bug in the treatment of the char type (thanks to Ron Scott). - -LuaInterface.dll now has a strong name, and can be put in the GAC (thanks to Ivan Voras). - -You can now use foreach with instances of LuaTable (thanks to Zachary Landau). - -There is an alternate form of loading assemblies and importing types (based on an -anonymous contribution in the Lua wiki). Check the _alt files in the samples folder. - - -What's New in LuaInterface 1.2.1 --------------------------------- - -Now checks if two LuaInterface.Lua instances are trying to share the same Lua state, -and throws an exception if this is the case. Also included readonly clauses in public -members of the Lua and ObjectTranslator classes. - -This version includes the source of LuaInterfaceLoader.dll, with VS.Net 2003 project -files. - -What's New in LuaInterface 1.2 ------------------------------- - -LuaInterface now can be loaded as a module, so you can use the lua standalone -interpreter to run scripts. Thanks to Paul Winwood for this idea and sample code -showing how to load the CLR from a C++ program. The module is "nlua". Make -sure Lua can find nlua.lua, and LuaInterfaceLoader.dll is either in the -current directory or the GAC. The samples now load LuaInterface as a module, in -its own namespace. - -The get_method_bysig, get_constructor_bysig and make_object were changed: now you -pass the *names* of the types to them, instead of the types themselves. E.g: - - get_method_bysig(obj,"method","System.String") - -instead of - - String = import_type("System.String") - get_method_bysig(obj,"method",String) - -Make sure the assemblies of the types you are passing have been loaded, or the call -will fail. The test cases in src/TestLuaInterface/TestLua.cs have examples of the new -functions. +[![Logo](https://raw.githubusercontent.com/NLua/NLua/master/NLua.png)]() + +NLua +======= + + +| NuGet | NuGet (Pre-Release) | +| ------|------| +|[![nuget](https://img.shields.io/nuget/v/NLua.svg)](https://www.nuget.org/packages/NLua)|[![nuget](https://img.shields.io/nuget/vpre/NLua.svg)](https://www.nuget.org/packages/NLua)| + +| | Status | +| :------ | :------: | +| **Linux** | [![Linux](https://travis-ci.org/NLua/NLua.svg?branch=master)](https://travis-ci.org/NLua/NLua) | +| **AppVeyor** | [![Build status](https://ci.appveyor.com/api/projects/status/jkqcy9m9k35jwolx?svg=true)](https://ci.appveyor.com/project/viniciusjarina/NLua)| +|**Mac (Azure Pipelines)** | [![Build Status](https://dev.azure.com/NLua/NLua/_apis/build/status/NLua-NLua.Mac?branchName=master)](https://dev.azure.com/NLua/NLua/_build/latest?definitionId=2&branchName=master) | +|**Windows (Azure Pipelines)** | [![Build Status](https://dev.azure.com/NLua/NLua/_apis/build/status/NLua-NLua.Windows?branchName=master)](https://dev.azure.com/NLua/NLua/_build/latest?definitionId=4&branchName=master) | + + +Bridge between Lua world and the .NET (compatible with Xamarin.iOS/Mac/Android/.NET/.NET Core) + +Building +--------- + + msbuild + + +============================= + +NLua allows the usage of Lua from C#, on Windows, Linux, Mac, iOS , Android. + +[![Cmd](https://raw.github.com/NLua/NLua/master/extras/screenshot/NLuaCommand.gif)]() + + +NLua is a fork project of LuaInterface (from Fábio Mascarenhas/Craig Presti). + +Example: +You can use/instantiate any .NET class without any previous registration or annotation. +```csharp + public class SomeClass + { + public string MyProperty {get; private set;} + + public SomeClass (string param1 = "defaulValue") + { + MyProperty = param1; + } + + public int Func1 () + { + return 32; + } + + public string AnotherFunc (int val1, string val2) + { + return "Some String"; + } + + public static string StaticMethod (int param) + { + return "Return of Static Method"; + } + +``` + +Creating Lua state: + +```csharp + using NLua; + + Lua state = new Lua () + +``` + +Evaluating simple expressions: +```csharp + var res = state.DoString ("return 10 + 3*(5 + 2)")[0] as double; + // Lua can return multiple values, for this reason DoString return a array of objects +``` + +Passing raw values to the state: + +```csharp + double val = 12.0; + state ["x"] = val; // Create a global value 'x' + var res = state.DoString ("return 10 + x*(5 + 2)")[0] as double; +``` + + +Retrieving global values: + +```csharp + state.DoString ("y = 10 + x*(5 + 2)"); + var y = state ["y"] as double; // Retrieve the value of y +``` + +Retrieving Lua functions: + +```csharp + state.DoString (@" + function ScriptFunc (val1, val2) + if val1 > val2 then + return val1 + 1 + else + return val2 - 1 + end + end + "); + var scriptFunc = state ["ScriptFunc"] as LuaFunction; + var res = (int)scriptFunc.Call (3, 5).First (); + // LuaFunction.Call will also return a array of objects, since a Lua function + // can return multiple values +``` + +##Using the .NET objects.## + +Passing .NET objects to the state: + +```csharp + SomeClass obj = new SomeClass ("Param"); + state ["obj"] = obj; // Create a global value 'obj' of .NET type SomeClass + // This could be any .NET object, from BCL or from your assemblies +``` + +Using .NET assemblies inside Lua: + +To access any .NET assembly to create objects, events etc inside Lua you need to ask NLua to use CLR as a Lua package. +To do this just use the method `LoadCLRPackage` and use the `import` function inside your Lua script to load the Assembly. + +```csharp + state.LoadCLRPackage (); + state.DoString (@" import ('MyAssembly', 'MyNamespace') + import ('System.Web') "); + // import will load any .NET assembly and they will be available inside the Lua context. +``` + +Creating .NET objects: +To create object you only need to use the class name with the `()`. + +```csharp +state.DoString (@" + obj2 = SomeClass() -- you can suppress default values. + client = WebClient() + "); +``` + +Calling instance methods: +To call instance methods you need to use the `:` notation, you can call methods from objects passed to Lua or to objects created inside the Lua context. + +```csharp + state.DoString (@" + local res1 = obj:Func1() + local res2 = obj2:AnotherFunc (10, 'hello') + local res3 = client:DownloadString('http://nlua.org') + "); +``` + +Calling static methods: +You can call static methods using only the class name and the `.` notation from Lua. + +```csharp + state.DoString (@" + local res4 = SomeClass.StaticMethod(4) + "); +``` + +Calling properties: +You can get (or set) any property using `.` notation from Lua. + +```csharp + state.DoString (@" + local res5 = obj.MyProperty + "); +``` + +All methods, events or property need to be public available, NLua will fail to call non-public members. + +If you are using Xamarin.iOS you need to [`Preserve`](http://developer.xamarin.com/guides/ios/advanced_topics/linker/) the class you want to use inside NLua, otherwise the Linker will remove the class from final binary if the class is not in use. + +##Sandboxing## + +There is many ways to sandbox scripts inside your application. I strongly recommend you to use plain Lua to do your sandbox. +You can re-write the `import` function before load the user script and if the user try to import a .NET assembly nothing will happen. + +```csharp + state.DoString (@" + import = function () end + "); +``` +[Lua-Sandbox user-list](http://lua-users.org/wiki/SandBoxes) + + +Copyright (c) 2019 Vinicius Jarina (viniciusjarina@gmail.com) + +NLua 1.4.x +---------- + +NLua huge cleanup and refactor after a few years. + +* Moved to .NET C# style. +* Using KeraLua as nuget dependencie. +* Droped support for KopiLua/Silverlight/Windows Phone + + +NLua 1.3.2 +---------- + +* Migration to unified Xamarin.iOS (iOS) +* Added __call method to call Actions/Funcs from Lua as Lua functions. +* Fixed [#116](https://github.com/NLua/NLua/issues/116) problem accessing base class method +* Fixed [#117](https://github.com/NLua/NLua/issues/117) problem with same method in class and base class +* Fixed [#125](https://github.com/NLua/NLua/issues/125) calling methods with params keyword. + +NLua 1.3.1 +---------- +* Added support to WinRT (Windows Phone 8) +* Added support to Unity3D +* Update Lua 5.2.3 with latest patches +* Fixed support to Unicode strings (UTF-8) +* [Fixed x86/x64 issue](https://github.com/NLua/NLua/issues/67). +* [Fixed overload issue](https://github.com/NLua/NLua/issues/103) +* [Fixed support to Debug and DebugHook APIs](https://github.com/NLua/NLua/issues/31) +* [Added support to operators call](https://github.com/NLua/NLua/issues/57) +* [Fixed access to keys with .](https://github.com/NLua/NLua/issues/68) +* [Fixed issue with ValueTypes](https://github.com/NLua/NLua/issues/73) + +NLua 1.3.0 +---------- +* Update Lua to 5.2.3 +* Update to Xamarin components store. (http://components.xamarin.com/view/NLua) + +NLua 1.2.0 +---------- +* NuGet Package (https://www.nuget.org/packages/NLua/) +* Port to Android 15+ (armeabi, v7a, x86) +* Updated Lua 5.2.2 (patch 7) +* Lot of Bug fixes. + + +NLua 1.1.0 +---------- +* Port to WP7 (Thanks to Mangatome) +* NLua now using Lua 5.2.2 +* Bug fixes. + +NLua 1.0.0 +---------- +* Forked from LuaInterface 2.0.4 +* Added iOS support using KeraLua (C# P/Invoke Lua) + + +>###Help NLua### +>* Contributing +> -------------- +> * NLua uses the Mono Code-Style http://www.mono-project.com/Coding_Guidelines . +> * Please, do not change the line-end or re-indent the code. +> * Run the tests before you push. +> * Avoid pushing style changes (unless they are really needed), renaming and move code. + +Old History +----------- +LuaInterface +-------------- + +Copyright (c) 2003-2006 Fabio Mascarenhas de Queiroz + +Maintainer: Craig Presti, craig@vastpark.com + +lua51.dll and lua51.exe are Copyright (c) 2005 Tecgraf, PUC-Rio + + +Getting started with NLua: +------------------------- + +* Look at src/TestNLua/TestLua to see an example of usage from C# +(optionally you can run this from inside the NLua solution using the debugger). +Also provides a good example of how to override .NET methods of Lua and usage of NLua +from within your .NET application. + +* Look at samples/testluaform.lua to see examples of how to use +.NET inside Lua + +* More installation and usage instructions in the doc/guide.pdf file. + +What's new in LuaInterface 2.0.3 +------------------------------ +* Fix: Private methods accessible via LuaInterface +* Fix: Method overload lookup failures +* Fix: Lua DoFile memory leaks when file not found (submitted by Paul Moore) +* Fix: Lua Dispose not freeing memory (submitted by Paul Moore) +* Fix: Better support for accessing indexers +* Fix: Parsing error for MBCS characters (qingrui.li) +* Fix: Dispose errors originating from LuaTable, LuaFunction, LuaUserData +* Fix: LuaInterface no longer disposes the state when passed one via the overloaded constructor +* Added: LoadString and LoadFile (submitted by Paul Moore) +* Added: Overloaded DoString +* Added: Lua debugging support (rostermeier) + + +What's new in LuaInterface 2.0.1 +------------------------------ +* Apparently the 2.0 built binaries had an issue for some users, this is just a rebuild with the lua sources pulled into the LuaInterface.zip + +What's new in LuaInterface 2.0 +------------------------------ +* The base lua5.1.2 library is now built as entirely manged code. LuaInterface is now pure CIL +* Various adapters to connect the older x86 version of lua are no longer needed +* Performance fixes contributed by Toby Lawrence, Oliver Nemoz and Craig Presti + +What's new in LuaInterface 1.5.3 +---------- +* Internal lua panics (due to API violations) now throw LuaExceptions into .net +* If .net code throws an exception into Lua and lua does not handle it, the +original exception is forwarded back out to .net land. +* Fix bug in the Lua 5.1.1 gmatch C code - it was improperly assuming gmatch +only works with tables. + +What's new in LuaInterface 1.5.2 +---------- +* Overriding C# methods from Lua is fixed (broken with .net 2.0!) +* Registering static C# functions for Lua is fixed (broken with Lua-5.1.1) +* Rebuilt to fix linking problems with the binaries included in 1.5.1 +* RegisterFunction has been leaking things onto the stack + +What's new in LuaInterface 1.5.1 +---------- +Fix a serious bug w.r.t. garbage collection - made especially apparent +with the new lua5.1 switch: If you were *very* unlucky with timing +sometimes Lua would loose track of pointers to CLR functions. + +When I added support for static methods, I allowed the user to use either a +colon or a dot to separate the method from the class name. This was not +correct - it broke disambiguation between overloaded static methods. +Therefore, LuaInterface is now more strict: If you want to call a static +method, you must use dot to separate the method name from the class name. Of +course you can still use a colon if an _instance_ is being used. + +Static method calls are now much faster (due to better caching). + +What's new in LuaInterface 1.5 +---------- +LuaInterface is now updated to be based on Lua5.1.1. You can either use +your own build/binaries for Lua5.1.1 or use the version distributed here. +(Lots of thanks to Steffen Itterheim for this work!) + +LuaInterface.Lua no longer has OpenLibs etc... The base mechanism for +library loading for Lua has changed, and we haven't yet broken apart +the library loading for LuaInterface. Instead, all standard Lua libraries +are automatically loaded at start up. + +Fixed a bug where calls of some static methods would reference an +invalid pointer. + +Fixed a bug when strings with embedded null characters are passed in or +out of Lua (Thanks to Daniel N�ri for the report & fix!) + +The native components in LuaInterface (i.e. Lua51 and the loader) are +both built as release builds - to prevent problems loading standard +windows libraries. + +Note: You do not need to download/build lua-5.1.1.zip unless you want to +modify Lua internals (a built version of lua51.dll is included in the +regular LuaInterface distribution) + +What's New in LuaInterface 1.4 +---------- + +Note: Fabio area of interest has moved off in other directions (hopefully only temporarily). +I've talked with Fabio and he's said he's okay with me doing a new release with various fixes +I've made over the last few months. Changes since 1.3: + +Visual Studio 2005/.Net 2.0 is supported. + +Compat-5.1 is modified to expect backslash as the path seperator. + +LuaInterface will now work correctly with Generic C# classes. + +CLR inner types are now supported. + +Fixed a problem where sometimes Lua proxy objects would be associated with the wrong CLR object. + +If a CLR class has an array accessor, the elements can be accessed using the regular Lua indexing +interface. + +Add CLRPackage.lua to the samples directory. This class makes it much easier to automatically +load referenced assemblies. In the next release this loading will be automatic. + +To see an quick demonstration of LuaInterface, cd into nlua/samples and then +type: ..\..\Built\debug\LuaRunner.exe testluaform.lua + +Various other minor fixes that I've forgotten. I'll keep better track next time. + +Note: LuaInterface is still based on Lua 5.0.2. If someone really wants us to upgrade to Lua 5.1 +please send me a note. In the mean time, I'm also distributing a version of +Lua 5.0.2 with an appropriate VS 2005 project file. You do not need to +download this file unless you want to modify Lua internals (a built version +of lua50.dll is included in the regular LuaInterface distribution) + +What's New in LuaInterface 1.3 +---------- + +LuaInterface now works with LuaBinaries Release 2 (http://luabinaries.luaforge.net) +and Compat-5.1 Release 3 (http://luaforge.net/projects/compat). The loader DLL is now +called luanet.dll, and does not need a nlua.lua file anymore +(just put LuaInterface.dll in the GAC, luanet.dll in your package.cpath, and +do require"luanet"). + +Fixed a bug in the treatment of the char type (thanks to Ron Scott). + +LuaInterface.dll now has a strong name, and can be put in the GAC (thanks to Ivan Voras). + +You can now use foreach with instances of LuaTable (thanks to Zachary Landau). + +There is an alternate form of loading assemblies and importing types (based on an +anonymous contribution in the Lua wiki). Check the _alt files in the samples folder. + + +What's New in LuaInterface 1.2.1 +-------------------------------- + +Now checks if two LuaInterface.Lua instances are trying to share the same Lua state, +and throws an exception if this is the case. Also included readonly clauses in public +members of the Lua and ObjectTranslator classes. + +This version includes the source of LuaInterfaceLoader.dll, with VS.Net 2003 project +files. + +What's New in LuaInterface 1.2 +------------------------------ + +LuaInterface now can be loaded as a module, so you can use the lua standalone +interpreter to run scripts. Thanks to Paul Winwood for this idea and sample code +showing how to load the CLR from a C++ program. The module is "nlua". Make +sure Lua can find nlua.lua, and LuaInterfaceLoader.dll is either in the +current directory or the GAC. The samples now load LuaInterface as a module, in +its own namespace. + +The get_method_bysig, get_constructor_bysig and make_object were changed: now you +pass the *names* of the types to them, instead of the types themselves. E.g: + + get_method_bysig(obj,"method","System.String") + +instead of + + String = import_type("System.String") + get_method_bysig(obj,"method",String) + +Make sure the assemblies of the types you are passing have been loaded, or the call +will fail. The test cases in src/TestLuaInterface/TestLua.cs have examples of the new +functions. + + + diff --git a/Touch.Server/Main.cs b/Touch.Server/Main.cs deleted file mode 100755 index bd09ac01acca0da969ff8ca4c599bbe49da8b5fa..0000000000000000000000000000000000000000 --- a/Touch.Server/Main.cs +++ /dev/null @@ -1,245 +0,0 @@ -// Main.cs: Touch.Unit Simple Server -// -// Authors: -// Sebastien Pouliot -// -// Copyright 2011-2012 Xamarin Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -using System; -using System.IO; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Diagnostics; -using System.Threading; - -using Mono.Options; - -// a simple, blocking (i.e. one device/app at the time), listener -class SimpleListener { - - static byte[] buffer = new byte [16 * 1024]; - - TcpListener server; - - IPAddress Address { get; set; } - int Port { get; set; } - string LogPath { get; set; } - string LogFile { get; set; } - bool AutoExit { get; set; } - - public void Cancel () - { - try { - server.Stop (); - } catch { - // We might have stopped already, so just swallow any exceptions. - } - } - - public int Start () - { - bool processed; - - Console.WriteLine ("Touch.Unit Simple Server listening on: {0}:{1}", Address, Port); - server = new TcpListener (Address, Port); - try { - server.Start (); - - do { - using (TcpClient client = server.AcceptTcpClient ()) { - processed = Processing (client); - } - } while (!AutoExit || !processed); - } - catch (Exception e) { - Console.WriteLine ("[{0}] : {1}", DateTime.Now, e); - return 1; - } - finally { - server.Stop (); - } - - return 0; - } - - public bool Processing (TcpClient client) - { - string logfile = Path.Combine (LogPath, LogFile ?? DateTime.UtcNow.Ticks.ToString () + ".log"); - string remote = client.Client.RemoteEndPoint.ToString (); - Console.WriteLine ("Connection from {0} saving logs to {1}", remote, logfile); - - using (FileStream fs = File.OpenWrite (logfile)) { - // a few extra bits of data only available from this side - string header = String.Format ("[Local Date/Time:\t{1}]{0}[Remote Address:\t{2}]{0}", - Environment.NewLine, DateTime.Now, remote); - byte[] array = Encoding.UTF8.GetBytes (header); - fs.Write (array, 0, array.Length); - fs.Flush (); - // now simply copy what we receive - int i; - int total = 0; - NetworkStream stream = client.GetStream (); - while ((i = stream.Read (buffer, 0, buffer.Length)) != 0) { - fs.Write (buffer, 0, i); - fs.Flush (); - total += i; - } - - if (total < 16) { - // This wasn't a test run, but a connection from the app (on device) to find - // the ip address we're reachable on. - return false; - } - } - - return true; - } - - static void ShowHelp (OptionSet os) - { - Console.WriteLine ("Usage: mono Touch.Server.exe [options]"); - os.WriteOptionDescriptions (Console.Out); - } - - public static int Main (string[] args) - { - Console.WriteLine ("Touch.Unit Simple Server"); - Console.WriteLine ("Copyright 2011, Xamarin Inc. All rights reserved."); - - bool help = false; - string address = null; - string port = null; - string log_path = "."; - string log_file = null; - string launchdev = null; - string launchsim = null; - bool autoexit = false; - - var os = new OptionSet () { - { "h|?|help", "Display help", v => help = true }, - { "ip", "IP address to listen (default: Any)", v => address = v }, - { "port", "TCP port to listen (default: 16384)", v => port = v }, - { "logpath", "Path to save the log files (default: .)", v => log_path = v }, - { "logfile=", "Filename to save the log to (default: automatically generated)", v => log_file = v }, - { "launchdev=", "Run the specified app on a device (specify using bundle identifier)", v => launchdev = v }, - { "launchsim=", "Run the specified app on the simulator (specify using path to *.app directory)", v => launchsim = v }, - { "autoexit", "Exit the server once a test run has completed (default: false)", v => autoexit = true }, - }; - - try { - os.Parse (args); - if (help) - ShowHelp (os); - - var listener = new SimpleListener (); - - IPAddress ip; - if (String.IsNullOrEmpty (address) || !IPAddress.TryParse (address, out ip)) - listener.Address = IPAddress.Any; - - ushort p; - if (UInt16.TryParse (port, out p)) - listener.Port = p; - else - listener.Port = 16384; - - listener.LogPath = log_path ?? "."; - listener.LogFile = log_file; - listener.AutoExit = autoexit; - - if (launchdev != null) { - ThreadPool.QueueUserWorkItem ((v) => { - using (Process proc = new Process ()) { - StringBuilder procArgs = new StringBuilder (); - string sdk_root = Environment.GetEnvironmentVariable ("XCODE_DEVELOPER_ROOT"); - if (!String.IsNullOrEmpty (sdk_root)) - procArgs.Append ("--sdkroot ").Append (sdk_root); - procArgs.Append (" --launchdev "); - procArgs.Append (launchdev); - procArgs.Append (" -argument=-connection-mode -argument=none"); - procArgs.Append (" -argument=-app-arg:-autostart"); - procArgs.Append (" -argument=-app-arg:-autoexit"); - procArgs.Append (" -argument=-app-arg:-enablenetwork"); - procArgs.AppendFormat (" -argument=-app-arg:-hostport:{0}", listener.Port); - procArgs.Append (" -argument=-app-arg:-hostname:"); - var ipAddresses = System.Net.Dns.GetHostEntry (System.Net.Dns.GetHostName ()).AddressList; - for (int i = 0; i < ipAddresses.Length; i++) { - if (i > 0) - procArgs.Append (','); - procArgs.Append (ipAddresses [i].ToString ()); - } - proc.StartInfo.FileName = "/Developer/MonoTouch/usr/bin/mtouch"; - proc.StartInfo.Arguments = procArgs.ToString (); - proc.Start (); - proc.WaitForExit (); - if (proc.ExitCode != 0) - listener.Cancel (); - } - }); - } - - if (launchsim != null) { - ThreadPool.QueueUserWorkItem ((v) => { - using (Process proc = new Process ()) { - StringBuilder output = new StringBuilder (); - StringBuilder procArgs = new StringBuilder (); - string sdk_root = Environment.GetEnvironmentVariable ("XCODE_DEVELOPER_ROOT"); - if (!String.IsNullOrEmpty (sdk_root)) - procArgs.Append ("--sdkroot ").Append (sdk_root); - procArgs.Append (" --launchsim "); - procArgs.Append (launchsim); - procArgs.Append (" -argument=-connection-mode -argument=none"); - procArgs.Append (" -argument=-app-arg:-autostart"); - procArgs.Append (" -argument=-app-arg:-autoexit"); - procArgs.Append (" -argument=-app-arg:-enablenetwork"); - procArgs.Append (" -argument=-app-arg:-hostname:127.0.0.1"); - procArgs.AppendFormat (" -argument=-app-arg:-hostport:{0}", listener.Port); - proc.StartInfo.FileName = "/Developer/MonoTouch/usr/bin/mtouch"; - proc.StartInfo.Arguments = procArgs.ToString (); - proc.StartInfo.UseShellExecute = false; - proc.StartInfo.RedirectStandardError = true; - proc.StartInfo.RedirectStandardOutput = true; - proc.ErrorDataReceived += delegate(object sender, DataReceivedEventArgs e) { - lock (output) - output.AppendLine (e.Data); - }; - proc.OutputDataReceived += delegate(object sender, DataReceivedEventArgs e) { - lock (output) - output.AppendLine (e.Data); - }; - proc.Start (); - proc.BeginErrorReadLine (); - proc.BeginOutputReadLine (); - proc.WaitForExit (); - if (proc.ExitCode != 0) { - listener.Cancel (); - Console.WriteLine (output.ToString ()); - } - } - }); - } - - return listener.Start (); - } catch (OptionException oe) { - Console.WriteLine ("{0} for options '{1}'", oe.Message, oe.OptionName); - return 1; - } catch (Exception ex) { - Console.WriteLine (ex); - return 1; - } - } -} \ No newline at end of file diff --git a/Touch.Server/Options.cs b/Touch.Server/Options.cs deleted file mode 100755 index 269ad1b06f13c704f866abf120734983bbeaf6d4..0000000000000000000000000000000000000000 --- a/Touch.Server/Options.cs +++ /dev/null @@ -1,1112 +0,0 @@ -// -// Options.cs -// -// Authors: -// Jonathan Pryor -// -// Copyright (C) 2008 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -// Compile With: -// gmcs -debug+ -r:System.Core Options.cs -o:NDesk.Options.dll -// gmcs -debug+ -d:LINQ -r:System.Core Options.cs -o:NDesk.Options.dll -// -// The LINQ version just changes the implementation of -// OptionSet.Parse(IEnumerable), and confers no semantic changes. - -// -// A Getopt::Long-inspired option parsing library for C#. -// -// NDesk.Options.OptionSet is built upon a key/value table, where the -// key is a option format string and the value is a delegate that is -// invoked when the format string is matched. -// -// Option format strings: -// Regex-like BNF Grammar: -// name: .+ -// type: [=:] -// sep: ( [^{}]+ | '{' .+ '}' )? -// aliases: ( name type sep ) ( '|' name type sep )* -// -// Each '|'-delimited name is an alias for the associated action. If the -// format string ends in a '=', it has a required value. If the format -// string ends in a ':', it has an optional value. If neither '=' or ':' -// is present, no value is supported. `=' or `:' need only be defined on one -// alias, but if they are provided on more than one they must be consistent. -// -// Each alias portion may also end with a "key/value separator", which is used -// to split option values if the option accepts > 1 value. If not specified, -// it defaults to '=' and ':'. If specified, it can be any character except -// '{' and '}' OR the *string* between '{' and '}'. If no separator should be -// used (i.e. the separate values should be distinct arguments), then "{}" -// should be used as the separator. -// -// Options are extracted either from the current option by looking for -// the option name followed by an '=' or ':', or is taken from the -// following option IFF: -// - The current option does not contain a '=' or a ':' -// - The current option requires a value (i.e. not a Option type of ':') -// -// The `name' used in the option format string does NOT include any leading -// option indicator, such as '-', '--', or '/'. All three of these are -// permitted/required on any named option. -// -// Option bundling is permitted so long as: -// - '-' is used to start the option group -// - all of the bundled options are a single character -// - at most one of the bundled options accepts a value, and the value -// provided starts from the next character to the end of the string. -// -// This allows specifying '-a -b -c' as '-abc', and specifying '-D name=value' -// as '-Dname=value'. -// -// Option processing is disabled by specifying "--". All options after "--" -// are returned by OptionSet.Parse() unchanged and unprocessed. -// -// Unprocessed options are returned from OptionSet.Parse(). -// -// Examples: -// int verbose = 0; -// OptionSet p = new OptionSet () -// .Add ("v", v => ++verbose) -// .Add ("name=|value=", v => Console.WriteLine (v)); -// p.Parse (new string[]{"-v", "--v", "/v", "-name=A", "/name", "B", "extra"}); -// -// The above would parse the argument string array, and would invoke the -// lambda expression three times, setting `verbose' to 3 when complete. -// It would also print out "A" and "B" to standard output. -// The returned array would contain the string "extra". -// -// C# 3.0 collection initializers are supported and encouraged: -// var p = new OptionSet () { -// { "h|?|help", v => ShowHelp () }, -// }; -// -// System.ComponentModel.TypeConverter is also supported, allowing the use of -// custom data types in the callback type; TypeConverter.ConvertFromString() -// is used to convert the value option to an instance of the specified -// type: -// -// var p = new OptionSet () { -// { "foo=", (Foo f) => Console.WriteLine (f.ToString ()) }, -// }; -// -// Random other tidbits: -// - Boolean options (those w/o '=' or ':' in the option format string) -// are explicitly enabled if they are followed with '+', and explicitly -// disabled if they are followed with '-': -// string a = null; -// var p = new OptionSet () { -// { "a", s => a = s }, -// }; -// p.Parse (new string[]{"-a"}); // sets v != null -// p.Parse (new string[]{"-a+"}); // sets v != null -// p.Parse (new string[]{"-a-"}); // sets v == null -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Globalization; -using System.IO; -using System.Runtime.Serialization; -using System.Security.Permissions; -using System.Text; -using System.Text.RegularExpressions; - -#if LINQ -using System.Linq; -#endif - -#if TEST -using NDesk.Options; -#endif - -#if NDESK_OPTIONS -namespace NDesk.Options -#else -namespace Mono.Options -#endif -{ - public class OptionValueCollection : IList, IList { - - List values = new List (); - OptionContext c; - - internal OptionValueCollection (OptionContext c) - { - this.c = c; - } - - #region ICollection - void ICollection.CopyTo (Array array, int index) {(values as ICollection).CopyTo (array, index);} - bool ICollection.IsSynchronized {get {return (values as ICollection).IsSynchronized;}} - object ICollection.SyncRoot {get {return (values as ICollection).SyncRoot;}} - #endregion - - #region ICollection - public void Add (string item) {values.Add (item);} - public void Clear () {values.Clear ();} - public bool Contains (string item) {return values.Contains (item);} - public void CopyTo (string[] array, int arrayIndex) {values.CopyTo (array, arrayIndex);} - public bool Remove (string item) {return values.Remove (item);} - public int Count {get {return values.Count;}} - public bool IsReadOnly {get {return false;}} - #endregion - - #region IEnumerable - IEnumerator IEnumerable.GetEnumerator () {return values.GetEnumerator ();} - #endregion - - #region IEnumerable - public IEnumerator GetEnumerator () {return values.GetEnumerator ();} - #endregion - - #region IList - int IList.Add (object value) {return (values as IList).Add (value);} - bool IList.Contains (object value) {return (values as IList).Contains (value);} - int IList.IndexOf (object value) {return (values as IList).IndexOf (value);} - void IList.Insert (int index, object value) {(values as IList).Insert (index, value);} - void IList.Remove (object value) {(values as IList).Remove (value);} - void IList.RemoveAt (int index) {(values as IList).RemoveAt (index);} - bool IList.IsFixedSize {get {return false;}} - object IList.this [int index] {get {return this [index];} set {(values as IList)[index] = value;}} - #endregion - - #region IList - public int IndexOf (string item) {return values.IndexOf (item);} - public void Insert (int index, string item) {values.Insert (index, item);} - public void RemoveAt (int index) {values.RemoveAt (index);} - - private void AssertValid (int index) - { - if (c.Option == null) - throw new InvalidOperationException ("OptionContext.Option is null."); - if (index >= c.Option.MaxValueCount) - throw new ArgumentOutOfRangeException ("index"); - if (c.Option.OptionValueType == OptionValueType.Required && - index >= values.Count) - throw new OptionException (string.Format ( - c.OptionSet.MessageLocalizer ("Missing required value for option '{0}'."), c.OptionName), - c.OptionName); - } - - public string this [int index] { - get { - AssertValid (index); - return index >= values.Count ? null : values [index]; - } - set { - values [index] = value; - } - } - #endregion - - public List ToList () - { - return new List (values); - } - - public string[] ToArray () - { - return values.ToArray (); - } - - public override string ToString () - { - return string.Join (", ", values.ToArray ()); - } - } - - public class OptionContext { - private Option option; - private string name; - private int index; - private OptionSet set; - private OptionValueCollection c; - - public OptionContext (OptionSet set) - { - this.set = set; - this.c = new OptionValueCollection (this); - } - - public Option Option { - get {return option;} - set {option = value;} - } - - public string OptionName { - get {return name;} - set {name = value;} - } - - public int OptionIndex { - get {return index;} - set {index = value;} - } - - public OptionSet OptionSet { - get {return set;} - } - - public OptionValueCollection OptionValues { - get {return c;} - } - } - - public enum OptionValueType { - None, - Optional, - Required, - } - - public abstract class Option { - string prototype, description; - string[] names; - OptionValueType type; - int count; - string[] separators; - - protected Option (string prototype, string description) - : this (prototype, description, 1) - { - } - - protected Option (string prototype, string description, int maxValueCount) - { - if (prototype == null) - throw new ArgumentNullException ("prototype"); - if (prototype.Length == 0) - throw new ArgumentException ("Cannot be the empty string.", "prototype"); - if (maxValueCount < 0) - throw new ArgumentOutOfRangeException ("maxValueCount"); - - this.prototype = prototype; - this.names = prototype.Split ('|'); - this.description = description; - this.count = maxValueCount; - this.type = ParsePrototype (); - - if (this.count == 0 && type != OptionValueType.None) - throw new ArgumentException ( - "Cannot provide maxValueCount of 0 for OptionValueType.Required or " + - "OptionValueType.Optional.", - "maxValueCount"); - if (this.type == OptionValueType.None && maxValueCount > 1) - throw new ArgumentException ( - string.Format ("Cannot provide maxValueCount of {0} for OptionValueType.None.", maxValueCount), - "maxValueCount"); - if (Array.IndexOf (names, "<>") >= 0 && - ((names.Length == 1 && this.type != OptionValueType.None) || - (names.Length > 1 && this.MaxValueCount > 1))) - throw new ArgumentException ( - "The default option handler '<>' cannot require values.", - "prototype"); - } - - public string Prototype {get {return prototype;}} - public string Description {get {return description;}} - public OptionValueType OptionValueType {get {return type;}} - public int MaxValueCount {get {return count;}} - - public string[] GetNames () - { - return (string[]) names.Clone (); - } - - public string[] GetValueSeparators () - { - if (separators == null) - return new string [0]; - return (string[]) separators.Clone (); - } - -#if NOTYPECONVERTER - protected static T Parse (string value, OptionContext c) - { - if (typeof (T) == typeof (int)) - return (T) (object) int.Parse (value); - else if (typeof (T) == typeof (string)) - return (T) (object) value; - throw new OptionException ("Could not convert parameter", c.OptionName, null); - } -#else - protected static T Parse (string value, OptionContext c) - { - Type tt = typeof (T); - bool nullable = tt.IsValueType && tt.IsGenericType && - !tt.IsGenericTypeDefinition && - tt.GetGenericTypeDefinition () == typeof (Nullable<>); - Type targetType = nullable ? tt.GetGenericArguments () [0] : typeof (T); - TypeConverter conv = TypeDescriptor.GetConverter (targetType); - T t = default (T); - try { - if (value != null) - t = (T) conv.ConvertFromString (value); - } - catch (Exception e) { - throw new OptionException ( - string.Format ( - c.OptionSet.MessageLocalizer ("Could not convert string `{0}' to type {1} for option `{2}'."), - value, targetType.Name, c.OptionName), - c.OptionName, e); - } - return t; - } -#endif - - internal string[] Names {get {return names;}} - internal string[] ValueSeparators {get {return separators;}} - - static readonly char[] NameTerminator = new char[]{'=', ':'}; - - private OptionValueType ParsePrototype () - { - char type = '\0'; - List seps = new List (); - for (int i = 0; i < names.Length; ++i) { - string name = names [i]; - if (name.Length == 0) - throw new ArgumentException ("Empty option names are not supported.", "prototype"); - - int end = name.IndexOfAny (NameTerminator); - if (end == -1) - continue; - names [i] = name.Substring (0, end); - if (type == '\0' || type == name [end]) - type = name [end]; - else - throw new ArgumentException ( - string.Format ("Conflicting option types: '{0}' vs. '{1}'.", type, name [end]), - "prototype"); - AddSeparators (name, end, seps); - } - - if (type == '\0') - return OptionValueType.None; - - if (count <= 1 && seps.Count != 0) - throw new ArgumentException ( - string.Format ("Cannot provide key/value separators for Options taking {0} value(s).", count), - "prototype"); - if (count > 1) { - if (seps.Count == 0) - this.separators = new string[]{":", "="}; - else if (seps.Count == 1 && seps [0].Length == 0) - this.separators = null; - else - this.separators = seps.ToArray (); - } - - return type == '=' ? OptionValueType.Required : OptionValueType.Optional; - } - - private static void AddSeparators (string name, int end, ICollection seps) - { - int start = -1; - for (int i = end+1; i < name.Length; ++i) { - switch (name [i]) { - case '{': - if (start != -1) - throw new ArgumentException ( - string.Format ("Ill-formed name/value separator found in \"{0}\".", name), - "prototype"); - start = i+1; - break; - case '}': - if (start == -1) - throw new ArgumentException ( - string.Format ("Ill-formed name/value separator found in \"{0}\".", name), - "prototype"); - seps.Add (name.Substring (start, i-start)); - start = -1; - break; - default: - if (start == -1) - seps.Add (name [i].ToString ()); - break; - } - } - if (start != -1) - throw new ArgumentException ( - string.Format ("Ill-formed name/value separator found in \"{0}\".", name), - "prototype"); - } - - public void Invoke (OptionContext c) - { - OnParseComplete (c); - c.OptionName = null; - c.Option = null; - c.OptionValues.Clear (); - } - - protected abstract void OnParseComplete (OptionContext c); - - public override string ToString () - { - return Prototype; - } - } - - [Serializable] - public class OptionException : Exception { - private string option; - - public OptionException () - { - } - - public OptionException (string message, string optionName) - : base (message) - { - this.option = optionName; - } - - public OptionException (string message, string optionName, Exception innerException) - : base (message, innerException) - { - this.option = optionName; - } - - protected OptionException (SerializationInfo info, StreamingContext context) - : base (info, context) - { - this.option = info.GetString ("OptionName"); - } - - public string OptionName { - get {return this.option;} - } - - //[SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)] - public override void GetObjectData (SerializationInfo info, StreamingContext context) - { - base.GetObjectData (info, context); - info.AddValue ("OptionName", option); - } - } - - public delegate void OptionAction (TKey key, TValue value); - - public class OptionSet : KeyedCollection - { - public OptionSet () - : this (delegate (string f) {return f;}) - { - } - - public OptionSet (Converter localizer) - { - this.localizer = localizer; - } - - Converter localizer; - - public Converter MessageLocalizer { - get {return localizer;} - } - - protected override string GetKeyForItem (Option item) - { - if (item == null) - throw new ArgumentNullException ("option"); - if (item.Names != null && item.Names.Length > 0) - return item.Names [0]; - // This should never happen, as it's invalid for Option to be - // constructed w/o any names. - throw new InvalidOperationException ("Option has no names!"); - } - - [Obsolete ("Use KeyedCollection.this[string]")] - protected Option GetOptionForName (string option) - { - if (option == null) - throw new ArgumentNullException ("option"); - try { - return base [option]; - } - catch (KeyNotFoundException) { - return null; - } - } - - protected override void InsertItem (int index, Option item) - { - base.InsertItem (index, item); - AddImpl (item); - } - - protected override void RemoveItem (int index) - { - base.RemoveItem (index); - Option p = Items [index]; - // KeyedCollection.RemoveItem() handles the 0th item - for (int i = 1; i < p.Names.Length; ++i) { - Dictionary.Remove (p.Names [i]); - } - } - - protected override void SetItem (int index, Option item) - { - base.SetItem (index, item); - RemoveItem (index); - AddImpl (item); - } - - private void AddImpl (Option option) - { - if (option == null) - throw new ArgumentNullException ("option"); - List added = new List (option.Names.Length); - try { - // KeyedCollection.InsertItem/SetItem handle the 0th name. - for (int i = 1; i < option.Names.Length; ++i) { - Dictionary.Add (option.Names [i], option); - added.Add (option.Names [i]); - } - } - catch (Exception) { - foreach (string name in added) - Dictionary.Remove (name); - throw; - } - } - - public new OptionSet Add (Option option) - { - base.Add (option); - return this; - } - - sealed class ActionOption : Option { - Action action; - - public ActionOption (string prototype, string description, int count, Action action) - : base (prototype, description, count) - { - if (action == null) - throw new ArgumentNullException ("action"); - this.action = action; - } - - protected override void OnParseComplete (OptionContext c) - { - action (c.OptionValues); - } - } - - public OptionSet Add (string prototype, Action action) - { - return Add (prototype, null, action); - } - - public OptionSet Add (string prototype, string description, Action action) - { - if (action == null) - throw new ArgumentNullException ("action"); - Option p = new ActionOption (prototype, description, 1, - delegate (OptionValueCollection v) { action (v [0]); }); - base.Add (p); - return this; - } - - public OptionSet Add (string prototype, OptionAction action) - { - return Add (prototype, null, action); - } - - public OptionSet Add (string prototype, string description, OptionAction action) - { - if (action == null) - throw new ArgumentNullException ("action"); - Option p = new ActionOption (prototype, description, 2, - delegate (OptionValueCollection v) {action (v [0], v [1]);}); - base.Add (p); - return this; - } - - sealed class ActionOption : Option { - Action action; - - public ActionOption (string prototype, string description, Action action) - : base (prototype, description, 1) - { - if (action == null) - throw new ArgumentNullException ("action"); - this.action = action; - } - - protected override void OnParseComplete (OptionContext c) - { - action (Parse (c.OptionValues [0], c)); - } - } - - sealed class ActionOption : Option { - OptionAction action; - - public ActionOption (string prototype, string description, OptionAction action) - : base (prototype, description, 2) - { - if (action == null) - throw new ArgumentNullException ("action"); - this.action = action; - } - - protected override void OnParseComplete (OptionContext c) - { - action ( - Parse (c.OptionValues [0], c), - Parse (c.OptionValues [1], c)); - } - } - - public OptionSet Add (string prototype, Action action) - { - return Add (prototype, null, action); - } - - public OptionSet Add (string prototype, string description, Action action) - { - return Add (new ActionOption (prototype, description, action)); - } - - public OptionSet Add (string prototype, OptionAction action) - { - return Add (prototype, null, action); - } - - public OptionSet Add (string prototype, string description, OptionAction action) - { - return Add (new ActionOption (prototype, description, action)); - } - - protected virtual OptionContext CreateOptionContext () - { - return new OptionContext (this); - } - -#if LINQ - public List Parse (IEnumerable arguments) - { - bool process = true; - OptionContext c = CreateOptionContext (); - c.OptionIndex = -1; - var def = GetOptionForName ("<>"); - var unprocessed = - from argument in arguments - where ++c.OptionIndex >= 0 && (process || def != null) - ? process - ? argument == "--" - ? (process = false) - : !Parse (argument, c) - ? def != null - ? Unprocessed (null, def, c, argument) - : true - : false - : def != null - ? Unprocessed (null, def, c, argument) - : true - : true - select argument; - List r = unprocessed.ToList (); - if (c.Option != null) - c.Option.Invoke (c); - return r; - } -#else - public List Parse (IEnumerable arguments) - { - OptionContext c = CreateOptionContext (); - c.OptionIndex = -1; - bool process = true; - List unprocessed = new List (); - Option def = Contains ("<>") ? this ["<>"] : null; - foreach (string argument in arguments) { - ++c.OptionIndex; - if (argument == "--") { - process = false; - continue; - } - if (!process) { - Unprocessed (unprocessed, def, c, argument); - continue; - } - if (!Parse (argument, c)) - Unprocessed (unprocessed, def, c, argument); - } - if (c.Option != null) - c.Option.Invoke (c); - return unprocessed; - } -#endif - - private static bool Unprocessed (ICollection extra, Option def, OptionContext c, string argument) - { - if (def == null) { - extra.Add (argument); - return false; - } - c.OptionValues.Add (argument); - c.Option = def; - c.Option.Invoke (c); - return false; - } - - private readonly Regex ValueOption = new Regex ( - @"^(?--|-|/)(?[^:=]+)((?[:=])(?.*))?$"); - - protected bool GetOptionParts (string argument, out string flag, out string name, out string sep, out string value) - { - if (argument == null) - throw new ArgumentNullException ("argument"); - - flag = name = sep = value = null; - Match m = ValueOption.Match (argument); - if (!m.Success) { - return false; - } - flag = m.Groups ["flag"].Value; - name = m.Groups ["name"].Value; - if (m.Groups ["sep"].Success && m.Groups ["value"].Success) { - sep = m.Groups ["sep"].Value; - value = m.Groups ["value"].Value; - } - return true; - } - - protected virtual bool Parse (string argument, OptionContext c) - { - if (c.Option != null) { - ParseValue (argument, c); - return true; - } - - string f, n, s, v; - if (!GetOptionParts (argument, out f, out n, out s, out v)) - return false; - - Option p; - if (Contains (n)) { - p = this [n]; - c.OptionName = f + n; - c.Option = p; - switch (p.OptionValueType) { - case OptionValueType.None: - c.OptionValues.Add (n); - c.Option.Invoke (c); - break; - case OptionValueType.Optional: - case OptionValueType.Required: - ParseValue (v, c); - break; - } - return true; - } - // no match; is it a bool option? - if (ParseBool (argument, n, c)) - return true; - // is it a bundled option? - if (ParseBundledValue (f, string.Concat (n + s + v), c)) - return true; - - return false; - } - - private void ParseValue (string option, OptionContext c) - { - if (option != null) - foreach (string o in c.Option.ValueSeparators != null - ? option.Split (c.Option.ValueSeparators, StringSplitOptions.None) - : new string[]{option}) { - c.OptionValues.Add (o); - } - if (c.OptionValues.Count == c.Option.MaxValueCount || - c.Option.OptionValueType == OptionValueType.Optional) - c.Option.Invoke (c); - else if (c.OptionValues.Count > c.Option.MaxValueCount) { - throw new OptionException (localizer (string.Format ( - "Error: Found {0} option values when expecting {1}.", - c.OptionValues.Count, c.Option.MaxValueCount)), - c.OptionName); - } - } - - private bool ParseBool (string option, string n, OptionContext c) - { - Option p; - string rn; - if (n.Length >= 1 && (n [n.Length-1] == '+' || n [n.Length-1] == '-') && - Contains ((rn = n.Substring (0, n.Length-1)))) { - p = this [rn]; - string v = n [n.Length-1] == '+' ? option : null; - c.OptionName = option; - c.Option = p; - c.OptionValues.Add (v); - p.Invoke (c); - return true; - } - return false; - } - - private bool ParseBundledValue (string f, string n, OptionContext c) - { - if (f != "-") - return false; - for (int i = 0; i < n.Length; ++i) { - Option p; - string opt = f + n [i].ToString (); - string rn = n [i].ToString (); - if (!Contains (rn)) { - if (i == 0) - return false; - throw new OptionException (string.Format (localizer ( - "Cannot bundle unregistered option '{0}'."), opt), opt); - } - p = this [rn]; - switch (p.OptionValueType) { - case OptionValueType.None: - Invoke (c, opt, n, p); - break; - case OptionValueType.Optional: - case OptionValueType.Required: { - string v = n.Substring (i+1); - c.Option = p; - c.OptionName = opt; - ParseValue (v.Length != 0 ? v : null, c); - return true; - } - default: - throw new InvalidOperationException ("Unknown OptionValueType: " + p.OptionValueType); - } - } - return true; - } - - private static void Invoke (OptionContext c, string name, string value, Option option) - { - c.OptionName = name; - c.Option = option; - c.OptionValues.Add (value); - option.Invoke (c); - } - - private const int OptionWidth = 29; - - public void WriteOptionDescriptions (TextWriter o) - { - foreach (Option p in this) { - int written = 0; - if (!WriteOptionPrototype (o, p, ref written)) - continue; - - if (written < OptionWidth) - o.Write (new string (' ', OptionWidth - written)); - else { - o.WriteLine (); - o.Write (new string (' ', OptionWidth)); - } - - bool indent = false; - string prefix = new string (' ', OptionWidth+2); - foreach (string line in GetLines (localizer (GetDescription (p.Description)))) { - if (indent) - o.Write (prefix); - o.WriteLine (line); - indent = true; - } - } - } - - bool WriteOptionPrototype (TextWriter o, Option p, ref int written) - { - string[] names = p.Names; - - int i = GetNextOptionIndex (names, 0); - if (i == names.Length) - return false; - - if (names [i].Length == 1) { - Write (o, ref written, " -"); - Write (o, ref written, names [0]); - } - else { - Write (o, ref written, " --"); - Write (o, ref written, names [0]); - } - - for ( i = GetNextOptionIndex (names, i+1); - i < names.Length; i = GetNextOptionIndex (names, i+1)) { - Write (o, ref written, ", "); - Write (o, ref written, names [i].Length == 1 ? "-" : "--"); - Write (o, ref written, names [i]); - } - - if (p.OptionValueType == OptionValueType.Optional || - p.OptionValueType == OptionValueType.Required) { - if (p.OptionValueType == OptionValueType.Optional) { - Write (o, ref written, localizer ("[")); - } - Write (o, ref written, localizer ("=" + GetArgumentName (0, p.MaxValueCount, p.Description))); - string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0 - ? p.ValueSeparators [0] - : " "; - for (int c = 1; c < p.MaxValueCount; ++c) { - Write (o, ref written, localizer (sep + GetArgumentName (c, p.MaxValueCount, p.Description))); - } - if (p.OptionValueType == OptionValueType.Optional) { - Write (o, ref written, localizer ("]")); - } - } - return true; - } - - static int GetNextOptionIndex (string[] names, int i) - { - while (i < names.Length && names [i] == "<>") { - ++i; - } - return i; - } - - static void Write (TextWriter o, ref int n, string s) - { - n += s.Length; - o.Write (s); - } - - private static string GetArgumentName (int index, int maxIndex, string description) - { - if (description == null) - return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); - string[] nameStart; - if (maxIndex == 1) - nameStart = new string[]{"{0:", "{"}; - else - nameStart = new string[]{"{" + index + ":"}; - for (int i = 0; i < nameStart.Length; ++i) { - int start, j = 0; - do { - start = description.IndexOf (nameStart [i], j); - } while (start >= 0 && j != 0 ? description [j++ - 1] == '{' : false); - if (start == -1) - continue; - int end = description.IndexOf ("}", start); - if (end == -1) - continue; - return description.Substring (start + nameStart [i].Length, end - start - nameStart [i].Length); - } - return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); - } - - private static string GetDescription (string description) - { - if (description == null) - return string.Empty; - StringBuilder sb = new StringBuilder (description.Length); - int start = -1; - for (int i = 0; i < description.Length; ++i) { - switch (description [i]) { - case '{': - if (i == start) { - sb.Append ('{'); - start = -1; - } - else if (start < 0) - start = i + 1; - break; - case '}': - if (start < 0) { - if ((i+1) == description.Length || description [i+1] != '}') - throw new InvalidOperationException ("Invalid option description: " + description); - ++i; - sb.Append ("}"); - } - else { - sb.Append (description.Substring (start, i - start)); - start = -1; - } - break; - case ':': - if (start < 0) - goto default; - start = i + 1; - break; - default: - if (start < 0) - sb.Append (description [i]); - break; - } - } - return sb.ToString (); - } - - private static IEnumerable GetLines (string description) - { - if (string.IsNullOrEmpty (description)) { - yield return string.Empty; - yield break; - } - int length = 80 - OptionWidth - 1; - int start = 0, end; - do { - end = GetLineEnd (start, length, description); - char c = description [end-1]; - if (char.IsWhiteSpace (c)) - --end; - bool writeContinuation = end != description.Length && !IsEolChar (c); - string line = description.Substring (start, end - start) + - (writeContinuation ? "-" : ""); - yield return line; - start = end; - if (char.IsWhiteSpace (c)) - ++start; - length = 80 - OptionWidth - 2 - 1; - } while (end < description.Length); - } - - private static bool IsEolChar (char c) - { - return !char.IsLetterOrDigit (c); - } - - private static int GetLineEnd (int start, int length, string description) - { - int end = System.Math.Min (start + length, description.Length); - int sep = -1; - for (int i = start; i < end; ++i) { - if (description [i] == '\n') - return i+1; - if (IsEolChar (description [i])) - sep = i+1; - } - if (sep == -1 || end == description.Length) - return end; - return sep; - } - } -} - diff --git a/Touch.Server/Touch.Server.csproj b/Touch.Server/Touch.Server.csproj deleted file mode 100755 index 35f397044b4ddf3c2df7e7119516a39a05b140cd..0000000000000000000000000000000000000000 --- a/Touch.Server/Touch.Server.csproj +++ /dev/null @@ -1,40 +0,0 @@ - - - - Debug - iPhone - 10.0.0 - 2.0 - {A1303AE1-2693-4DF7-A17B-20C2ABA1E2ED} - Exe - Touch.Server - Touch.Server - - - true - full - false - bin\Debug - DEBUG;LINQ - prompt - 4 - true - - - none - false - bin\Release - prompt - 4 - true - LINQ - - - - - - - - - - \ No newline at end of file diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 846bb5964c6ed8c3ee9dcb5997201871bf70c3dd..0000000000000000000000000000000000000000 --- a/autogen.sh +++ /dev/null @@ -1,83 +0,0 @@ -#! /bin/sh - -PROJECT=NLua.Net40 -FILE= -CONFIGURE=configure.ac - -: ${AUTOCONF=autoconf} -: ${AUTOHEADER=autoheader} -: ${AUTOMAKE=automake} -: ${LIBTOOLIZE=libtoolize} -: ${ACLOCAL=aclocal} -: ${LIBTOOL=libtool} - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -ORIGDIR=`pwd` -cd $srcdir -TEST_TYPE=-f -aclocalinclude="-I . $ACLOCAL_FLAGS" - -DIE=0 - -($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $PROJECT." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have automake installed to compile $PROJECT." - echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4.tar.gz" - echo "(or a newer version if it is available)" - DIE=1 -} - -(grep "^AM_PROG_LIBTOOL" $CONFIGURE >/dev/null) && { - ($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`libtool' installed to compile $PROJECT." - echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz" - echo "(or a newer version if it is available)" - DIE=1 - } -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -#test $TEST_TYPE $FILE || { -# echo "You must run this script in the top-level $PROJECT directory" -# exit 1 -#} - -if test -z "$*"; then - echo "I am going to run ./configure with no arguments - if you wish " - echo "to pass any to it, please specify them on the $0 command line." -fi - -case $CC in -*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;; -esac - -(grep "^AM_PROG_LIBTOOL" $CONFIGURE >/dev/null) && { - echo "Running $LIBTOOLIZE ..." - $LIBTOOLIZE --force --copy -} - -echo "Running $ACLOCAL $aclocalinclude ..." -$ACLOCAL $aclocalinclude - -echo "Running $AUTOMAKE --gnu $am_opt ..." -$AUTOMAKE --add-missing --gnu $am_opt - -echo "Running $AUTOCONF ..." -$AUTOCONF - -echo Running $srcdir/configure $conf_flags "$@" ... -$srcdir/configure --enable-maintainer-mode $conf_flags "$@" \ diff --git a/build/Android/NLua.Android.csproj b/build/Android/NLua.Android.csproj new file mode 100644 index 0000000000000000000000000000000000000000..b29df04364ad6de4e32f9a7a8d1ecc1f9fd407a3 --- /dev/null +++ b/build/Android/NLua.Android.csproj @@ -0,0 +1,55 @@ + + + + Debug + AnyCPU + {4B766E88-5872-4437-882D-C887A3C0CDF7} + {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + NLua.Android + NLua + v8.1 + Assets + + + true + full + false + ..\..\lib\Debug\MonoAndroid + DEBUG;__MOBILE__;__ANDROID__ + prompt + 4 + None + + + true + + + true + pdbonly + true + ..\..\lib\Release\MonoAndroid + __MOBILE__;__ANDROID__ + prompt + 4 + true + false + + + true + + + + ..\..\packages\KeraLua.0.1.14\lib\MonoAndroid\KeraLua.dll + + + + + + + + + + + + \ No newline at end of file diff --git a/build/Android/packages.config b/build/Android/packages.config new file mode 100644 index 0000000000000000000000000000000000000000..8bc34ca60eff6d5b75214fc5b5b3977764b05c03 --- /dev/null +++ b/build/Android/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/build/TVOS/NLua.TVOS.csproj b/build/TVOS/NLua.TVOS.csproj new file mode 100644 index 0000000000000000000000000000000000000000..7ee44d424425915f45b6c2e8b5365223dc208f8c --- /dev/null +++ b/build/TVOS/NLua.TVOS.csproj @@ -0,0 +1,62 @@ + + + + Debug + AnyCPU + {9238F6AA-2D63-4804-99D1-C279871F5669} + {06FA79CB-D6CD-4721-BB4B-1BD202089C55};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + NLua + NLua + Resources + + + true + full + false + ..\..\lib\Debug\xamarintvos + DEBUG; + prompt + 4 + iPhone Developer + true + true + true + 16365 + false + + + + + true + + + pdbonly + true + ..\..\lib\Release\xamarintvos + + + prompt + 4 + iPhone Developer + true + SdkOnly + + + true + + + + ..\..\packages\KeraLua.0.1.14\lib\xamarintvos\KeraLua.dll + + + + + + + + + + + + \ No newline at end of file diff --git a/build/TVOS/packages.config b/build/TVOS/packages.config new file mode 100644 index 0000000000000000000000000000000000000000..9b4f48fa3f93aaed727ccd141bb49466a8ba88e7 --- /dev/null +++ b/build/TVOS/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/build/WatchOS/NLua.WatchOS.csproj b/build/WatchOS/NLua.WatchOS.csproj new file mode 100644 index 0000000000000000000000000000000000000000..0b4051eee6ac6b7236bb85622fc05b33994c96fc --- /dev/null +++ b/build/WatchOS/NLua.WatchOS.csproj @@ -0,0 +1,60 @@ + + + + Debug + AnyCPU + {BF6A650F-AA7A-4A08-8ADA-08D9E73E1238} + {FC940695-DFE0-4552-9F25-99AF4A5619A1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + NLua + NLua + Resources + + + true + full + false + ..\..\lib\Debug\xamarinwatchos + DEBUG; + prompt + 4 + iPhone Developer + true + true + true + 64617 + NSUrlSessionHandler + false + + + true + + + pdbonly + true + ..\..\lib\Release\xamarinwatchos + + + prompt + 4 + iPhone Developer + true + SdkOnly + NSUrlSessionHandler + true + + + + ..\..\packages\KeraLua.0.1.14\lib\xamarinwatchos\KeraLua.dll + + + + + + + + + + + + \ No newline at end of file diff --git a/build/WatchOS/packages.config b/build/WatchOS/packages.config new file mode 100644 index 0000000000000000000000000000000000000000..c2d18e5866fe58c13894cffd78a2b1888378be89 --- /dev/null +++ b/build/WatchOS/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/build/XamarinMac/NLua.XamarinMac.csproj b/build/XamarinMac/NLua.XamarinMac.csproj new file mode 100644 index 0000000000000000000000000000000000000000..496d9bb8fcdb33695125cb50e12fa4bfe578c73f --- /dev/null +++ b/build/XamarinMac/NLua.XamarinMac.csproj @@ -0,0 +1,72 @@ + + + + Debug + AnyCPU + {CFE2185E-C344-4503-9B94-9046744CEF37} + {A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + NLua + NLua + v2.0 + Xamarin.Mac + Resources + + + true + full + false + ..\..\lib\Debug\xamarinmac + DEBUG; + prompt + 4 + false + false + false + false + false + + + + + + + true + + + true + ..\..\lib\Release\xamarinmac + + + prompt + 4 + false + false + false + false + false + + + + + + + true + + + + ..\..\packages\KeraLua.0.1.14\lib\xamarinmac\KeraLua.dll + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/XamarinMac/packages.config b/build/XamarinMac/packages.config new file mode 100644 index 0000000000000000000000000000000000000000..5fc75df416a49a2525bdc88ec7bb6f50a257e2b0 --- /dev/null +++ b/build/XamarinMac/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/build/XamariniOS/NLua.XamariniOS.csproj b/build/XamariniOS/NLua.XamariniOS.csproj new file mode 100644 index 0000000000000000000000000000000000000000..d65fc97bd3f17f14ef392f6376ade1675aebbac3 --- /dev/null +++ b/build/XamariniOS/NLua.XamariniOS.csproj @@ -0,0 +1,66 @@ + + + + Debug + AnyCPU + {8FAFDF62-E07E-487A-863C-74F308AE7BA6} + {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + NLua + NLua + Resources + + + true + full + false + ..\..\lib\Debug\xamarinios + DEBUG; + prompt + 4 + iPhone Developer + true + true + true + 37816 + false + + + + + + + true + + + pdbonly + true + ..\..\lib\Release\xamarinios + + + prompt + 4 + iPhone Developer + true + SdkOnly + + + + + true + + + + ..\..\packages\KeraLua.0.1.14\lib\xamarinios\KeraLua.dll + + + + + + + + + + + + \ No newline at end of file diff --git a/build/XamariniOS/packages.config b/build/XamariniOS/packages.config new file mode 100644 index 0000000000000000000000000000000000000000..3de334b8a5f4544a409d952b217a0c61fa48cbb6 --- /dev/null +++ b/build/XamariniOS/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/build/net45/NLua.csproj b/build/net45/NLua.csproj new file mode 100644 index 0000000000000000000000000000000000000000..57411234bba278279c05e0a7dcd2dbe7495cc131 --- /dev/null +++ b/build/net45/NLua.csproj @@ -0,0 +1,52 @@ + + + + Debug + AnyCPU + {C45805A8-6436-4738-BD9F-4632EEA63BBC} + Library + NLua + NLua + v4.5 + + + + + + true + full + false + ..\..\lib\Debug\net45\ + DEBUG; + prompt + 4 + false + true + + + true + ..\..\lib\Release\net45\ + prompt + 4 + false + true + + + + ..\..\packages\KeraLua.0.1.14\lib\net45\KeraLua.dll + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/build/net45/NLua.csproj.user b/build/net45/NLua.csproj.user new file mode 100644 index 0000000000000000000000000000000000000000..6cbe5889c8d2e10479ce27d57f483d22fffbae16 --- /dev/null +++ b/build/net45/NLua.csproj.user @@ -0,0 +1,6 @@ + + + + ProjectFiles + + \ No newline at end of file diff --git a/build/net45/packages.config b/build/net45/packages.config new file mode 100644 index 0000000000000000000000000000000000000000..0c0f25f58a2e95b4bc6861fc788c8ae93cc2a9fa --- /dev/null +++ b/build/net45/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/build/netcore/NLua.NetCore.csproj b/build/netcore/NLua.NetCore.csproj new file mode 100644 index 0000000000000000000000000000000000000000..83eea7d9180916435adb36df49e79e750d5481ac --- /dev/null +++ b/build/netcore/NLua.NetCore.csproj @@ -0,0 +1,27 @@ + + + netcoreapp2.0 + NLua + NLua + false + + + + ..\..\lib\Release\netcore\ + TRACE;NETCOREAPP + true + + + + ..\..\lib\Debug\netcore\ + TRACE;NETCOREAPP + true + + + + + + + + + diff --git a/build/netstandard2.0/NLua.netstandard2.0.csproj b/build/netstandard2.0/NLua.netstandard2.0.csproj new file mode 100644 index 0000000000000000000000000000000000000000..81dbd0d9c1d5ef2b6e396c31e283c09d4fe1705f --- /dev/null +++ b/build/netstandard2.0/NLua.netstandard2.0.csproj @@ -0,0 +1,30 @@ + + + + netstandard2.0 + NLua + NLua + false + + + + ..\..\lib\Debug\ + TRACE;NETSTANDARD + true + + + + + ..\..\lib\Release\ + TRACE;NETSTANDARD + true + + + + + + + + + + \ No newline at end of file diff --git a/configure.ac b/configure.ac deleted file mode 100644 index d37d36b48ea8d7b5403774a06d253c7d08c013bb..0000000000000000000000000000000000000000 --- a/configure.ac +++ /dev/null @@ -1,119 +0,0 @@ -dnl Warning: This is an automatically generated file, do not edit! -dnl Process this file with autoconf to produce a configure script. -AC_PREREQ([2.54]) -AC_INIT([NLua.Net40], [2.x]) -AM_INIT_AUTOMAKE([foreign]) -AM_MAINTAINER_MODE - -dnl pkg-config -AC_PATH_PROG(PKG_CONFIG, pkg-config, no) -if test "x$PKG_CONFIG" = "xno"; then - AC_MSG_ERROR([You need to install pkg-config]) -fi - -SHAMROCK_EXPAND_LIBDIR -SHAMROCK_EXPAND_BINDIR -SHAMROCK_EXPAND_DATADIR - -AC_PROG_INSTALL - -AC_PATH_PROG(DMCS, dmcs, no) -if test "x$DMCS" = "xno"; then - AC_MSG_ERROR([dmcs Not found]) -fi - - -AC_ARG_ENABLE(debug, - AC_HELP_STRING([--enable-debug], - [Use 'DEBUG' Configuration [default=NO]]), - enable_debug=yes, enable_debug=no) -AM_CONDITIONAL(ENABLE_DEBUG, test x$enable_debug = xyes) -if test "x$enable_debug" = "xyes" ; then - CONFIG_REQUESTED="yes" -fi -AC_ARG_ENABLE(debugkopilua, - AC_HELP_STRING([--enable-debugkopilua], - [Use 'DEBUGKOPILUA' Configuration [default=NO]]), - enable_debugkopilua=yes, enable_debugkopilua=no) -AM_CONDITIONAL(ENABLE_DEBUGKOPILUA, test x$enable_debugkopilua = xyes) -if test "x$enable_debugkopilua" = "xyes" ; then - CONFIG_REQUESTED="yes" -fi -AC_ARG_ENABLE(release, - AC_HELP_STRING([--enable-release], - [Use 'RELEASE' Configuration [default=YES]]), - enable_release=yes, enable_release=no) -AM_CONDITIONAL(ENABLE_RELEASE, test x$enable_release = xyes) -if test "x$enable_release" = "xyes" ; then - CONFIG_REQUESTED="yes" -fi -AC_ARG_ENABLE(releasekopilua, - AC_HELP_STRING([--enable-releasekopilua], - [Use 'RELEASEKOPILUA' Configuration [default=NO]]), - enable_releasekopilua=yes, enable_releasekopilua=no) -AM_CONDITIONAL(ENABLE_RELEASEKOPILUA, test x$enable_releasekopilua = xyes) -if test "x$enable_releasekopilua" = "xyes" ; then - CONFIG_REQUESTED="yes" -fi -AC_ARG_ENABLE(debug_x64, - AC_HELP_STRING([--enable-debug_x64], - [Use 'DEBUG_X64' Configuration [default=NO]]), - enable_debug_x64=yes, enable_debug_x64=no) -AM_CONDITIONAL(ENABLE_DEBUG_X64, test x$enable_debug_x64 = xyes) -if test "x$enable_debug_x64" = "xyes" ; then - CONFIG_REQUESTED="yes" -fi -AC_ARG_ENABLE(release_x64, - AC_HELP_STRING([--enable-release_x64], - [Use 'RELEASE_X64' Configuration [default=NO]]), - enable_release_x64=yes, enable_release_x64=no) -AM_CONDITIONAL(ENABLE_RELEASE_X64, test x$enable_release_x64 = xyes) -if test "x$enable_release_x64" = "xyes" ; then - CONFIG_REQUESTED="yes" -fi -AC_ARG_ENABLE(debugkopilua_x64, - AC_HELP_STRING([--enable-debugkopilua_x64], - [Use 'DEBUGKOPILUA_X64' Configuration [default=NO]]), - enable_debugkopilua_x64=yes, enable_debugkopilua_x64=no) -AM_CONDITIONAL(ENABLE_DEBUGKOPILUA_X64, test x$enable_debugkopilua_x64 = xyes) -if test "x$enable_debugkopilua_x64" = "xyes" ; then - CONFIG_REQUESTED="yes" -fi -AC_ARG_ENABLE(releasekopilua_x64, - AC_HELP_STRING([--enable-releasekopilua_x64], - [Use 'RELEASEKOPILUA_X64' Configuration [default=NO]]), - enable_releasekopilua_x64=yes, enable_releasekopilua_x64=no) -AM_CONDITIONAL(ENABLE_RELEASEKOPILUA_X64, test x$enable_releasekopilua_x64 = xyes) -if test "x$enable_releasekopilua_x64" = "xyes" ; then - CONFIG_REQUESTED="yes" -fi -if test -z "$CONFIG_REQUESTED" ; then - AM_CONDITIONAL(ENABLE_RELEASE, true) - enable_release=yes -fi - - -dnl package checks, common for all configs - -dnl package checks, per config - - -AC_CONFIG_FILES([ -Core/KopiLua/KopiLua/kopilua.net40.pc -Core/KopiLua/KopiLua/Makefile -Core/KeraLua/src/keralua.net40.pc -Core/KeraLua/src/Makefile -Core/NLua/nlua.net40.pc -Core/NLua/Makefile -Core/Makefile -NLuaTest/nluatest.40.pc -NLuaTest/Makefile -ConsoleTest/consoletest.40 -ConsoleTest/Makefile -Applications/LuaRunner/nlua.40 -Applications/LuaRunner/Makefile -Makefile - -]) - -AC_OUTPUT diff --git a/doc/guide.pdf b/doc/guide.pdf deleted file mode 100644 index 15262411ce7fc326187860e805f260b91b71f252..0000000000000000000000000000000000000000 Binary files a/doc/guide.pdf and /dev/null differ diff --git a/expansions.m4 b/expansions.m4 deleted file mode 100644 index ba623565e4c3cdcda2020017a18caf92b19ba4a5..0000000000000000000000000000000000000000 --- a/expansions.m4 +++ /dev/null @@ -1,50 +0,0 @@ -AC_DEFUN([SHAMROCK_EXPAND_LIBDIR], -[ - expanded_libdir=`( - case $prefix in - NONE) prefix=$ac_default_prefix ;; - *) ;; - esac - case $exec_prefix in - NONE) exec_prefix=$prefix ;; - *) ;; - esac - eval echo $libdir - )` - AC_SUBST(expanded_libdir) -]) - -AC_DEFUN([SHAMROCK_EXPAND_BINDIR], -[ - expanded_bindir=`( - case $prefix in - NONE) prefix=$ac_default_prefix ;; - *) ;; - esac - case $exec_prefix in - NONE) exec_prefix=$prefix ;; - *) ;; - esac - eval echo $bindir - )` - AC_SUBST(expanded_bindir) -]) - -AC_DEFUN([SHAMROCK_EXPAND_DATADIR], -[ - case $prefix in - NONE) prefix=$ac_default_prefix ;; - *) ;; - esac - - case $exec_prefix in - NONE) exec_prefix=$prefix ;; - *) ;; - esac - - expanded_datadir=`(eval echo $datadir)` - expanded_datadir=`(eval echo $expanded_datadir)` - - AC_SUBST(expanded_datadir) -]) - diff --git a/Samples/CLRPackage.lua b/extras/examples/CLRPackage.lua similarity index 96% rename from Samples/CLRPackage.lua rename to extras/examples/CLRPackage.lua index 42159aaaab0d5de0706fc64063249ac3e8a3c5b2..a3d0366afd4fb96d6f5e6028bae45a81f82fc5e6 100644 --- a/Samples/CLRPackage.lua +++ b/extras/examples/CLRPackage.lua @@ -1,106 +1,106 @@ ---- ---- This lua module provides auto importing of .net classes into a named package. ---- Makes for super easy use of LuaInterface glue ---- ---- example: ---- Threading = CLRPackage("System", "System.Threading") ---- Threading.Thread.Sleep(100) ---- ---- Extensions: ---- import() is a version of CLRPackage() which puts the package into a list which is used by a global __index lookup, ---- and thus works rather like C#'s using statement. It also recognizes the case where one is importing a local ---- assembly, which must end with an explicit .dll extension. - ---- Alternatively, luanet.namespace can be used for convenience without polluting the global namespace: ---- local sys,sysi = luanet.namespace {'System','System.IO'} --- sys.Console.WriteLine("we are at {0}",sysi.Directory.GetCurrentDirectory()) - - --- LuaInterface hosted with stock Lua interpreter will need to explicitly require this... -if not luanet then require 'luanet' end - -local import_type, load_assembly = luanet.import_type, luanet.load_assembly - -local mt = { - --- Lookup a previously unfound class and add it to our table - __index = function(package, classname) - local class = rawget(package, classname) - if class == nil then - class = import_type(package.packageName .. "." .. classname) - package[classname] = class -- keep what we found around, so it will be shared - end - return class - end -} - -function luanet.namespace(ns) - if type(ns) == 'table' then - local res = {} - for i = 1,#ns do - res[i] = luanet.namespace(ns[i]) - end - return unpack(res) - end - -- FIXME - table.packageName could instead be a private index (see Lua 13.4.4) - local t = { packageName = ns } - setmetatable(t,mt) - return t -end - -local globalMT, packages - -local function set_global_mt() - packages = {} - globalMT = { - __index = function(T,classname) - for i,package in ipairs(packages) do - local class = package[classname] - if class then - _G[classname] = class - return class - end - end - end - } - setmetatable(_G, globalMT) -end - ---- Create a new Package class -function CLRPackage(assemblyName, packageName) - -- a sensible default... - packageName = packageName or assemblyName - local ok = pcall(load_assembly,assemblyName) -- Make sure our assembly is loaded - return luanet.namespace(packageName) -end - -function import (assemblyName, packageName) - if not globalMT then - set_global_mt() - end - if not packageName then - local i = assemblyName:find('%.dll$') - if i then packageName = assemblyName:sub(1,i-1) - else packageName = assemblyName end - end - local t = CLRPackage(assemblyName,packageName) - table.insert(packages,t) - return t -end - - -function luanet.make_array (tp,tbl) - local arr = tp[#tbl] - for i,v in ipairs(tbl) do - arr:SetValue(v,i-1) - end - return arr -end - -function luanet.each(o) - local e = o:GetEnumerator() - return function() - if e:MoveNext() then - return e.Current - end - end -end +--- +--- This lua module provides auto importing of .net classes into a named package. +--- Makes for super easy use of LuaInterface glue +--- +--- example: +--- Threading = CLRPackage("System", "System.Threading") +--- Threading.Thread.Sleep(100) +--- +--- Extensions: +--- import() is a version of CLRPackage() which puts the package into a list which is used by a global __index lookup, +--- and thus works rather like C#'s using statement. It also recognizes the case where one is importing a local +--- assembly, which must end with an explicit .dll extension. + +--- Alternatively, luanet.namespace can be used for convenience without polluting the global namespace: +--- local sys,sysi = luanet.namespace {'System','System.IO'} +-- sys.Console.WriteLine("we are at {0}",sysi.Directory.GetCurrentDirectory()) + + +-- LuaInterface hosted with stock Lua interpreter will need to explicitly require this... +if not luanet then require 'luanet' end + +local import_type, load_assembly = luanet.import_type, luanet.load_assembly + +local mt = { + --- Lookup a previously unfound class and add it to our table + __index = function(package, classname) + local class = rawget(package, classname) + if class == nil then + class = import_type(package.packageName .. "." .. classname) + package[classname] = class -- keep what we found around, so it will be shared + end + return class + end +} + +function luanet.namespace(ns) + if type(ns) == 'table' then + local res = {} + for i = 1,#ns do + res[i] = luanet.namespace(ns[i]) + end + return unpack(res) + end + -- FIXME - table.packageName could instead be a private index (see Lua 13.4.4) + local t = { packageName = ns } + setmetatable(t,mt) + return t +end + +local globalMT, packages + +local function set_global_mt() + packages = {} + globalMT = { + __index = function(T,classname) + for i,package in ipairs(packages) do + local class = package[classname] + if class then + _G[classname] = class + return class + end + end + end + } + setmetatable(_G, globalMT) +end + +--- Create a new Package class +function CLRPackage(assemblyName, packageName) + -- a sensible default... + packageName = packageName or assemblyName + local ok = pcall(load_assembly,assemblyName) -- Make sure our assembly is loaded + return luanet.namespace(packageName) +end + +function import (assemblyName, packageName) + if not globalMT then + set_global_mt() + end + if not packageName then + local i = assemblyName:find('%.dll$') + if i then packageName = assemblyName:sub(1,i-1) + else packageName = assemblyName end + end + local t = CLRPackage(assemblyName,packageName) + table.insert(packages,t) + return t +end + + +function luanet.make_array (tp,tbl) + local arr = tp[#tbl] + for i,v in ipairs(tbl) do + arr:SetValue(v,i-1) + end + return arr +end + +function luanet.each(o) + local e = o:GetEnumerator() + return function() + if e:MoveNext() then + return e.Current + end + end +end diff --git a/Samples/README.txt b/extras/examples/README.md similarity index 97% rename from Samples/README.txt rename to extras/examples/README.md index 2790fe807e2476cc89e5bbd02361b613249a9e5c..fe591d4c69f718b8888c0b033481f06bd5f5cafe 100644 --- a/Samples/README.txt +++ b/extras/examples/README.md @@ -1,7 +1,7 @@ -Some example scripts, showing what NLua can do. - -form A simple form, basic event handling -socket Fetches the content of a web site and prints to the - console -testluaform A more complex WinForms example, type some Lua code in - the textbox and run it, or load a Lua script. +Some example scripts, showing what NLua can do. + +form A simple form, basic event handling +socket Fetches the content of a web site and prints to the + console +testluaform A more complex WinForms example, type some Lua code in + the textbox and run it, or load a Lua script. diff --git a/Samples/com.lua b/extras/examples/com.lua similarity index 100% rename from Samples/com.lua rename to extras/examples/com.lua diff --git a/Samples/ctype.lua b/extras/examples/ctype.lua similarity index 100% rename from Samples/ctype.lua rename to extras/examples/ctype.lua diff --git a/Samples/error.lua b/extras/examples/error.lua similarity index 100% rename from Samples/error.lua rename to extras/examples/error.lua diff --git a/Samples/form.lua b/extras/examples/form.lua similarity index 96% rename from Samples/form.lua rename to extras/examples/form.lua index c159ab26b9b9e8741e8233a824e4ee74e1f072c2..07083ba6daf42cf4ce1ce87d8b1bbd62a31cfab7 100644 --- a/Samples/form.lua +++ b/extras/examples/form.lua @@ -1,36 +1,36 @@ --- kevinh - the following lines are part of our standard init --- require("compat-5.1") - -import("System.Windows.Forms") -import("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") -import("System.Drawing") - - -form1=Form() -button1=Button() -button2=Button() - -function handleClick(sender,data) - if sender.Text=="OK" then - sender.Text="Clicked" - else - sender.Text="OK" - end - button1.MouseUp:Remove(handler) - MessageBox.Show (sender:ToString()) -end - -button1.Text = "OK" -button1.Location=Point(10,10) -button2.Text = "Cancel" -button2.Location=Point(button1.Left, button1.Height + button1.Top + 10) -handler=button1.MouseUp:Add(handleClick) -form1.Text = "My Dialog Box" -form1.HelpButton = true -form1.MaximizeBox=false -form1.MinimizeBox=false -form1.AcceptButton = button1 -form1.CancelButton = button2 -form1.Controls:Add(button1) -form1.Controls:Add(button2) -form1:ShowDialog() +-- kevinh - the following lines are part of our standard init +-- require("compat-5.1") + +import("System.Windows.Forms") +import("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") +import("System.Drawing") + + +form1=Form() +button1=Button() +button2=Button() + +function handleClick(sender,data) + if sender.Text=="OK" then + sender.Text="Clicked" + else + sender.Text="OK" + end + button1.MouseUp:Remove(handler) + MessageBox.Show (sender:ToString()) +end + +button1.Text = "OK" +button1.Location=Point(10,10) +button2.Text = "Cancel" +button2.Location=Point(button1.Left, button1.Height + button1.Top + 10) +handler=button1.MouseUp:Add(handleClick) +form1.Text = "My Dialog Box" +form1.HelpButton = true +form1.MaximizeBox=false +form1.MinimizeBox=false +form1.AcceptButton = button1 +form1.CancelButton = button2 +form1.Controls:Add(button1) +form1.Controls:Add(button2) +form1:ShowDialog() diff --git a/Samples/form_alt.lua b/extras/examples/form_alt.lua similarity index 95% rename from Samples/form_alt.lua rename to extras/examples/form_alt.lua index 1a2aa28901d8d56d90eaa17b82761403b7e0c587..a349b22b44dd1ee9dde44c6818044b25eeafb475 100644 --- a/Samples/form_alt.lua +++ b/extras/examples/form_alt.lua @@ -1,36 +1,36 @@ ---require("compat-5.1") - -Forms=luanet.System.Windows.Forms - -Form=Forms.Form -Button=Forms.Button -Point=luanet.System.Drawing.Point - -form1=Form() -button1=Button() -button2=Button() - -function handleClick(sender,data) - if sender.Text=="OK" then - sender.Text="Clicked" - else - sender.Text="OK" - end - button1.MouseUp:Remove(handler) - print(sender:ToString()) -end - -button1.Text = "OK" -button1.Location=Point(10,10) -button2.Text = "Cancel" -button2.Location=Point(button1.Left, button1.Height + button1.Top + 10) -handler=button1.MouseUp:Add(handleClick) -form1.Text = "My Dialog Box" -form1.HelpButton = true -form1.MaximizeBox=false -form1.MinimizeBox=false -form1.AcceptButton = button1 -form1.CancelButton = button2 -form1.Controls:Add(button1) -form1.Controls:Add(button2) -form1:ShowDialog() +--require("compat-5.1") + +Forms=luanet.System.Windows.Forms + +Form=Forms.Form +Button=Forms.Button +Point=luanet.System.Drawing.Point + +form1=Form() +button1=Button() +button2=Button() + +function handleClick(sender,data) + if sender.Text=="OK" then + sender.Text="Clicked" + else + sender.Text="OK" + end + button1.MouseUp:Remove(handler) + print(sender:ToString()) +end + +button1.Text = "OK" +button1.Location=Point(10,10) +button2.Text = "Cancel" +button2.Location=Point(button1.Left, button1.Height + button1.Top + 10) +handler=button1.MouseUp:Add(handleClick) +form1.Text = "My Dialog Box" +form1.HelpButton = true +form1.MaximizeBox=false +form1.MinimizeBox=false +form1.AcceptButton = button1 +form1.CancelButton = button2 +form1.Controls:Add(button1) +form1.Controls:Add(button2) +form1:ShowDialog() diff --git a/Samples/gtk-list.lua b/extras/examples/gtk-list.lua similarity index 100% rename from Samples/gtk-list.lua rename to extras/examples/gtk-list.lua diff --git a/Samples/gui.glade b/extras/examples/gui.glade similarity index 97% rename from Samples/gui.glade rename to extras/examples/gui.glade index b1072ef6381754ef78f6473974b95d53c022b03c..6d9a568f47b68b2ba7e13c71cb3ca605cacd1dfe 100644 --- a/Samples/gui.glade +++ b/extras/examples/gui.glade @@ -1,88 +1,88 @@ - - - - - - - True - Glade Window - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - 256 - 256 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - 400 - 400 - 0 0 400 10 212.4 236 - 0 0 400 10 212.4 236 - - - - 38 - 17 - True - label1 - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 96 - 88 - - - - - - 60 - 27 - True - True - button1 - True - GTK_RELIEF_NORMAL - True - - - 88 - 168 - - - - - - - - - + + + + + + + True + Glade Window + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + 256 + 256 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + 400 + 400 + 0 0 400 10 212.4 236 + 0 0 400 10 212.4 236 + + + + 38 + 17 + True + label1 + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 96 + 88 + + + + + + 60 + 27 + True + True + button1 + True + GTK_RELIEF_NORMAL + True + + + 88 + 168 + + + + + + + + + diff --git a/Samples/hello-glade.lua b/extras/examples/hello-glade.lua similarity index 100% rename from Samples/hello-glade.lua rename to extras/examples/hello-glade.lua diff --git a/Samples/hello-gtk.lua b/extras/examples/hello-gtk.lua similarity index 100% rename from Samples/hello-gtk.lua rename to extras/examples/hello-gtk.lua diff --git a/Samples/hello1.lua b/extras/examples/hello1.lua similarity index 97% rename from Samples/hello1.lua rename to extras/examples/hello1.lua index 23d11d6725e9800a2346a296c9da1cf168746631..4b18b8e53974c289b680b351d8c2fbd33115dae1 100644 --- a/Samples/hello1.lua +++ b/extras/examples/hello1.lua @@ -1,7 +1,7 @@ -luanet.load_assembly "System" -Console = luanet.import_type "System.Console" -Math = luanet.import_type "System.Math" -Directory = luanet.import_type "System.IO.Directory" - -Console.WriteLine("we are at {0}",Directory.GetCurrentDirectory()) -Console.WriteLine("sqrt(2) is {0}",Math.Sqrt(2)) +luanet.load_assembly "System" +Console = luanet.import_type "System.Console" +Math = luanet.import_type "System.Math" +Directory = luanet.import_type "System.IO.Directory" + +Console.WriteLine("we are at {0}",Directory.GetCurrentDirectory()) +Console.WriteLine("sqrt(2) is {0}",Math.Sqrt(2)) diff --git a/Samples/hello2.lua b/extras/examples/hello2.lua similarity index 96% rename from Samples/hello2.lua rename to extras/examples/hello2.lua index 1b3a261039524d372ce122d795db95d4d05ec9e2..cd60841a11abf4ca1de6876e2d0a17e44774ebcf 100644 --- a/Samples/hello2.lua +++ b/extras/examples/hello2.lua @@ -1,3 +1,3 @@ -require 'CLRPackage' -import "System" -Console.WriteLine("sqrt(2) is {0}",Math.Sqrt(2)) +require 'CLRPackage' +import "System" +Console.WriteLine("sqrt(2) is {0}",Math.Sqrt(2)) diff --git a/Samples/hello3.lua b/extras/examples/hello3.lua similarity index 96% rename from Samples/hello3.lua rename to extras/examples/hello3.lua index ff8336fdfd4b742394fa64e552d68359cfc4b344..baeef36cbe633a8a20b81cb45f5f1c0ff81851f0 100644 --- a/Samples/hello3.lua +++ b/extras/examples/hello3.lua @@ -1,5 +1,5 @@ -#!/home/azisa/bin/luai -require 'CLRPackage' -import "System" -import "System.IO" -Console.WriteLine("we are at {0}",Directory.GetCurrentDirectory()) +#!/home/azisa/bin/luai +require 'CLRPackage' +import "System" +import "System.IO" +Console.WriteLine("we are at {0}",Directory.GetCurrentDirectory()) diff --git a/Samples/hello4.lua b/extras/examples/hello4.lua similarity index 97% rename from Samples/hello4.lua rename to extras/examples/hello4.lua index c877212a6d3b233242611ec87316df548477ebd9..3870088b999f42ce5ea28f37bee579717bfeff40 100644 --- a/Samples/hello4.lua +++ b/extras/examples/hello4.lua @@ -1,5 +1,5 @@ -#!/home/azisa/bin/luai ---- another variant of hello3: look, Ma, no globals! -require 'CLRPackage' -local sys,sysi = luanet.namespace {'System','System.IO'} -sys.Console.WriteLine("we are at {0}",sysi.Directory.GetCurrentDirectory()) +#!/home/azisa/bin/luai +--- another variant of hello3: look, Ma, no globals! +require 'CLRPackage' +local sys,sysi = luanet.namespace {'System','System.IO'} +sys.Console.WriteLine("we are at {0}",sysi.Directory.GetCurrentDirectory()) diff --git a/Samples/ilua.lua b/extras/examples/ilua.lua similarity index 100% rename from Samples/ilua.lua rename to extras/examples/ilua.lua diff --git a/Samples/lconsole.lua b/extras/examples/lconsole.lua similarity index 100% rename from Samples/lconsole.lua rename to extras/examples/lconsole.lua diff --git a/Samples/lua-gtk.lua b/extras/examples/lua-gtk.lua similarity index 100% rename from Samples/lua-gtk.lua rename to extras/examples/lua-gtk.lua diff --git a/Samples/lua.lua b/extras/examples/lua.lua similarity index 100% rename from Samples/lua.lua rename to extras/examples/lua.lua diff --git a/Samples/socket.lua b/extras/examples/socket.lua similarity index 95% rename from Samples/socket.lua rename to extras/examples/socket.lua index 4e64439b4ed09f99caf7546c37c7045455210662..7fd9d6f3533385bf0c1b7df086b2419d9b3e4a39 100644 --- a/Samples/socket.lua +++ b/extras/examples/socket.lua @@ -1,19 +1,19 @@ ---require("compat-5.1") - -luanet.load_assembly("System") - -WebClient=luanet.import_type("System.Net.WebClient") -StreamReader=luanet.import_type("System.IO.StreamReader") -Math=luanet.import_type("System.Math") - -print(Math:Pow(2,3)) - -myWebClient = WebClient() -myStream = myWebClient:OpenRead(arg[1]) -sr = StreamReader(myStream) -line=sr:ReadLine() -repeat - print(line) - line=sr:ReadLine() -until not line -myStream:Close() +--require("compat-5.1") + +luanet.load_assembly("System") + +WebClient=luanet.import_type("System.Net.WebClient") +StreamReader=luanet.import_type("System.IO.StreamReader") +Math=luanet.import_type("System.Math") + +print(Math:Pow(2,3)) + +myWebClient = WebClient() +myStream = myWebClient:OpenRead(arg[1]) +sr = StreamReader(myStream) +line=sr:ReadLine() +repeat + print(line) + line=sr:ReadLine() +until not line +myStream:Close() diff --git a/Samples/socket_alt.lua b/extras/examples/socket_alt.lua similarity index 94% rename from Samples/socket_alt.lua rename to extras/examples/socket_alt.lua index 03e6b8b845a3894c821a2ca0b8f82afb8c59672c..eded36c31b3d7c84ff9fc83b49286bd77ef11b5e 100644 --- a/Samples/socket_alt.lua +++ b/extras/examples/socket_alt.lua @@ -1,19 +1,19 @@ ---require("compat-5.1") - -System=luanet.System - -WebClient=System.Net.WebClient -StreamReader=System.IO.StreamReader -Math=System.Math - -print(Math:Pow(2,3)) - -myWebClient = WebClient() -myStream = myWebClient:OpenRead(arg[1]) -sr = StreamReader(myStream) -line=sr:ReadLine() -repeat - print(line) - line=sr:ReadLine() -until not line -myStream:Close() +--require("compat-5.1") + +System=luanet.System + +WebClient=System.Net.WebClient +StreamReader=System.IO.StreamReader +Math=System.Math + +print(Math:Pow(2,3)) + +myWebClient = WebClient() +myStream = myWebClient:OpenRead(arg[1]) +sr = StreamReader(myStream) +line=sr:ReadLine() +repeat + print(line) + line=sr:ReadLine() +until not line +myStream:Close() diff --git a/Samples/test-com.lua b/extras/examples/test-com.lua similarity index 100% rename from Samples/test-com.lua rename to extras/examples/test-com.lua diff --git a/Samples/testluaform.lua b/extras/examples/testluaform.lua similarity index 95% rename from Samples/testluaform.lua rename to extras/examples/testluaform.lua index 1e9439b7139bbfb471a04d6831022e8f5e68339f..c61ec10ff980ec4c34c0210184bf76b1dda6b177 100644 --- a/Samples/testluaform.lua +++ b/extras/examples/testluaform.lua @@ -1,122 +1,122 @@ -require("CLRPackage") - -Forms = CLRPackage("System.Windows.Forms", "System.Windows.Forms") -Drawing = CLRPackage("System.Drawing", "System.Drawing") -NLua = CLRPackage("NLua", "NLua") -IO = CLRPackage("System.IO", "System.IO") -System = CLRPackage("System", "System") - -Form=Forms.Form -TextBox=Forms.TextBox -Label=Forms.Label -ListBox=Forms.ListBox -Button=Forms.Button -Point=Drawing.Point -Size=Drawing.Size -Lua=NLua.Lua -OpenFileDialog=Forms.OpenFileDialog -File=IO.File -StreamReader=IO.StreamReader -FileMode=IO.FileMode -ScrollBars=Forms.ScrollBars -FormBorderStyle=Forms.FormBorderStyle -FormStartPosition=Forms.FormStartPosition - -function clear_click(sender,args) - code:Clear() -end - -function execute_click(sender,args) - results.Items:Clear() - result=lua:DoString(code.Text) - if result then - for i=0,result.Length-1 do - results.Items:Add(result[i]) - end - end -end - -function load_click(sender,args) - open_file:ShowDialog() - file=StreamReader(open_file.FileName) - code.Text=file:ReadToEnd() - file:Close() -end - -form = Form() -code = TextBox() -label1 = Label() -execute = Button() -clear = Button() -results = ListBox() -label2 = Label() -load = Button() -lua = Lua() ---lua:OpenBaseLib() -- steffenj: Open*Lib() functions no longer exist -open_file = OpenFileDialog() - -form:SuspendLayout() - -code.Location = Point(16, 24) -code.Multiline = true -code.Name = "Code" -code.Size = Size(440, 128) -code.ScrollBars = ScrollBars.Vertical -code.TabIndex = 0 -code.Text = "" - -label1.Location = Point(16, 8) -label1.Name = "label1" -label1.Size = Size(100, 16) -label1.TabIndex = 1 -label1.Text = "Lua Code:" - -execute.Location = Point(96, 160) -execute.Name = "Execute" -execute.TabIndex = 2 -execute.Text = "Execute" -execute.Click:Add(execute_click) - -clear.Location = Point(176, 160) -clear.Name = "Clear" -clear.TabIndex = 3 -clear.Text = "Clear" -clear.Click:Add(clear_click) - -results.Location = Point(16, 208) -results.Name = "Results" -results.Size = Size(440, 95) -results.TabIndex = 4 - -label2.Location = Point(16, 192) -label2.Name = "label2" -label2.Size = Size(100, 16) -label2.TabIndex = 5 -label2.Text = "Results:" - -load.Location = Point(16, 160) -load.Name = "Load" -load.TabIndex = 6 -load.Text = "Load..." -load.Click:Add(load_click) - -open_file.DefaultExt = "lua" -open_file.Filter = "Lua Scripts|*.lua|All Files|*.*" -open_file.Title = "Pick a File" - -form.AutoScaleBaseSize = Size(5, 13) -form.ClientSize = Size(472, 315) -form.Controls:Add(load) -form.Controls:Add(label2) -form.Controls:Add(results) -form.Controls:Add(clear) -form.Controls:Add(execute) -form.Controls:Add(label1) -form.Controls:Add(code) -form.Name = "MainForm" -form.Text = "LuaNet" -form.FormBorderStyle = FormBorderStyle.Fixed3D -form.StartPosition = FormStartPosition.CenterScreen -form:ResumeLayout(false) - -form:ShowDialog() +require("CLRPackage") + +Forms = CLRPackage("System.Windows.Forms", "System.Windows.Forms") +Drawing = CLRPackage("System.Drawing", "System.Drawing") +NLua = CLRPackage("NLua", "NLua") +IO = CLRPackage("System.IO", "System.IO") +System = CLRPackage("System", "System") + +Form=Forms.Form +TextBox=Forms.TextBox +Label=Forms.Label +ListBox=Forms.ListBox +Button=Forms.Button +Point=Drawing.Point +Size=Drawing.Size +Lua=NLua.Lua +OpenFileDialog=Forms.OpenFileDialog +File=IO.File +StreamReader=IO.StreamReader +FileMode=IO.FileMode +ScrollBars=Forms.ScrollBars +FormBorderStyle=Forms.FormBorderStyle +FormStartPosition=Forms.FormStartPosition + +function clear_click(sender,args) + code:Clear() +end + +function execute_click(sender,args) + results.Items:Clear() + result=lua:DoString(code.Text) + if result then + for i=0,result.Length-1 do + results.Items:Add(result[i]) + end + end +end + +function load_click(sender,args) + open_file:ShowDialog() + file=StreamReader(open_file.FileName) + code.Text=file:ReadToEnd() + file:Close() +end + +form = Form() +code = TextBox() +label1 = Label() +execute = Button() +clear = Button() +results = ListBox() +label2 = Label() +load = Button() +lua = Lua() +--lua:OpenBaseLib() -- steffenj: Open*Lib() functions no longer exist +open_file = OpenFileDialog() + +form:SuspendLayout() + +code.Location = Point(16, 24) +code.Multiline = true +code.Name = "Code" +code.Size = Size(440, 128) +code.ScrollBars = ScrollBars.Vertical +code.TabIndex = 0 +code.Text = "" + +label1.Location = Point(16, 8) +label1.Name = "label1" +label1.Size = Size(100, 16) +label1.TabIndex = 1 +label1.Text = "Lua Code:" + +execute.Location = Point(96, 160) +execute.Name = "Execute" +execute.TabIndex = 2 +execute.Text = "Execute" +execute.Click:Add(execute_click) + +clear.Location = Point(176, 160) +clear.Name = "Clear" +clear.TabIndex = 3 +clear.Text = "Clear" +clear.Click:Add(clear_click) + +results.Location = Point(16, 208) +results.Name = "Results" +results.Size = Size(440, 95) +results.TabIndex = 4 + +label2.Location = Point(16, 192) +label2.Name = "label2" +label2.Size = Size(100, 16) +label2.TabIndex = 5 +label2.Text = "Results:" + +load.Location = Point(16, 160) +load.Name = "Load" +load.TabIndex = 6 +load.Text = "Load..." +load.Click:Add(load_click) + +open_file.DefaultExt = "lua" +open_file.Filter = "Lua Scripts|*.lua|All Files|*.*" +open_file.Title = "Pick a File" + +form.AutoScaleBaseSize = Size(5, 13) +form.ClientSize = Size(472, 315) +form.Controls:Add(load) +form.Controls:Add(label2) +form.Controls:Add(results) +form.Controls:Add(clear) +form.Controls:Add(execute) +form.Controls:Add(label1) +form.Controls:Add(code) +form.Name = "MainForm" +form.Text = "LuaNet" +form.FormBorderStyle = FormBorderStyle.Fixed3D +form.StartPosition = FormStartPosition.CenterScreen +form:ResumeLayout(false) + +form:ShowDialog() diff --git a/Samples/testluaform_alt.lua b/extras/examples/testluaform_alt.lua similarity index 95% rename from Samples/testluaform_alt.lua rename to extras/examples/testluaform_alt.lua index 0560970dabc8aa6fd358addb3ddfb512b1b1738a..3644ed5c35639fba2c665cab1199cc1460916bb0 100644 --- a/Samples/testluaform_alt.lua +++ b/extras/examples/testluaform_alt.lua @@ -1,121 +1,121 @@ ---require("compat-5.1") - -Forms=luanet.System.Windows.Forms -Drawing=luanet.System.Drawing -NLua=luanet.NLua -IO=luanet.System.IO - -Form=Forms.Form -TextBox=Forms.TextBox -Label=Forms.Label -ListBox=Forms.ListBox -Button=Forms.Button -Point=Drawing.Point -Size=Drawing.Size -Lua=NLua.Lua -OpenFileDialog=Forms.OpenFileDialog -File=IO.File -StreamReader=IO.StreamReader -FileMode=IO.FileMode -ScrollBars=Forms.ScrollBars -FormBorderStyle=Forms.FormBorderStyle -FormStartPosition=Forms.FormStartPosition - -function clear_click(sender,args) - code:Clear() -end - -function execute_click(sender,args) - results.Items:Clear() - result=lua:DoString(code.Text) - if result then - for i=0,result.Length-1 do - results.Items:Add(result[i]) - end - end -end - -function load_click(sender,args) - open_file:ShowDialog() - file=StreamReader(open_file.FileName) - code.Text=file:ReadToEnd() - file:Close() -end - -form = Form() -code = TextBox() -label1 = Label() -execute = Button() -clear = Button() -results = ListBox() -label2 = Label() -load = Button() -lua = Lua() ---lua:OpenBaseLib() -- steffenj: Open*Lib() functions no longer exist -open_file = OpenFileDialog() - -form:SuspendLayout() - -code.Location = Point(16, 24) -code.Multiline = true -code.Name = "Code" -code.Size = Size(440, 128) -code.ScrollBars = ScrollBars.Vertical -code.TabIndex = 0 -code.Text = "" - -label1.Location = Point(16, 8) -label1.Name = "label1" -label1.Size = Size(100, 16) -label1.TabIndex = 1 -label1.Text = "Lua Code:" - -execute.Location = Point(96, 160) -execute.Name = "Execute" -execute.TabIndex = 2 -execute.Text = "Execute" -execute.Click:Add(execute_click) - -clear.Location = Point(176, 160) -clear.Name = "Clear" -clear.TabIndex = 3 -clear.Text = "Clear" -clear.Click:Add(clear_click) - -results.Location = Point(16, 208) -results.Name = "Results" -results.Size = Size(440, 95) -results.TabIndex = 4 - -label2.Location = Point(16, 192) -label2.Name = "label2" -label2.Size = Size(100, 16) -label2.TabIndex = 5 -label2.Text = "Results:" - -load.Location = Point(16, 160) -load.Name = "Load" -load.TabIndex = 6 -load.Text = "Load..." -load.Click:Add(load_click) - -open_file.DefaultExt = "lua" -open_file.Filter = "Lua Scripts|*.lua|All Files|*.*" -open_file.Title = "Pick a File" - -form.AutoScaleBaseSize = Size(5, 13) -form.ClientSize = Size(472, 315) -form.Controls:Add(load) -form.Controls:Add(label2) -form.Controls:Add(results) -form.Controls:Add(clear) -form.Controls:Add(execute) -form.Controls:Add(label1) -form.Controls:Add(code) -form.Name = "MainForm" -form.Text = "LuaNet" -form.FormBorderStyle = FormBorderStyle.Fixed3D -form.StartPosition = FormStartPosition.CenterScreen -form:ResumeLayout(false) - -form:ShowDialog() +--require("compat-5.1") + +Forms=luanet.System.Windows.Forms +Drawing=luanet.System.Drawing +NLua=luanet.NLua +IO=luanet.System.IO + +Form=Forms.Form +TextBox=Forms.TextBox +Label=Forms.Label +ListBox=Forms.ListBox +Button=Forms.Button +Point=Drawing.Point +Size=Drawing.Size +Lua=NLua.Lua +OpenFileDialog=Forms.OpenFileDialog +File=IO.File +StreamReader=IO.StreamReader +FileMode=IO.FileMode +ScrollBars=Forms.ScrollBars +FormBorderStyle=Forms.FormBorderStyle +FormStartPosition=Forms.FormStartPosition + +function clear_click(sender,args) + code:Clear() +end + +function execute_click(sender,args) + results.Items:Clear() + result=lua:DoString(code.Text) + if result then + for i=0,result.Length-1 do + results.Items:Add(result[i]) + end + end +end + +function load_click(sender,args) + open_file:ShowDialog() + file=StreamReader(open_file.FileName) + code.Text=file:ReadToEnd() + file:Close() +end + +form = Form() +code = TextBox() +label1 = Label() +execute = Button() +clear = Button() +results = ListBox() +label2 = Label() +load = Button() +lua = Lua() +--lua:OpenBaseLib() -- steffenj: Open*Lib() functions no longer exist +open_file = OpenFileDialog() + +form:SuspendLayout() + +code.Location = Point(16, 24) +code.Multiline = true +code.Name = "Code" +code.Size = Size(440, 128) +code.ScrollBars = ScrollBars.Vertical +code.TabIndex = 0 +code.Text = "" + +label1.Location = Point(16, 8) +label1.Name = "label1" +label1.Size = Size(100, 16) +label1.TabIndex = 1 +label1.Text = "Lua Code:" + +execute.Location = Point(96, 160) +execute.Name = "Execute" +execute.TabIndex = 2 +execute.Text = "Execute" +execute.Click:Add(execute_click) + +clear.Location = Point(176, 160) +clear.Name = "Clear" +clear.TabIndex = 3 +clear.Text = "Clear" +clear.Click:Add(clear_click) + +results.Location = Point(16, 208) +results.Name = "Results" +results.Size = Size(440, 95) +results.TabIndex = 4 + +label2.Location = Point(16, 192) +label2.Name = "label2" +label2.Size = Size(100, 16) +label2.TabIndex = 5 +label2.Text = "Results:" + +load.Location = Point(16, 160) +load.Name = "Load" +load.TabIndex = 6 +load.Text = "Load..." +load.Click:Add(load_click) + +open_file.DefaultExt = "lua" +open_file.Filter = "Lua Scripts|*.lua|All Files|*.*" +open_file.Title = "Pick a File" + +form.AutoScaleBaseSize = Size(5, 13) +form.ClientSize = Size(472, 315) +form.Controls:Add(load) +form.Controls:Add(label2) +form.Controls:Add(results) +form.Controls:Add(clear) +form.Controls:Add(execute) +form.Controls:Add(label1) +form.Controls:Add(code) +form.Name = "MainForm" +form.Text = "LuaNet" +form.FormBorderStyle = FormBorderStyle.Fixed3D +form.StartPosition = FormStartPosition.CenterScreen +form:ResumeLayout(false) + +form:ShowDialog() diff --git a/NLuaCommand.gif b/extras/screenshot/NLuaCommand.gif similarity index 100% rename from NLuaCommand.gif rename to extras/screenshot/NLuaCommand.gif diff --git a/ios/NLuaTestsiOS/Icons/Icon-72.png b/ios/NLuaTestsiOS/Icons/Icon-72.png deleted file mode 100644 index 5d70b6aa6cfa5f55664dc01d76783730546269c9..0000000000000000000000000000000000000000 Binary files a/ios/NLuaTestsiOS/Icons/Icon-72.png and /dev/null differ diff --git a/ios/NLuaTestsiOS/Icons/Icon-72@2x.png b/ios/NLuaTestsiOS/Icons/Icon-72@2x.png deleted file mode 100644 index ed164ab5e37524a461cfe1a78d8f2277d999f6e5..0000000000000000000000000000000000000000 Binary files a/ios/NLuaTestsiOS/Icons/Icon-72@2x.png and /dev/null differ diff --git a/ios/NLuaTestsiOS/Icons/Icon-Small-50.png b/ios/NLuaTestsiOS/Icons/Icon-Small-50.png deleted file mode 100644 index ade1920d069c5153e29fcc7adb0bb119b4ba689e..0000000000000000000000000000000000000000 Binary files a/ios/NLuaTestsiOS/Icons/Icon-Small-50.png and /dev/null differ diff --git a/ios/NLuaTestsiOS/Icons/Icon-Small-50@2x.png b/ios/NLuaTestsiOS/Icons/Icon-Small-50@2x.png deleted file mode 100644 index 8340fd2e69e676b59e660c6bc852717cbee9ff65..0000000000000000000000000000000000000000 Binary files a/ios/NLuaTestsiOS/Icons/Icon-Small-50@2x.png and /dev/null differ diff --git a/ios/NLuaTestsiOS/Icons/Icon-Small.png b/ios/NLuaTestsiOS/Icons/Icon-Small.png deleted file mode 100644 index 3793fdf233e0096cf785e1b58f2a26a2e42c9fd0..0000000000000000000000000000000000000000 Binary files a/ios/NLuaTestsiOS/Icons/Icon-Small.png and /dev/null differ diff --git a/ios/NLuaTestsiOS/Icons/Icon-Small@2x.png b/ios/NLuaTestsiOS/Icons/Icon-Small@2x.png deleted file mode 100644 index 21b358c8a681fcaa57f1b9323a27dea2413d8a8d..0000000000000000000000000000000000000000 Binary files a/ios/NLuaTestsiOS/Icons/Icon-Small@2x.png and /dev/null differ diff --git a/ios/NLuaTestsiOS/Icons/Icon.png b/ios/NLuaTestsiOS/Icons/Icon.png deleted file mode 100644 index 5a35105b313230ff78e783ca88129f17a66081c2..0000000000000000000000000000000000000000 Binary files a/ios/NLuaTestsiOS/Icons/Icon.png and /dev/null differ diff --git a/ios/NLuaTestsiOS/Icons/Icon@2x.png b/ios/NLuaTestsiOS/Icons/Icon@2x.png deleted file mode 100644 index 5b7b4b93503da83e837b03f3c6d835a452e3072a..0000000000000000000000000000000000000000 Binary files a/ios/NLuaTestsiOS/Icons/Icon@2x.png and /dev/null differ diff --git a/ios/NLuaTestsiOS/Icons/iTunesArtwork.png b/ios/NLuaTestsiOS/Icons/iTunesArtwork.png deleted file mode 100644 index 05d25ba940433f27044007e8cbd0d2d1c0c45396..0000000000000000000000000000000000000000 Binary files a/ios/NLuaTestsiOS/Icons/iTunesArtwork.png and /dev/null differ diff --git a/ios/NLuaTestsiOS/Icons/iTunesArtwork@2x.png b/ios/NLuaTestsiOS/Icons/iTunesArtwork@2x.png deleted file mode 100644 index e032813ff6074edbd4c88c0d1385bb08446b7611..0000000000000000000000000000000000000000 Binary files a/ios/NLuaTestsiOS/Icons/iTunesArtwork@2x.png and /dev/null differ diff --git a/ios/NLuaTestsiOS/Info.plist b/ios/NLuaTestsiOS/Info.plist deleted file mode 100644 index 72fb689b0163c665e7ef87b23a56bdedea48a5d9..0000000000000000000000000000000000000000 --- a/ios/NLuaTestsiOS/Info.plist +++ /dev/null @@ -1,51 +0,0 @@ - - - - - CFBundleDisplayName - NLuaTest - CFBundleIdentifier - org.nlua.nluatest - MinimumOSVersion - 7.1 - UIDeviceFamily - - 1 - 2 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - CFBundleVersion - 1.0 - CFBundleIconFiles - - Icons/Icon-Small@2x - Icons/Icon - Icons/Icon@2x - Icons/Icon-72 - Icons/Icon-72@2x - Icons/Icon-Small - Icons/Icon-Small-50 - Icons/Icon-Small-50@2x - - UIPrerenderedIcon - - NSMainNibFile - - NSMainNibFile~ipad - - MKDirectionsApplicationSupportedModes - - - diff --git a/ios/NLuaTestsiOS/Main.cs b/ios/NLuaTestsiOS/Main.cs deleted file mode 100644 index 37caab239b5dc92e47c8a7b0930987da2a83bfbe..0000000000000000000000000000000000000000 --- a/ios/NLuaTestsiOS/Main.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using Foundation; -using UIKit; - -namespace NLuaTestsiOS -{ - public class Application - { - // This is the main entry point of the application. - static void Main (string[] args) - { - // if you want to use a different Application Delegate class from "UnitTestAppDelegate" - // you can specify it here. - UIApplication.Main (args, null, "UnitTestAppDelegate"); - } - } -} diff --git a/ios/NLuaTestsiOS/NLuaTest.csproj b/ios/NLuaTestsiOS/NLuaTest.csproj deleted file mode 100644 index 30d854449d64058bd6909e976f67c0e0117f3bc7..0000000000000000000000000000000000000000 --- a/ios/NLuaTestsiOS/NLuaTest.csproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - Debug - iPhoneSimulator - {2DC0E43A-21B8-41FF-8793-60AB50350977} - {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Exe - NLuaTest - Resources - NLuaTest - Xamarin.iOS - v1.0 - - - True - full - False - bin\iPhoneSimulator\Debug - DEBUG;MONOTOUCH - prompt - 4 - False - True - None - - - x86_64 - true - iPhone Developer - - - none - True - bin\iPhoneSimulator\Release - prompt - 4 - False - - - x86_64 - True - True - True - MONOTOUCH - None - - - True - full - False - bin\iPhone\Debug - DEBUG;MONOTOUCH - prompt - 4 - False - iPhone Developer - True - - - ARMv7, ARM64 - None - - - none - True - bin\iPhone\Release - prompt - 4 - False - iPhone Developer - - - - - ARMv7, ARM64 - True - MONOTOUCH - True - True - True - None - - - none - True - bin\iPhone\Ad-Hoc - prompt - 4 - True - False - Automatic:AdHoc - iPhone Distribution - - - - - ARMv7, ARM64 - true - - - none - True - bin\iPhone\AppStore - prompt - 4 - False - iPhone Distribution - Automatic:AppStore - - - ARMv7, ARM64 - true - - - - - - - - - - - - - Resources\test_32.luac - - - - Resources\test_64.luac - - - - - - - Entity.cs - - - LuaTests.cs - - - TestLua.cs - - - Core.cs - - - - LoadFileTests.cs - - - - - - {7064B157-DD57-4828-94C5-CA149B25CB40} - NLua.iOS - - - {3F57C208-AA13-4B67-B3E7-ED41307F00A0} - KeraLua.iOS - - - - - test.lua - - - - - - - - - - - LuaTests\core\bisect.lua - - - LuaTests\core\cf.lua - - - LuaTests\core\env.lua - - - LuaTests\core\factorial.lua - - - LuaTests\core\fib.lua - - - LuaTests\core\fibfor.lua - - - LuaTests\core\life.lua - - - LuaTests\core\printf.lua - - - LuaTests\core\readonly.lua - - - LuaTests\core\sieve.lua - - - LuaTests\core\sort.lua - - - LuaTests\core\trace-globals.lua - - - - - - - \ No newline at end of file diff --git a/ios/NLuaTestsiOS/NLuaTests.cs b/ios/NLuaTestsiOS/NLuaTests.cs deleted file mode 100644 index 10feb2dec80e6cf1f6b378b3fbbc585937c07789..0000000000000000000000000000000000000000 --- a/ios/NLuaTestsiOS/NLuaTests.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using NUnit.Framework; -using NLua; - -using NLuaTest.Mock; - -#if MONOTOUCH -using Foundation; -using MonoTouch; -#endif - -namespace NLuaTest -{ - [TestFixture] - #if MONOTOUCH - [Preserve (AllMembers = true)] - #endif - public class ANLuaTests - { - /* - * Tests capturing an exception - */ - [Test] - public void TestCLRPackage () - { - using (Lua lua = new Lua ()) { - lua.LoadCLRPackage (); - - lua.DoString ("import ('NLuaTest', 'NLuaTest.Mock') "); - lua.DoString ("test = TestClass()"); - lua.DoString ("test:setVal(3)"); - object[] res = lua.DoString ("return test"); - TestClass test = (TestClass)res [0]; - Assert.AreEqual (3, test.testval); - } - } - -#if MONOTOUCH - [Test] - public void TestUseNSUrl () - { - using (Lua lua = new Lua ()) { - lua.LoadCLRPackage (); - - lua.DoString ("import ('Xamarin.iOS', 'Foundation') "); - lua.DoString ("testURL = NSUrl('http://nlua.org/?query=param')"); - lua.DoString ("host = testURL.Host"); - - object res = lua["host"]; - string host = (string)res; - Assert.AreEqual ("nlua.org", host); - } - } -#endif - } -} - diff --git a/ios/NLuaTestsiOS/UnitTestAppDelegate.cs b/ios/NLuaTestsiOS/UnitTestAppDelegate.cs deleted file mode 100644 index 5c5cc2faecd49fd41e1eb3c3dc4702367f294550..0000000000000000000000000000000000000000 --- a/ios/NLuaTestsiOS/UnitTestAppDelegate.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using Foundation; -using UIKit; -using MonoTouch.NUnit.UI; - -namespace NLuaTestsiOS -{ - // The UIApplicationDelegate for the application. This class is responsible for launching the - // User Interface of the application, as well as listening (and optionally responding) to - // application events from iOS. - [Register ("UnitTestAppDelegate")] - public partial class UnitTestAppDelegate : UIApplicationDelegate - { - // class-level declarations - UIWindow window; - TouchRunner runner; - - // - // This method is invoked when the application has loaded and is ready to run. In this - // method you should instantiate the window, load the UI into it and then make the window - // visible. - // - // You have 17 seconds to return from this method, or iOS will terminate your application. - // - public override bool FinishedLaunching (UIApplication app, NSDictionary options) - { - // create a new window instance based on the screen size - window = new UIWindow (UIScreen.MainScreen.Bounds); - runner = new TouchRunner (window); - //runner.AutoStart = true; - runner.TerminateAfterExecution = true; - // register every tests included in the main application/assembly - runner.Add (System.Reflection.Assembly.GetExecutingAssembly ()); - - window.RootViewController = new UINavigationController (runner.GetViewController ()); - - // make the window visible - window.MakeKeyAndVisible (); - - return true; - } - } -} - diff --git a/ios/NLuaTestsiOS/iTunesArtwork b/ios/NLuaTestsiOS/iTunesArtwork deleted file mode 100644 index 05d25ba940433f27044007e8cbd0d2d1c0c45396..0000000000000000000000000000000000000000 Binary files a/ios/NLuaTestsiOS/iTunesArtwork and /dev/null differ diff --git a/ios/NLuaTestsiOS/iTunesArtwork@2x b/ios/NLuaTestsiOS/iTunesArtwork@2x deleted file mode 100644 index e032813ff6074edbd4c88c0d1385bb08446b7611..0000000000000000000000000000000000000000 Binary files a/ios/NLuaTestsiOS/iTunesArtwork@2x and /dev/null differ diff --git a/lib/nunit/nunit.framework.dll b/lib/nunit/nunit.framework.dll deleted file mode 100644 index 3e24ba1ca6260d7d0499624d13d2c5a2cd75b52a..0000000000000000000000000000000000000000 Binary files a/lib/nunit/nunit.framework.dll and /dev/null differ diff --git a/lib/nunit/nunit.framework.xml b/lib/nunit/nunit.framework.xml deleted file mode 100644 index 7702ceebb5f2583a2b80f3490d7284f108630648..0000000000000000000000000000000000000000 --- a/lib/nunit/nunit.framework.xml +++ /dev/null @@ -1,10899 +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. Use - ExpectedResult by preference. - - The result. - - - - Gets or sets 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 data source, which must - be a property, field or method of the test class itself. - - An array of the names of the factories that will provide data - - - - Construct with a Type, which must implement IEnumerable - - The Type that will provide data - - - - Construct with a Type and name. - 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/lib/nunit/nunit.mocks.dll b/lib/nunit/nunit.mocks.dll deleted file mode 100644 index dda3e9e92108eb1dcf82d26804ffd4d72d9e5286..0000000000000000000000000000000000000000 Binary files a/lib/nunit/nunit.mocks.dll and /dev/null differ diff --git a/lib/nunit/pnunit.framework.dll b/lib/nunit/pnunit.framework.dll deleted file mode 100644 index ae07067159b70c3950a91aa66f7279295a1d87e4..0000000000000000000000000000000000000000 Binary files a/lib/nunit/pnunit.framework.dll and /dev/null differ diff --git a/nuget.package/NLua.nuspec b/nuget.package/NLua.nuspec deleted file mode 100644 index 3076a8968f46a4a915cc7695008b3beb0b8684ff..0000000000000000000000000000000000000000 --- a/nuget.package/NLua.nuspec +++ /dev/null @@ -1,61 +0,0 @@ - - - - NLua - 1.2.2.14 - NLua is the bind between Lua and the .NET - viniciusjarina - viniciusjarina - http://nlua.org - https://secure.gravatar.com/avatar/77ecf0fb9d8419be7715c6e822e66562?s=32 - false - NLua Package. - NLua allow use Lua from C#, using Windows, Linux, Mac, iOS , Android, Windows Phone 7 and Windows Phone 8. - NLua 1.2.0 -Port to Android 15+ (armeabi, v7a, x86) -Updated Lua 5.2.2 (patch 7) -Lot of Bug fixes. -NLua 1.1.0 -Port to WP7 (Thanks to Mangatome) -NLua now using Lua 5.2.2 -Bug fixes. - Copyright (c) 2014 Vinicius Jarina (viniciusjarina@gmail.com) - - Lua Script NLua LuaInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/nuget.package/tools/net35/GetLibLuaPostBuildCmd.ps1 b/nuget.package/tools/net35/GetLibLuaPostBuildCmd.ps1 deleted file mode 100644 index 5630557a443d9764b2324998cc51d44f8cd13eaf..0000000000000000000000000000000000000000 --- a/nuget.package/tools/net35/GetLibLuaPostBuildCmd.ps1 +++ /dev/null @@ -1,15 +0,0 @@ - -if ([System.IntPtr]::Size -eq 8) { - $arch = "x64\*.*" -} elseif (([System.IntPtr]::Size -eq 4) -and (Test-Path Env:\PROCESSOR_ARCHITEW6432)) { - $arch = "x64\*.*" -} elseif ([System.IntPtr]::Size -eq 4) { - $arch = "x86\*.*" -} - -$nativePath = $(Join-Path $installPath "lib\native") -$nativePath = $(Join-Path $nativePath $arch) - - -$LibLuaPostBuildCmd = " -xcopy /s /y `"$nativePath`" `"`$(TargetDir)`"" diff --git a/nuget.package/tools/net35/install.ps1 b/nuget.package/tools/net35/install.ps1 deleted file mode 100644 index 92205b4566fad59995c4b5cbb7208bf1f1244dad..0000000000000000000000000000000000000000 --- a/nuget.package/tools/net35/install.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -param($installPath, $toolsPath, $package, $project) - -. (Join-Path $toolsPath "GetLibLuaPostBuildCmd.ps1") - -# Get the current Post Build Event cmd -$currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value - - -# Append our post build command if it's not already there -if (!$currentPostBuildCmd.Contains($LibLuaPostBuildCmd)) { - $project.Properties.Item("PostBuildEvent").Value += $LibLuaPostBuildCmd -} \ No newline at end of file diff --git a/nuget.package/tools/net35/uninstall.ps1 b/nuget.package/tools/net35/uninstall.ps1 deleted file mode 100644 index 50e99acdc487aabc18f165544f19cdef15747f92..0000000000000000000000000000000000000000 --- a/nuget.package/tools/net35/uninstall.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -param($installPath, $toolsPath, $package, $project) - -. (Join-Path $toolsPath "GetLibLuaPostBuildCmd.ps1") - -# Get the current Post Build Event cmd -$currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value - -# Remove our post build command from it (if it's there) -$project.Properties.Item("PostBuildEvent").Value = $currentPostBuildCmd.Replace($LibLuaPostBuildCmd, "") \ No newline at end of file diff --git a/nuget.package/tools/net40/GetLibLuaPostBuildCmd.ps1 b/nuget.package/tools/net40/GetLibLuaPostBuildCmd.ps1 deleted file mode 100644 index 5630557a443d9764b2324998cc51d44f8cd13eaf..0000000000000000000000000000000000000000 --- a/nuget.package/tools/net40/GetLibLuaPostBuildCmd.ps1 +++ /dev/null @@ -1,15 +0,0 @@ - -if ([System.IntPtr]::Size -eq 8) { - $arch = "x64\*.*" -} elseif (([System.IntPtr]::Size -eq 4) -and (Test-Path Env:\PROCESSOR_ARCHITEW6432)) { - $arch = "x64\*.*" -} elseif ([System.IntPtr]::Size -eq 4) { - $arch = "x86\*.*" -} - -$nativePath = $(Join-Path $installPath "lib\native") -$nativePath = $(Join-Path $nativePath $arch) - - -$LibLuaPostBuildCmd = " -xcopy /s /y `"$nativePath`" `"`$(TargetDir)`"" diff --git a/nuget.package/tools/net40/install.ps1 b/nuget.package/tools/net40/install.ps1 deleted file mode 100644 index 92205b4566fad59995c4b5cbb7208bf1f1244dad..0000000000000000000000000000000000000000 --- a/nuget.package/tools/net40/install.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -param($installPath, $toolsPath, $package, $project) - -. (Join-Path $toolsPath "GetLibLuaPostBuildCmd.ps1") - -# Get the current Post Build Event cmd -$currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value - - -# Append our post build command if it's not already there -if (!$currentPostBuildCmd.Contains($LibLuaPostBuildCmd)) { - $project.Properties.Item("PostBuildEvent").Value += $LibLuaPostBuildCmd -} \ No newline at end of file diff --git a/nuget.package/tools/net40/uninstall.ps1 b/nuget.package/tools/net40/uninstall.ps1 deleted file mode 100644 index 50e99acdc487aabc18f165544f19cdef15747f92..0000000000000000000000000000000000000000 --- a/nuget.package/tools/net40/uninstall.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -param($installPath, $toolsPath, $package, $project) - -. (Join-Path $toolsPath "GetLibLuaPostBuildCmd.ps1") - -# Get the current Post Build Event cmd -$currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value - -# Remove our post build command from it (if it's there) -$project.Properties.Item("PostBuildEvent").Value = $currentPostBuildCmd.Replace($LibLuaPostBuildCmd, "") \ No newline at end of file diff --git a/nuget.package/tools/net45/GetLibLuaPostBuildCmd.ps1 b/nuget.package/tools/net45/GetLibLuaPostBuildCmd.ps1 deleted file mode 100644 index 5630557a443d9764b2324998cc51d44f8cd13eaf..0000000000000000000000000000000000000000 --- a/nuget.package/tools/net45/GetLibLuaPostBuildCmd.ps1 +++ /dev/null @@ -1,15 +0,0 @@ - -if ([System.IntPtr]::Size -eq 8) { - $arch = "x64\*.*" -} elseif (([System.IntPtr]::Size -eq 4) -and (Test-Path Env:\PROCESSOR_ARCHITEW6432)) { - $arch = "x64\*.*" -} elseif ([System.IntPtr]::Size -eq 4) { - $arch = "x86\*.*" -} - -$nativePath = $(Join-Path $installPath "lib\native") -$nativePath = $(Join-Path $nativePath $arch) - - -$LibLuaPostBuildCmd = " -xcopy /s /y `"$nativePath`" `"`$(TargetDir)`"" diff --git a/nuget.package/tools/net45/install.ps1 b/nuget.package/tools/net45/install.ps1 deleted file mode 100644 index 92205b4566fad59995c4b5cbb7208bf1f1244dad..0000000000000000000000000000000000000000 --- a/nuget.package/tools/net45/install.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -param($installPath, $toolsPath, $package, $project) - -. (Join-Path $toolsPath "GetLibLuaPostBuildCmd.ps1") - -# Get the current Post Build Event cmd -$currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value - - -# Append our post build command if it's not already there -if (!$currentPostBuildCmd.Contains($LibLuaPostBuildCmd)) { - $project.Properties.Item("PostBuildEvent").Value += $LibLuaPostBuildCmd -} \ No newline at end of file diff --git a/nuget.package/tools/net45/uninstall.ps1 b/nuget.package/tools/net45/uninstall.ps1 deleted file mode 100644 index 50e99acdc487aabc18f165544f19cdef15747f92..0000000000000000000000000000000000000000 --- a/nuget.package/tools/net45/uninstall.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -param($installPath, $toolsPath, $package, $project) - -. (Join-Path $toolsPath "GetLibLuaPostBuildCmd.ps1") - -# Get the current Post Build Event cmd -$currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value - -# Remove our post build command from it (if it's there) -$project.Properties.Item("PostBuildEvent").Value = $currentPostBuildCmd.Replace($LibLuaPostBuildCmd, "") \ No newline at end of file diff --git a/packages/KeraLua.0.1.14/.signature.p7s b/packages/KeraLua.0.1.14/.signature.p7s new file mode 100644 index 0000000000000000000000000000000000000000..ba77d9f7c0bf80541dd254df2617897b7c58c28d Binary files /dev/null and b/packages/KeraLua.0.1.14/.signature.p7s differ diff --git a/packages/KeraLua.0.1.14/KeraLua.0.1.14.nupkg b/packages/KeraLua.0.1.14/KeraLua.0.1.14.nupkg new file mode 100644 index 0000000000000000000000000000000000000000..5937ca69f93fe34bac6281fa74a9729963d99846 Binary files /dev/null and b/packages/KeraLua.0.1.14/KeraLua.0.1.14.nupkg differ diff --git a/packages/KeraLua.0.1.14/LICENSE b/packages/KeraLua.0.1.14/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..eebc41670061ebcf09b9e462dd86bea6339adde7 --- /dev/null +++ b/packages/KeraLua.0.1.14/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2019 Vinicius Jarina (viniciusjarina@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/KeraLua.0.1.14/build/net45/KeraLua.targets b/packages/KeraLua.0.1.14/build/net45/KeraLua.targets new file mode 100644 index 0000000000000000000000000000000000000000..8f9c7d4640b57f2c3f3f414f0722b118a0104ecc --- /dev/null +++ b/packages/KeraLua.0.1.14/build/net45/KeraLua.targets @@ -0,0 +1,71 @@ + + + + + + + True + + + + + + $(PlatformTarget) + + x64 + x86 + + x64 + + x86 + + + + + $(MSBuildThisFileDirectory)..\..\runtimes\win-$(PreferredNativeLua)\native\lua53.dll + $(MSBuildThisFileDirectory)..\..\runtimes\osx\native\liblua53.dylib + $(MSBuildThisFileDirectory)..\..\runtimes\linux-$(PreferredNativeLua)\native\liblua53.so + + + + + $([System.IO.Path]::GetFilename('$(PreferredWindowsNativeLuaPath)')) + PreserveNewest + + + $([System.IO.Path]::GetFilename('$(PreferredOSXNativeLuaPath)')) + PreserveNewest + + + $([System.IO.Path]::GetFilename('$(PreferredLinuxNativeLuaPath)')) + PreserveNewest + + + + + + + + x86\lua53.dll + PreserveNewest + + + x64\lua53.dll + PreserveNewest + + + + x86\liblua53.so + PreserveNewest + + + x64\liblua53.so + PreserveNewest + + + + \ No newline at end of file diff --git a/packages/KeraLua.0.1.14/lib/MonoAndroid/KeraLua.dll b/packages/KeraLua.0.1.14/lib/MonoAndroid/KeraLua.dll new file mode 100644 index 0000000000000000000000000000000000000000..a2c42ce01895c0ce07ec4578d0e20b49cbb57abf Binary files /dev/null and b/packages/KeraLua.0.1.14/lib/MonoAndroid/KeraLua.dll differ diff --git a/packages/KeraLua.0.1.14/lib/MonoAndroid/KeraLua.xml b/packages/KeraLua.0.1.14/lib/MonoAndroid/KeraLua.xml new file mode 100644 index 0000000000000000000000000000000000000000..9acb1163bb9756b1dbc486165ba8f453b52f742b --- /dev/null +++ b/packages/KeraLua.0.1.14/lib/MonoAndroid/KeraLua.xml @@ -0,0 +1,1834 @@ + + + + KeraLua + + + + + Lua Hook Event Masks + + + + + Disabled hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Type for C# callbacks + In order to communicate properly with Lua, a C function must use the following protocol, which defines the way parameters and results are passed: a C function receives its arguments from Lua in its stack in direct order (the first argument is pushed first). So, when the function starts, lua_gettop(L) returns the number of arguments received by the function. The first argument (if any) is at index 1 and its last argument is at index lua_gettop(L). To return values to Lua, a C function just pushes them onto the stack, in direct order (the first result is pushed first), and returns the number of results. Any other value in the stack below the results will be properly discarded by Lua. Like a Lua function, a C function called by Lua can also return many results. + + + + + + + Type for debugging hook functions callbacks. + + + + + + + Type for continuation functions + + + + + + + + + The reader function used by lua_load. Every time it needs another piece of the chunk, lua_load calls the reader, passing along its data parameter. The reader must return a pointer to a block of memory with a new piece of the chunk and set size to the block size + + + + + + + + + + + + + + + + + + + The type of the memory-allocation function used by Lua states. The allocator function must provide a functionality similar to realloc + + + + + + + + + + Lua state class, main interface to use Lua library. + + + + + Internal Lua handle pointer. + + + + + Encoding for the string conversions + ASCII by default. + + + + + Returns a pointer to a raw memory area associated with the given Lua state. The application can use this area for any purpose; Lua does not use it for anything. + Each new thread has this area initialized with a copy of the area of the main thread. + + + + + + Get the main thread object, if the object is the main thread will be equal this + + + + + Initialize Lua state, and open the default libs + + flag to enable/disable opening the default libs + + + + Initialize Lua state with allocator function and user data value + This method will NOT open the default libs. + Creates a new thread running in a new, independent state. Returns NULL if it cannot create the thread or the state (due to lack of memory). The argument f is the allocator function; Lua does all memory allocation for this state through this function (see lua_Alloc). The second argument, ud, is an opaque pointer that Lua passes to the allocator in every call. + + LuaAlloc allocator function called to alloc/free memory + opaque pointer passed to allocator + + + + Get the Lua object from IntPtr + Useful for LuaFunction callbacks, if the Lua object was already collected will return null. + + + + + + + Finalizer, will dispose the lua state if wasn't closed + + + + + Dispose lua state + + + + + + Destroys all objects in the given Lua state (calling the corresponding garbage-collection metamethods, if any) and frees all dynamic memory used by this state + + + + + Dispose the lua context (calling Close) + + + + + Converts the acceptable index idx into an equivalent absolute index (that is, one that does not depend on the stack top). + + + + + + + Performs an arithmetic or bitwise operation over the two values (or one, in the case of negations) at the top of the stack, with the value at the top being the second operand, pops these values, and pushes the result of the operation. The function follows the semantics of the corresponding Lua operator (that is, it may call metamethods). + + + + + + Sets a new panic function and returns the old one + + + + + + + Calls a function. + To call a function you must use the following protocol: first, the function to be called is pushed onto the stack; then, the arguments to the function are pushed in direct order; + that is, the first argument is pushed first. Finally you call lua_call; nargs is the number of arguments that you pushed onto the stack. + All arguments and the function value are popped from the stack when the function is called. The function results are pushed onto the stack when the function returns. + The number of results is adjusted to nresults, unless nresults is LUA_MULTRET. In this case, all results from the function are pushed; + Lua takes care that the returned values fit into the stack space, but it does not ensure any extra space in the stack. The function results are pushed onto the stack in direct order (the first result is pushed first), so that after the call the last result is on the top of the stack. + + + + + + + This function behaves exactly like lua_call, but allows the called function to yield + + + + + + + + + Ensures that the stack has space for at least n extra slots (that is, that you can safely push up to n values into it). It returns false if it cannot fulfill the request, + + + + + + Compares two Lua values. Returns 1 if the value at index index1 satisfies op when compared with the value at index index2 + + + + + + + + + Concatenates the n values at the top of the stack, pops them, and leaves the result at the top. If n is 1, the result is the single value on the stack (that is, the function does nothing); + + + + + + Copies the element at index fromidx into the valid index toidx, replacing the value at that position + + + + + + + Creates a new empty table and pushes it onto the stack. Parameter narr is a hint for how many elements the table will have as a sequence; parameter nrec is a hint for how many other elements the table will have + + + + + + + Dumps a function as a binary chunk. Receives a Lua function on the top of the stack and produces a binary chunk that, if loaded again, results in a function equivalent to the one dumped + + + + + + + + + Generates a Lua error, using the value at the top of the stack as the error object. This function does a long jump + + + + + + Controls the garbage collector. + + + + + + + + Returns the memory-allocation function of a given state. If ud is not NULL, Lua stores in *ud the opaque pointer given when the memory-allocator function was set. + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value of the global name. Returns the type of that value + + + + + + + Pushes onto the stack the value t[i], where t is the value at the given index + + + + Returns the type of the pushed value + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + If the value at the given index has a metatable, the function pushes that metatable onto the stack and returns 1 + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Returns the index of the top element in the stack. 0 means an empty stack. + + Returns the index of the top element in the stack. + + + + Pushes onto the stack the Lua value associated with the full userdata at the given index. + + + Returns the type of the pushed value. + + + + Gets information about the n-th upvalue of the closure at index funcindex. It pushes the upvalue's value onto the stack and returns its name. Returns NULL (and pushes nothing) when the index n is greater than the number of upvalues. + For C functions, this function uses the empty string "" as a name for all upvalues. (For Lua functions, upvalues are the external local variables that the function uses, and that are consequently included in its closure.) + Upvalues have no particular order, as they are active through the whole function. They are numbered in an arbitrary order. + + + + Returns the type of the pushed value. + + + + Returns the current hook function. + + + + + Returns the current hook count. + + + + + Returns the current hook mask. + + + + + Moves the top element into the given valid index, shifting up the elements above this index to open space. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Returns if the value at the given index is a boolean + + + + + + + Returns if the value at the given index is a C(#) function + + + + + + + Returns if the value at the given index is a function + + + + + + + Returns if the value at the given index is an integer + + + + + + + Returns if the value at the given index is light user data + + + + + + + Returns if the value at the given index is nil + + + + + + + Returns if the value at the given index is none + + + + + + + Check if the value at the index is none or nil + + + + + + + Returns if the value at the given index is a number + + + + + + + Returns if the value at the given index is a string or a number (which is always convertible to a string) + + + + + + + Returns if the value at the given index is a string + NOTE: This is different from the lua_isstring, which return true if the value is a number + + + + + + + Returns if the value at the given index is a table. + + + + + + + Returns if the value at the given index is a thread. + + + + + + + Returns if the value at the given index is a user data. + + + + + + + Returns if the given coroutine can yield, and 0 otherwise + + + + + Push the length of the value at the given index on the stack. It is equivalent to the '#' operator in Lua (see §3.4.7) and may trigger a metamethod for the "length" event (see §2.4). The result is pushed on the stack. + + + + + + Loads a Lua chunk without running it. If there are no errors, lua_load pushes the compiled chunk as a Lua function on top of the stack. Otherwise, it pushes an error message. + The lua_load function uses a user-supplied reader function to read the chunk (see lua_Reader). The data argument is an opaque value passed to the reader function. + + + + + + + + + + Creates a new empty table and pushes it onto the stack + + + + + Creates a new thread, pushes it on the stack, and returns a pointer to a lua_State that represents this new thread. The new thread returned by this function shares with the original thread its global environment, but has an independent execution stack. + + + + + + This function allocates a new block of memory with the given size, pushes onto the stack a new full userdata with the block address, and returns this address. The host program can freely use this memory + + + + + + + Pops a key from the stack, and pushes a key–value pair from the table at the given index (the "next" pair after the given key). + + + + + + + Calls a function in protected mode. + + + + + + + + This function behaves exactly like lua_pcall, but allows the called function to yield + + + + + + + + + + Pops n elements from the stack. + + + + + + Pushes a boolean value with value b onto the stack. + + + + + + Pushes a new C closure onto the stack. When a C function is created, it is possible to associate + some values with it, thus creating a C closure (see §4.4); these values are then accessible to the function + whenever it is called. To associate values with a C function, first these values must be pushed onto the + stack (when there are multiple values, the first value is pushed first). + Then lua_pushcclosure is called to create and push the C function onto the stack, + with the argument n telling how many values will be associated with the function. + lua_pushcclosure also pops these values from the stack. + + + + + + + Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function. + + + + + + Pushes the global environment onto the stack. + + + + + Pushes an integer with value n onto the stack. + + + + + + Pushes a light userdata onto the stack. + Userdata represent C values in Lua. A light userdata represents a pointer, a void*. It is a value (like a number): you do not create it, it has no individual metatable, and it is not collected (as it was never created). A light userdata is equal to "any" light userdata with the same C address. + + + + + + Pushes a reference data (C# object) onto the stack. + This function uses lua_pushlightuserdata, but uses a GCHandle to store the reference inside the Lua side. + The CGHandle is create as Normal, and will be freed when the value is pop + + + + + + + Pushes binary buffer onto the stack (usually UTF encoded string) or any arbitraty binary data + + + + + + Pushes a string onto the stack + + + + + + Push a instring using string.Format + PushString("Foo {0}", 10); + + + + + + + Pushes a nil value onto the stack. + + + + + Pushes a double with value n onto the stack. + + + + + + Pushes the thread represented by L onto the stack. Returns true if this thread is the main thread of its state. + + + + + + + Pushes a copy of the element at the given index onto the stack. (lua_pushvalue) + The method was renamed, since pushvalue is a bit vague + + + + + + + Returns true if the two values in indices index1 and index2 are primitively equal (that is, without calling the __eq metamethod). Otherwise returns false. Also returns false if any of the indices are not valid. + + + + + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + + + + + Pushes onto the stack the value t[k], where t is the table at the given index and k is the pointer p represented as a light userdata. The access is raw; that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value. + + + + Returns the raw "length" of the value at the given index: for strings, this is the string length; for tables, this is the result of the length operator ('#') with no metamethods; for userdata, this is the size of the block of memory allocated for the userdata; for other values, it is 0. + + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + index of table + value + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + + + + + + Does the equivalent of t[p] = v, where t is the table at the given index, p is encoded as a light userdata, and v is the value at the top of the stack. + + + + + + + Sets the C# delegate f as the new value of global name + + + + + + + Removes the element at the given valid index, shifting down the elements above this index to fill the gap. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Moves the top element into the given valid index without shifting any element (therefore replacing the value at that given index), and then pops the top element. + + + + + + To start a coroutine, you push onto the thread stack the main function plus any arguments; then you call lua_resume, + with nargs being the number of arguments. This call returns when the coroutine suspends or finishes its execution. + When it returns, the stack contains all values passed to lua_yield, or all values returned by the body function. + lua_resume returns LUA_YIELD if the coroutine yields, LUA_OK if the coroutine finishes its execution without errors, + or an error code in case of errors (see lua_pcall). + In case of errors, the stack is not unwound, so you can use the debug API over it. + The error object is on the top of the stack. + To resume a coroutine, you remove any results from the last lua_yield, put on its stack only the values to be passed as results from yield, + and then call lua_resume. + The parameter from represents the coroutine that is resuming L. + If there is no such coroutine, this parameter can be NULL. + + + + + + + + Rotates the stack elements between the valid index idx and the top of the stack. The elements are rotated n positions in the direction of the top, for a positive n, or -n positions in the direction of the bottom, for a negative n. The absolute value of n must not be greater than the size of the slice being rotated. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + + Changes the allocator function of a given state to f with user data ud. + + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the debugging hook function. + + Argument f is the hook function. mask specifies on which events the hook will be called: it is formed by a bitwise OR of the constants + + Hook function callback + hook mask + count (used only with LuaHookMas.Count) + + + + Pops a value from the stack and sets it as the new value of global name. + + + + + + Does the equivalent to t[n] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Pops a table from the stack and sets it as the new metatable for the value at the given index. + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index, v is the value at the top of the stack, and k is the value just below the top + + + + + + Accepts any index, or 0, and sets the stack top to this index. If the new top is larger than the old one, then the new elements are filled with nil. If index is 0, then all stack elements are removed. + + + + + + Sets the value of a closure's upvalue. It assigns the value at the top of the stack to the upvalue and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index n is greater than the number of upvalues. + + + + Pops a value from the stack and sets it as the new value associated to the full userdata at the given index. + + + + + + The status can be 0 (LUA_OK) for a normal thread, an error code if the thread finished the execution of a lua_resume with an error, or LUA_YIELD if the thread is suspended. + You can only call functions in threads with status LUA_OK. You can resume threads with status LUA_OK (to start a new coroutine) or LUA_YIELD (to resume a coroutine). + + + + + Converts the zero-terminated string s to a number, pushes that number into the stack, + + + + + + + Converts the Lua value at the given index to a C# boolean value + + + + + + + Converts a value at the given index to a C# function. That value must be a C# function; otherwise, returns NULL + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given as byte array + + + + + + + Converts the Lua value at the given index to a byte array. + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# string + + + + + + + Converts the Lua value at the given index to a C# string + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# double + + + + + + + Converts the Lua value at the given index to a C# double? + + + + + + + Converts the value at the given index to a generic C pointer (void*). The value can be a userdata, a table, a thread, or a function; otherwise, lua_topointer returns NULL. Different objects will give different pointers. There is no way to convert the pointer back to its original value. + Typically this function is used only for hashing and debug information. + + + + + + + Converts the value at the given index to a Lua thread + or return the self if is the main thread + + + + + + + Return an object (refence) at the index + Important if a object was push the object need to fetched using + this method, otherwise the C# object will never be collected + + + + True to free the GCHandle + + + + + If the value at the given index is a full userdata, returns its block address. If the value is a light userdata, returns its pointer. Otherwise, returns NULL + + + + + + + + + + + + + Returns the name of the type of the value at the given index. + + + Name of the type of the value at the given index + + + + Returns a unique identifier for the upvalue numbered n from the closure at index funcindex. + + + + + + + + Returns the pseudo-index that represents the i-th upvalue of the running function + + + + + + + Make the n1-th upvalue of the Lua closure at index funcindex1 refer to the n2-th upvalue of the Lua closure at index funcindex2 + + + + + + + + + Return the version of Lua (e.g 503) + + + + + + Exchange values between different threads of the same state. + This function pops n values from the current stack, and pushes them onto the stack to. + + + + + + + + This function is equivalent to lua_yieldk, but it has no continuation (see §4.7). Therefore, when the thread resumes, it continues the function that called the function calling lua_yield. + + + + + + + Yields a coroutine (thread). When a C function calls lua_yieldk, the running coroutine suspends its execution, and the call to lua_resume that started this coroutine returns + + Number of values from the stack that will be passed as results to lua_resume. + + + + + + + Checks whether cond is true. If it is not, raises an error with a standard message + + + + + + + + Raises an error reporting a problem with argument arg of the C function that called it, using a standard message that includes extramsg as a comment: + + + + + + + + If the object at index obj has a metatable and this metatable has a field e, this function calls this field passing the object as its only argument. + + + + If there is no metatable or no metamethod, this function returns false (without pushing any value on the stack) + + + + Checks whether the function has an argument of any type (including nil) at position arg. + + + + + + Checks whether the function argument arg is an integer (or can be converted to an integer) + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a number and returns this number. + + + + + + + Checks whether the function argument arg is a string and searches for this string in the array lst + + + + + + + + + Grows the stack size to top + sz elements, raising an error if the stack cannot grow + + + + + + + Checks whether the function argument arg has type type + + + + + + + Checks whether the function argument arg is a userdata of the type tname + + + + + True to release the GCHandle + + + + + Checks whether the function argument arg is a userdata of the type tname (see luaL_newmetatable) and returns the userdata address + + + + + + + + Loads and runs the given file + + + It returns false if there are no errors or true in case of errors. + + + + Loads and runs the given string + + + It returns false if there are no errors or true in case of errors. + + + + Raises an error. The error message format is given by fmt plus any extra arguments + + + + + + + + This function produces the return values for process-related functions in the standard library + + + + + + + This function produces the return values for file-related functions in the standard library + + + + + + + + Pushes onto the stack the field e from the metatable of the object at index obj and returns the type of the pushed value + + + + + + + + Pushes onto the stack the metatable associated with name tname in the registry (see luaL_newmetatable) (nil if there is no metatable associated with that name) + + + Returns the type of the pushed value. + + + + Ensures that the value t[fname], where t is the value at index idx, is a table, and pushes that table onto the stack. Returns true if it finds a previous table there and false if it creates a new table + + + + + + + + Returns the "length" of the value at the given index as a number; it is equivalent to the '#' operator in Lua + + + + + + + Loads a buffer as a Lua chunk + + + + + + + + + + + + + + + + Loads a buffer as a Lua chunk + + + + + + + Loads a string as a Lua chunk + + + + + + + + Loads a string as a Lua chunk + + + + + + + Loads a file as a Lua chunk. This function uses lua_load to load the chunk in the file named filename + + + + The status of operation + + + + Loads a file as a Lua chunk. + + + Return the status + + + + Creates a new table and registers there the functions in list library. + + + + + + Creates a new table with a size optimized to store all entries in the array l (but does not actually store them) + + + + + + Creates a new table to be used as a metatable for userdata + + + If the registry already has the key tname, returns false., + + + + Opens all standard Lua libraries into the given state. + + + + + If the function argument arg is an integer (or convertible to an integer), returns this integer. If this argument is absent or is nil, returns d + + + default value + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d /// + + + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d + + + + + + + + If the function argument arg is a number, returns this number. If this argument is absent or is nil, returns d + + + + + + + + Creates and returns a reference, in the table at index t, for the object at the top of the stack (and pops the object). + + + + + + + If modname is not already present in package.loaded, calls function openf with string modname as an argument and sets the call result in package.loaded[modname], as if that function has been called through require + + + + + + + + Registers all functions in the array l (see luaL_Reg) into the table on the top of the stack (below optional upvalues, see next). /// + + + + + + Sets the metatable of the object at the top of the stack as the metatable associated with name tname in the registry + + + + + + Test if the value at index is a reference data + + + + + True to release the GCHandle of object + + + + + This function works like luaL_checkudata, except that, when the test fails, it returns NULL instead of raising an error. + + + + + + + + Creates and pushes a traceback of the stack L1 + + + Tells at which level to start the traceback + + + + Creates and pushes a traceback of the stack L1 + + + appended at the beginning of the traceback + Tells at which level to start the traceback + + + + Returns the name of the type of the value at the given index. + + + + + + + Releases reference ref from the table at index t (see luaL_ref). The entry is removed from the table, so that the referred object can be collected. The reference ref is also freed to be used again + + + + + + + Pushes onto the stack a string identifying the current position of the control at level lvl in the call stack + + + + + + Used by Compare + + + + + compares for equality (==) + + + + + compares for less than + + + + + compares for less or equal + + + + + Structure for lua debug information + + + Do not change this struct because it must match the lua structure lua_Debug + + Reinhard Ostermeier + + + + Get a LuaDebug from IntPtr + + + + + + + Debug event code + + + + + a reasonable name for the given function. Because functions in Lua are first-class values, they do not have a fixed name: some functions can be the value of multiple global variables, while others can be stored only in a table field + + + + + explains the name field. The value of namewhat can be "global", "local", "method", "field", "upvalue", or "" (the empty string) + + + + + the string "Lua" if the function is a Lua function, "C" if it is a C function, "main" if it is the main part of a chunk + + + + + the name of the chunk that created the function. If source starts with a '@', it means that the function was defined in a file where the file name follows the '@'. + + + + + + the current line where the given function is executing. When no line information is available, currentline is set to -1 + + + + + + + + + + the line number where the definition of the function ends. + + + + + number of upvalues + + + + + number of parameters + + + + + true if the function is a vararg function (always true for C functions). + + + + + true if this function invocation was called by a tail call. In this case, the caller of this level is not in the stack. + + + + + a "printable" version of source, to be used in error messages + + + + + Garbage Collector operations + + + + + Stops the garbage collector. + + + + + Restarts the garbage collector. + + + + + Performs a full garbage-collection cycle. + + + + + Returns the current amount of memory (in Kbytes) in use by Lua. + + + + + Returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024 + + + + + Performs an incremental step of garbage collection. + + + + + Sets data as the new value for the pause of the collector (see §2.5) and returns the previous value + + + + + sets data as the new value for the step multiplier of the collector + + + + + returns a boolean that tells whether the collector is running + + + + + Whenever a hook is called, its ar argument has its field event set to the specific event that triggered the hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Tail Call + + + + + Operation value used by Arith method + + + + + adition(+) + + + + + substraction (-) + + + + + Multiplication (*) + + + + + Modulo (%) + + + + + Exponentiation (^) + + + + + performs float division (/) + + + + + performs floor division (//) + + + + + performs bitwise AND + + + + + performs bitwise OR (|) + + + + + performs bitwise exclusive OR (~) + + + + + performs left shift + + + + + performs right shift + + + + + performs mathematical negation (unary -) + + + + + performs bitwise NOT (~) + + + + + LuaRegister store the name and the delegate to register a native function + + + + + Function name + + + + + Function delegate + + + + + Enum for pseudo-index used by registry table + + + + + pseudo-index used by registry table + + + + + Registry index + + + + + At this index the registry has the main thread of the state. + + + + + At this index the registry has the global environment. + + + + + Lua Load/Call status return + + + + + success + + + + + Yield + + + + + a runtime error. + + + + + syntax error during precompilation + + + + + memory allocation error. For such errors, Lua does not call the message handler. + + + + + error while running a __gc metamethod. For such errors, Lua does not call the message handler + + + + + error while running the message handler. + + + + + Lua types + + + + + + + + + + LUA_TNIL + + + + + LUA_TBOOLEAN + + + + + LUA_TLIGHTUSERDATA + + + + + LUA_TNUMBER + + + + + LUA_TSTRING + + + + + LUA_TTABLE + + + + + LUA_TFUNCTION + + + + + LUA_TUSERDATA + + + + + LUA_TTHREAD + + // + + + diff --git a/packages/KeraLua.0.1.14/lib/net45/KeraLua.dll b/packages/KeraLua.0.1.14/lib/net45/KeraLua.dll new file mode 100644 index 0000000000000000000000000000000000000000..1caa597b556fd9fdff14bcfd6377c1f8b2cfd7e7 Binary files /dev/null and b/packages/KeraLua.0.1.14/lib/net45/KeraLua.dll differ diff --git a/packages/KeraLua.0.1.14/lib/net45/KeraLua.xml b/packages/KeraLua.0.1.14/lib/net45/KeraLua.xml new file mode 100644 index 0000000000000000000000000000000000000000..9acb1163bb9756b1dbc486165ba8f453b52f742b --- /dev/null +++ b/packages/KeraLua.0.1.14/lib/net45/KeraLua.xml @@ -0,0 +1,1834 @@ + + + + KeraLua + + + + + Lua Hook Event Masks + + + + + Disabled hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Type for C# callbacks + In order to communicate properly with Lua, a C function must use the following protocol, which defines the way parameters and results are passed: a C function receives its arguments from Lua in its stack in direct order (the first argument is pushed first). So, when the function starts, lua_gettop(L) returns the number of arguments received by the function. The first argument (if any) is at index 1 and its last argument is at index lua_gettop(L). To return values to Lua, a C function just pushes them onto the stack, in direct order (the first result is pushed first), and returns the number of results. Any other value in the stack below the results will be properly discarded by Lua. Like a Lua function, a C function called by Lua can also return many results. + + + + + + + Type for debugging hook functions callbacks. + + + + + + + Type for continuation functions + + + + + + + + + The reader function used by lua_load. Every time it needs another piece of the chunk, lua_load calls the reader, passing along its data parameter. The reader must return a pointer to a block of memory with a new piece of the chunk and set size to the block size + + + + + + + + + + + + + + + + + + + The type of the memory-allocation function used by Lua states. The allocator function must provide a functionality similar to realloc + + + + + + + + + + Lua state class, main interface to use Lua library. + + + + + Internal Lua handle pointer. + + + + + Encoding for the string conversions + ASCII by default. + + + + + Returns a pointer to a raw memory area associated with the given Lua state. The application can use this area for any purpose; Lua does not use it for anything. + Each new thread has this area initialized with a copy of the area of the main thread. + + + + + + Get the main thread object, if the object is the main thread will be equal this + + + + + Initialize Lua state, and open the default libs + + flag to enable/disable opening the default libs + + + + Initialize Lua state with allocator function and user data value + This method will NOT open the default libs. + Creates a new thread running in a new, independent state. Returns NULL if it cannot create the thread or the state (due to lack of memory). The argument f is the allocator function; Lua does all memory allocation for this state through this function (see lua_Alloc). The second argument, ud, is an opaque pointer that Lua passes to the allocator in every call. + + LuaAlloc allocator function called to alloc/free memory + opaque pointer passed to allocator + + + + Get the Lua object from IntPtr + Useful for LuaFunction callbacks, if the Lua object was already collected will return null. + + + + + + + Finalizer, will dispose the lua state if wasn't closed + + + + + Dispose lua state + + + + + + Destroys all objects in the given Lua state (calling the corresponding garbage-collection metamethods, if any) and frees all dynamic memory used by this state + + + + + Dispose the lua context (calling Close) + + + + + Converts the acceptable index idx into an equivalent absolute index (that is, one that does not depend on the stack top). + + + + + + + Performs an arithmetic or bitwise operation over the two values (or one, in the case of negations) at the top of the stack, with the value at the top being the second operand, pops these values, and pushes the result of the operation. The function follows the semantics of the corresponding Lua operator (that is, it may call metamethods). + + + + + + Sets a new panic function and returns the old one + + + + + + + Calls a function. + To call a function you must use the following protocol: first, the function to be called is pushed onto the stack; then, the arguments to the function are pushed in direct order; + that is, the first argument is pushed first. Finally you call lua_call; nargs is the number of arguments that you pushed onto the stack. + All arguments and the function value are popped from the stack when the function is called. The function results are pushed onto the stack when the function returns. + The number of results is adjusted to nresults, unless nresults is LUA_MULTRET. In this case, all results from the function are pushed; + Lua takes care that the returned values fit into the stack space, but it does not ensure any extra space in the stack. The function results are pushed onto the stack in direct order (the first result is pushed first), so that after the call the last result is on the top of the stack. + + + + + + + This function behaves exactly like lua_call, but allows the called function to yield + + + + + + + + + Ensures that the stack has space for at least n extra slots (that is, that you can safely push up to n values into it). It returns false if it cannot fulfill the request, + + + + + + Compares two Lua values. Returns 1 if the value at index index1 satisfies op when compared with the value at index index2 + + + + + + + + + Concatenates the n values at the top of the stack, pops them, and leaves the result at the top. If n is 1, the result is the single value on the stack (that is, the function does nothing); + + + + + + Copies the element at index fromidx into the valid index toidx, replacing the value at that position + + + + + + + Creates a new empty table and pushes it onto the stack. Parameter narr is a hint for how many elements the table will have as a sequence; parameter nrec is a hint for how many other elements the table will have + + + + + + + Dumps a function as a binary chunk. Receives a Lua function on the top of the stack and produces a binary chunk that, if loaded again, results in a function equivalent to the one dumped + + + + + + + + + Generates a Lua error, using the value at the top of the stack as the error object. This function does a long jump + + + + + + Controls the garbage collector. + + + + + + + + Returns the memory-allocation function of a given state. If ud is not NULL, Lua stores in *ud the opaque pointer given when the memory-allocator function was set. + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value of the global name. Returns the type of that value + + + + + + + Pushes onto the stack the value t[i], where t is the value at the given index + + + + Returns the type of the pushed value + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + If the value at the given index has a metatable, the function pushes that metatable onto the stack and returns 1 + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Returns the index of the top element in the stack. 0 means an empty stack. + + Returns the index of the top element in the stack. + + + + Pushes onto the stack the Lua value associated with the full userdata at the given index. + + + Returns the type of the pushed value. + + + + Gets information about the n-th upvalue of the closure at index funcindex. It pushes the upvalue's value onto the stack and returns its name. Returns NULL (and pushes nothing) when the index n is greater than the number of upvalues. + For C functions, this function uses the empty string "" as a name for all upvalues. (For Lua functions, upvalues are the external local variables that the function uses, and that are consequently included in its closure.) + Upvalues have no particular order, as they are active through the whole function. They are numbered in an arbitrary order. + + + + Returns the type of the pushed value. + + + + Returns the current hook function. + + + + + Returns the current hook count. + + + + + Returns the current hook mask. + + + + + Moves the top element into the given valid index, shifting up the elements above this index to open space. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Returns if the value at the given index is a boolean + + + + + + + Returns if the value at the given index is a C(#) function + + + + + + + Returns if the value at the given index is a function + + + + + + + Returns if the value at the given index is an integer + + + + + + + Returns if the value at the given index is light user data + + + + + + + Returns if the value at the given index is nil + + + + + + + Returns if the value at the given index is none + + + + + + + Check if the value at the index is none or nil + + + + + + + Returns if the value at the given index is a number + + + + + + + Returns if the value at the given index is a string or a number (which is always convertible to a string) + + + + + + + Returns if the value at the given index is a string + NOTE: This is different from the lua_isstring, which return true if the value is a number + + + + + + + Returns if the value at the given index is a table. + + + + + + + Returns if the value at the given index is a thread. + + + + + + + Returns if the value at the given index is a user data. + + + + + + + Returns if the given coroutine can yield, and 0 otherwise + + + + + Push the length of the value at the given index on the stack. It is equivalent to the '#' operator in Lua (see §3.4.7) and may trigger a metamethod for the "length" event (see §2.4). The result is pushed on the stack. + + + + + + Loads a Lua chunk without running it. If there are no errors, lua_load pushes the compiled chunk as a Lua function on top of the stack. Otherwise, it pushes an error message. + The lua_load function uses a user-supplied reader function to read the chunk (see lua_Reader). The data argument is an opaque value passed to the reader function. + + + + + + + + + + Creates a new empty table and pushes it onto the stack + + + + + Creates a new thread, pushes it on the stack, and returns a pointer to a lua_State that represents this new thread. The new thread returned by this function shares with the original thread its global environment, but has an independent execution stack. + + + + + + This function allocates a new block of memory with the given size, pushes onto the stack a new full userdata with the block address, and returns this address. The host program can freely use this memory + + + + + + + Pops a key from the stack, and pushes a key–value pair from the table at the given index (the "next" pair after the given key). + + + + + + + Calls a function in protected mode. + + + + + + + + This function behaves exactly like lua_pcall, but allows the called function to yield + + + + + + + + + + Pops n elements from the stack. + + + + + + Pushes a boolean value with value b onto the stack. + + + + + + Pushes a new C closure onto the stack. When a C function is created, it is possible to associate + some values with it, thus creating a C closure (see §4.4); these values are then accessible to the function + whenever it is called. To associate values with a C function, first these values must be pushed onto the + stack (when there are multiple values, the first value is pushed first). + Then lua_pushcclosure is called to create and push the C function onto the stack, + with the argument n telling how many values will be associated with the function. + lua_pushcclosure also pops these values from the stack. + + + + + + + Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function. + + + + + + Pushes the global environment onto the stack. + + + + + Pushes an integer with value n onto the stack. + + + + + + Pushes a light userdata onto the stack. + Userdata represent C values in Lua. A light userdata represents a pointer, a void*. It is a value (like a number): you do not create it, it has no individual metatable, and it is not collected (as it was never created). A light userdata is equal to "any" light userdata with the same C address. + + + + + + Pushes a reference data (C# object) onto the stack. + This function uses lua_pushlightuserdata, but uses a GCHandle to store the reference inside the Lua side. + The CGHandle is create as Normal, and will be freed when the value is pop + + + + + + + Pushes binary buffer onto the stack (usually UTF encoded string) or any arbitraty binary data + + + + + + Pushes a string onto the stack + + + + + + Push a instring using string.Format + PushString("Foo {0}", 10); + + + + + + + Pushes a nil value onto the stack. + + + + + Pushes a double with value n onto the stack. + + + + + + Pushes the thread represented by L onto the stack. Returns true if this thread is the main thread of its state. + + + + + + + Pushes a copy of the element at the given index onto the stack. (lua_pushvalue) + The method was renamed, since pushvalue is a bit vague + + + + + + + Returns true if the two values in indices index1 and index2 are primitively equal (that is, without calling the __eq metamethod). Otherwise returns false. Also returns false if any of the indices are not valid. + + + + + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + + + + + Pushes onto the stack the value t[k], where t is the table at the given index and k is the pointer p represented as a light userdata. The access is raw; that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value. + + + + Returns the raw "length" of the value at the given index: for strings, this is the string length; for tables, this is the result of the length operator ('#') with no metamethods; for userdata, this is the size of the block of memory allocated for the userdata; for other values, it is 0. + + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + index of table + value + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + + + + + + Does the equivalent of t[p] = v, where t is the table at the given index, p is encoded as a light userdata, and v is the value at the top of the stack. + + + + + + + Sets the C# delegate f as the new value of global name + + + + + + + Removes the element at the given valid index, shifting down the elements above this index to fill the gap. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Moves the top element into the given valid index without shifting any element (therefore replacing the value at that given index), and then pops the top element. + + + + + + To start a coroutine, you push onto the thread stack the main function plus any arguments; then you call lua_resume, + with nargs being the number of arguments. This call returns when the coroutine suspends or finishes its execution. + When it returns, the stack contains all values passed to lua_yield, or all values returned by the body function. + lua_resume returns LUA_YIELD if the coroutine yields, LUA_OK if the coroutine finishes its execution without errors, + or an error code in case of errors (see lua_pcall). + In case of errors, the stack is not unwound, so you can use the debug API over it. + The error object is on the top of the stack. + To resume a coroutine, you remove any results from the last lua_yield, put on its stack only the values to be passed as results from yield, + and then call lua_resume. + The parameter from represents the coroutine that is resuming L. + If there is no such coroutine, this parameter can be NULL. + + + + + + + + Rotates the stack elements between the valid index idx and the top of the stack. The elements are rotated n positions in the direction of the top, for a positive n, or -n positions in the direction of the bottom, for a negative n. The absolute value of n must not be greater than the size of the slice being rotated. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + + Changes the allocator function of a given state to f with user data ud. + + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the debugging hook function. + + Argument f is the hook function. mask specifies on which events the hook will be called: it is formed by a bitwise OR of the constants + + Hook function callback + hook mask + count (used only with LuaHookMas.Count) + + + + Pops a value from the stack and sets it as the new value of global name. + + + + + + Does the equivalent to t[n] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Pops a table from the stack and sets it as the new metatable for the value at the given index. + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index, v is the value at the top of the stack, and k is the value just below the top + + + + + + Accepts any index, or 0, and sets the stack top to this index. If the new top is larger than the old one, then the new elements are filled with nil. If index is 0, then all stack elements are removed. + + + + + + Sets the value of a closure's upvalue. It assigns the value at the top of the stack to the upvalue and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index n is greater than the number of upvalues. + + + + Pops a value from the stack and sets it as the new value associated to the full userdata at the given index. + + + + + + The status can be 0 (LUA_OK) for a normal thread, an error code if the thread finished the execution of a lua_resume with an error, or LUA_YIELD if the thread is suspended. + You can only call functions in threads with status LUA_OK. You can resume threads with status LUA_OK (to start a new coroutine) or LUA_YIELD (to resume a coroutine). + + + + + Converts the zero-terminated string s to a number, pushes that number into the stack, + + + + + + + Converts the Lua value at the given index to a C# boolean value + + + + + + + Converts a value at the given index to a C# function. That value must be a C# function; otherwise, returns NULL + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given as byte array + + + + + + + Converts the Lua value at the given index to a byte array. + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# string + + + + + + + Converts the Lua value at the given index to a C# string + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# double + + + + + + + Converts the Lua value at the given index to a C# double? + + + + + + + Converts the value at the given index to a generic C pointer (void*). The value can be a userdata, a table, a thread, or a function; otherwise, lua_topointer returns NULL. Different objects will give different pointers. There is no way to convert the pointer back to its original value. + Typically this function is used only for hashing and debug information. + + + + + + + Converts the value at the given index to a Lua thread + or return the self if is the main thread + + + + + + + Return an object (refence) at the index + Important if a object was push the object need to fetched using + this method, otherwise the C# object will never be collected + + + + True to free the GCHandle + + + + + If the value at the given index is a full userdata, returns its block address. If the value is a light userdata, returns its pointer. Otherwise, returns NULL + + + + + + + + + + + + + Returns the name of the type of the value at the given index. + + + Name of the type of the value at the given index + + + + Returns a unique identifier for the upvalue numbered n from the closure at index funcindex. + + + + + + + + Returns the pseudo-index that represents the i-th upvalue of the running function + + + + + + + Make the n1-th upvalue of the Lua closure at index funcindex1 refer to the n2-th upvalue of the Lua closure at index funcindex2 + + + + + + + + + Return the version of Lua (e.g 503) + + + + + + Exchange values between different threads of the same state. + This function pops n values from the current stack, and pushes them onto the stack to. + + + + + + + + This function is equivalent to lua_yieldk, but it has no continuation (see §4.7). Therefore, when the thread resumes, it continues the function that called the function calling lua_yield. + + + + + + + Yields a coroutine (thread). When a C function calls lua_yieldk, the running coroutine suspends its execution, and the call to lua_resume that started this coroutine returns + + Number of values from the stack that will be passed as results to lua_resume. + + + + + + + Checks whether cond is true. If it is not, raises an error with a standard message + + + + + + + + Raises an error reporting a problem with argument arg of the C function that called it, using a standard message that includes extramsg as a comment: + + + + + + + + If the object at index obj has a metatable and this metatable has a field e, this function calls this field passing the object as its only argument. + + + + If there is no metatable or no metamethod, this function returns false (without pushing any value on the stack) + + + + Checks whether the function has an argument of any type (including nil) at position arg. + + + + + + Checks whether the function argument arg is an integer (or can be converted to an integer) + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a number and returns this number. + + + + + + + Checks whether the function argument arg is a string and searches for this string in the array lst + + + + + + + + + Grows the stack size to top + sz elements, raising an error if the stack cannot grow + + + + + + + Checks whether the function argument arg has type type + + + + + + + Checks whether the function argument arg is a userdata of the type tname + + + + + True to release the GCHandle + + + + + Checks whether the function argument arg is a userdata of the type tname (see luaL_newmetatable) and returns the userdata address + + + + + + + + Loads and runs the given file + + + It returns false if there are no errors or true in case of errors. + + + + Loads and runs the given string + + + It returns false if there are no errors or true in case of errors. + + + + Raises an error. The error message format is given by fmt plus any extra arguments + + + + + + + + This function produces the return values for process-related functions in the standard library + + + + + + + This function produces the return values for file-related functions in the standard library + + + + + + + + Pushes onto the stack the field e from the metatable of the object at index obj and returns the type of the pushed value + + + + + + + + Pushes onto the stack the metatable associated with name tname in the registry (see luaL_newmetatable) (nil if there is no metatable associated with that name) + + + Returns the type of the pushed value. + + + + Ensures that the value t[fname], where t is the value at index idx, is a table, and pushes that table onto the stack. Returns true if it finds a previous table there and false if it creates a new table + + + + + + + + Returns the "length" of the value at the given index as a number; it is equivalent to the '#' operator in Lua + + + + + + + Loads a buffer as a Lua chunk + + + + + + + + + + + + + + + + Loads a buffer as a Lua chunk + + + + + + + Loads a string as a Lua chunk + + + + + + + + Loads a string as a Lua chunk + + + + + + + Loads a file as a Lua chunk. This function uses lua_load to load the chunk in the file named filename + + + + The status of operation + + + + Loads a file as a Lua chunk. + + + Return the status + + + + Creates a new table and registers there the functions in list library. + + + + + + Creates a new table with a size optimized to store all entries in the array l (but does not actually store them) + + + + + + Creates a new table to be used as a metatable for userdata + + + If the registry already has the key tname, returns false., + + + + Opens all standard Lua libraries into the given state. + + + + + If the function argument arg is an integer (or convertible to an integer), returns this integer. If this argument is absent or is nil, returns d + + + default value + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d /// + + + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d + + + + + + + + If the function argument arg is a number, returns this number. If this argument is absent or is nil, returns d + + + + + + + + Creates and returns a reference, in the table at index t, for the object at the top of the stack (and pops the object). + + + + + + + If modname is not already present in package.loaded, calls function openf with string modname as an argument and sets the call result in package.loaded[modname], as if that function has been called through require + + + + + + + + Registers all functions in the array l (see luaL_Reg) into the table on the top of the stack (below optional upvalues, see next). /// + + + + + + Sets the metatable of the object at the top of the stack as the metatable associated with name tname in the registry + + + + + + Test if the value at index is a reference data + + + + + True to release the GCHandle of object + + + + + This function works like luaL_checkudata, except that, when the test fails, it returns NULL instead of raising an error. + + + + + + + + Creates and pushes a traceback of the stack L1 + + + Tells at which level to start the traceback + + + + Creates and pushes a traceback of the stack L1 + + + appended at the beginning of the traceback + Tells at which level to start the traceback + + + + Returns the name of the type of the value at the given index. + + + + + + + Releases reference ref from the table at index t (see luaL_ref). The entry is removed from the table, so that the referred object can be collected. The reference ref is also freed to be used again + + + + + + + Pushes onto the stack a string identifying the current position of the control at level lvl in the call stack + + + + + + Used by Compare + + + + + compares for equality (==) + + + + + compares for less than + + + + + compares for less or equal + + + + + Structure for lua debug information + + + Do not change this struct because it must match the lua structure lua_Debug + + Reinhard Ostermeier + + + + Get a LuaDebug from IntPtr + + + + + + + Debug event code + + + + + a reasonable name for the given function. Because functions in Lua are first-class values, they do not have a fixed name: some functions can be the value of multiple global variables, while others can be stored only in a table field + + + + + explains the name field. The value of namewhat can be "global", "local", "method", "field", "upvalue", or "" (the empty string) + + + + + the string "Lua" if the function is a Lua function, "C" if it is a C function, "main" if it is the main part of a chunk + + + + + the name of the chunk that created the function. If source starts with a '@', it means that the function was defined in a file where the file name follows the '@'. + + + + + + the current line where the given function is executing. When no line information is available, currentline is set to -1 + + + + + + + + + + the line number where the definition of the function ends. + + + + + number of upvalues + + + + + number of parameters + + + + + true if the function is a vararg function (always true for C functions). + + + + + true if this function invocation was called by a tail call. In this case, the caller of this level is not in the stack. + + + + + a "printable" version of source, to be used in error messages + + + + + Garbage Collector operations + + + + + Stops the garbage collector. + + + + + Restarts the garbage collector. + + + + + Performs a full garbage-collection cycle. + + + + + Returns the current amount of memory (in Kbytes) in use by Lua. + + + + + Returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024 + + + + + Performs an incremental step of garbage collection. + + + + + Sets data as the new value for the pause of the collector (see §2.5) and returns the previous value + + + + + sets data as the new value for the step multiplier of the collector + + + + + returns a boolean that tells whether the collector is running + + + + + Whenever a hook is called, its ar argument has its field event set to the specific event that triggered the hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Tail Call + + + + + Operation value used by Arith method + + + + + adition(+) + + + + + substraction (-) + + + + + Multiplication (*) + + + + + Modulo (%) + + + + + Exponentiation (^) + + + + + performs float division (/) + + + + + performs floor division (//) + + + + + performs bitwise AND + + + + + performs bitwise OR (|) + + + + + performs bitwise exclusive OR (~) + + + + + performs left shift + + + + + performs right shift + + + + + performs mathematical negation (unary -) + + + + + performs bitwise NOT (~) + + + + + LuaRegister store the name and the delegate to register a native function + + + + + Function name + + + + + Function delegate + + + + + Enum for pseudo-index used by registry table + + + + + pseudo-index used by registry table + + + + + Registry index + + + + + At this index the registry has the main thread of the state. + + + + + At this index the registry has the global environment. + + + + + Lua Load/Call status return + + + + + success + + + + + Yield + + + + + a runtime error. + + + + + syntax error during precompilation + + + + + memory allocation error. For such errors, Lua does not call the message handler. + + + + + error while running a __gc metamethod. For such errors, Lua does not call the message handler + + + + + error while running the message handler. + + + + + Lua types + + + + + + + + + + LUA_TNIL + + + + + LUA_TBOOLEAN + + + + + LUA_TLIGHTUSERDATA + + + + + LUA_TNUMBER + + + + + LUA_TSTRING + + + + + LUA_TTABLE + + + + + LUA_TFUNCTION + + + + + LUA_TUSERDATA + + + + + LUA_TTHREAD + + // + + + diff --git a/packages/KeraLua.0.1.14/lib/netcoreapp2.0/KeraLua.dll b/packages/KeraLua.0.1.14/lib/netcoreapp2.0/KeraLua.dll new file mode 100644 index 0000000000000000000000000000000000000000..c9011647393e60f082990c6765d50cedabeef524 Binary files /dev/null and b/packages/KeraLua.0.1.14/lib/netcoreapp2.0/KeraLua.dll differ diff --git a/packages/KeraLua.0.1.14/lib/netcoreapp2.0/KeraLua.xml b/packages/KeraLua.0.1.14/lib/netcoreapp2.0/KeraLua.xml new file mode 100644 index 0000000000000000000000000000000000000000..9acb1163bb9756b1dbc486165ba8f453b52f742b --- /dev/null +++ b/packages/KeraLua.0.1.14/lib/netcoreapp2.0/KeraLua.xml @@ -0,0 +1,1834 @@ + + + + KeraLua + + + + + Lua Hook Event Masks + + + + + Disabled hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Type for C# callbacks + In order to communicate properly with Lua, a C function must use the following protocol, which defines the way parameters and results are passed: a C function receives its arguments from Lua in its stack in direct order (the first argument is pushed first). So, when the function starts, lua_gettop(L) returns the number of arguments received by the function. The first argument (if any) is at index 1 and its last argument is at index lua_gettop(L). To return values to Lua, a C function just pushes them onto the stack, in direct order (the first result is pushed first), and returns the number of results. Any other value in the stack below the results will be properly discarded by Lua. Like a Lua function, a C function called by Lua can also return many results. + + + + + + + Type for debugging hook functions callbacks. + + + + + + + Type for continuation functions + + + + + + + + + The reader function used by lua_load. Every time it needs another piece of the chunk, lua_load calls the reader, passing along its data parameter. The reader must return a pointer to a block of memory with a new piece of the chunk and set size to the block size + + + + + + + + + + + + + + + + + + + The type of the memory-allocation function used by Lua states. The allocator function must provide a functionality similar to realloc + + + + + + + + + + Lua state class, main interface to use Lua library. + + + + + Internal Lua handle pointer. + + + + + Encoding for the string conversions + ASCII by default. + + + + + Returns a pointer to a raw memory area associated with the given Lua state. The application can use this area for any purpose; Lua does not use it for anything. + Each new thread has this area initialized with a copy of the area of the main thread. + + + + + + Get the main thread object, if the object is the main thread will be equal this + + + + + Initialize Lua state, and open the default libs + + flag to enable/disable opening the default libs + + + + Initialize Lua state with allocator function and user data value + This method will NOT open the default libs. + Creates a new thread running in a new, independent state. Returns NULL if it cannot create the thread or the state (due to lack of memory). The argument f is the allocator function; Lua does all memory allocation for this state through this function (see lua_Alloc). The second argument, ud, is an opaque pointer that Lua passes to the allocator in every call. + + LuaAlloc allocator function called to alloc/free memory + opaque pointer passed to allocator + + + + Get the Lua object from IntPtr + Useful for LuaFunction callbacks, if the Lua object was already collected will return null. + + + + + + + Finalizer, will dispose the lua state if wasn't closed + + + + + Dispose lua state + + + + + + Destroys all objects in the given Lua state (calling the corresponding garbage-collection metamethods, if any) and frees all dynamic memory used by this state + + + + + Dispose the lua context (calling Close) + + + + + Converts the acceptable index idx into an equivalent absolute index (that is, one that does not depend on the stack top). + + + + + + + Performs an arithmetic or bitwise operation over the two values (or one, in the case of negations) at the top of the stack, with the value at the top being the second operand, pops these values, and pushes the result of the operation. The function follows the semantics of the corresponding Lua operator (that is, it may call metamethods). + + + + + + Sets a new panic function and returns the old one + + + + + + + Calls a function. + To call a function you must use the following protocol: first, the function to be called is pushed onto the stack; then, the arguments to the function are pushed in direct order; + that is, the first argument is pushed first. Finally you call lua_call; nargs is the number of arguments that you pushed onto the stack. + All arguments and the function value are popped from the stack when the function is called. The function results are pushed onto the stack when the function returns. + The number of results is adjusted to nresults, unless nresults is LUA_MULTRET. In this case, all results from the function are pushed; + Lua takes care that the returned values fit into the stack space, but it does not ensure any extra space in the stack. The function results are pushed onto the stack in direct order (the first result is pushed first), so that after the call the last result is on the top of the stack. + + + + + + + This function behaves exactly like lua_call, but allows the called function to yield + + + + + + + + + Ensures that the stack has space for at least n extra slots (that is, that you can safely push up to n values into it). It returns false if it cannot fulfill the request, + + + + + + Compares two Lua values. Returns 1 if the value at index index1 satisfies op when compared with the value at index index2 + + + + + + + + + Concatenates the n values at the top of the stack, pops them, and leaves the result at the top. If n is 1, the result is the single value on the stack (that is, the function does nothing); + + + + + + Copies the element at index fromidx into the valid index toidx, replacing the value at that position + + + + + + + Creates a new empty table and pushes it onto the stack. Parameter narr is a hint for how many elements the table will have as a sequence; parameter nrec is a hint for how many other elements the table will have + + + + + + + Dumps a function as a binary chunk. Receives a Lua function on the top of the stack and produces a binary chunk that, if loaded again, results in a function equivalent to the one dumped + + + + + + + + + Generates a Lua error, using the value at the top of the stack as the error object. This function does a long jump + + + + + + Controls the garbage collector. + + + + + + + + Returns the memory-allocation function of a given state. If ud is not NULL, Lua stores in *ud the opaque pointer given when the memory-allocator function was set. + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value of the global name. Returns the type of that value + + + + + + + Pushes onto the stack the value t[i], where t is the value at the given index + + + + Returns the type of the pushed value + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + If the value at the given index has a metatable, the function pushes that metatable onto the stack and returns 1 + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Returns the index of the top element in the stack. 0 means an empty stack. + + Returns the index of the top element in the stack. + + + + Pushes onto the stack the Lua value associated with the full userdata at the given index. + + + Returns the type of the pushed value. + + + + Gets information about the n-th upvalue of the closure at index funcindex. It pushes the upvalue's value onto the stack and returns its name. Returns NULL (and pushes nothing) when the index n is greater than the number of upvalues. + For C functions, this function uses the empty string "" as a name for all upvalues. (For Lua functions, upvalues are the external local variables that the function uses, and that are consequently included in its closure.) + Upvalues have no particular order, as they are active through the whole function. They are numbered in an arbitrary order. + + + + Returns the type of the pushed value. + + + + Returns the current hook function. + + + + + Returns the current hook count. + + + + + Returns the current hook mask. + + + + + Moves the top element into the given valid index, shifting up the elements above this index to open space. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Returns if the value at the given index is a boolean + + + + + + + Returns if the value at the given index is a C(#) function + + + + + + + Returns if the value at the given index is a function + + + + + + + Returns if the value at the given index is an integer + + + + + + + Returns if the value at the given index is light user data + + + + + + + Returns if the value at the given index is nil + + + + + + + Returns if the value at the given index is none + + + + + + + Check if the value at the index is none or nil + + + + + + + Returns if the value at the given index is a number + + + + + + + Returns if the value at the given index is a string or a number (which is always convertible to a string) + + + + + + + Returns if the value at the given index is a string + NOTE: This is different from the lua_isstring, which return true if the value is a number + + + + + + + Returns if the value at the given index is a table. + + + + + + + Returns if the value at the given index is a thread. + + + + + + + Returns if the value at the given index is a user data. + + + + + + + Returns if the given coroutine can yield, and 0 otherwise + + + + + Push the length of the value at the given index on the stack. It is equivalent to the '#' operator in Lua (see §3.4.7) and may trigger a metamethod for the "length" event (see §2.4). The result is pushed on the stack. + + + + + + Loads a Lua chunk without running it. If there are no errors, lua_load pushes the compiled chunk as a Lua function on top of the stack. Otherwise, it pushes an error message. + The lua_load function uses a user-supplied reader function to read the chunk (see lua_Reader). The data argument is an opaque value passed to the reader function. + + + + + + + + + + Creates a new empty table and pushes it onto the stack + + + + + Creates a new thread, pushes it on the stack, and returns a pointer to a lua_State that represents this new thread. The new thread returned by this function shares with the original thread its global environment, but has an independent execution stack. + + + + + + This function allocates a new block of memory with the given size, pushes onto the stack a new full userdata with the block address, and returns this address. The host program can freely use this memory + + + + + + + Pops a key from the stack, and pushes a key–value pair from the table at the given index (the "next" pair after the given key). + + + + + + + Calls a function in protected mode. + + + + + + + + This function behaves exactly like lua_pcall, but allows the called function to yield + + + + + + + + + + Pops n elements from the stack. + + + + + + Pushes a boolean value with value b onto the stack. + + + + + + Pushes a new C closure onto the stack. When a C function is created, it is possible to associate + some values with it, thus creating a C closure (see §4.4); these values are then accessible to the function + whenever it is called. To associate values with a C function, first these values must be pushed onto the + stack (when there are multiple values, the first value is pushed first). + Then lua_pushcclosure is called to create and push the C function onto the stack, + with the argument n telling how many values will be associated with the function. + lua_pushcclosure also pops these values from the stack. + + + + + + + Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function. + + + + + + Pushes the global environment onto the stack. + + + + + Pushes an integer with value n onto the stack. + + + + + + Pushes a light userdata onto the stack. + Userdata represent C values in Lua. A light userdata represents a pointer, a void*. It is a value (like a number): you do not create it, it has no individual metatable, and it is not collected (as it was never created). A light userdata is equal to "any" light userdata with the same C address. + + + + + + Pushes a reference data (C# object) onto the stack. + This function uses lua_pushlightuserdata, but uses a GCHandle to store the reference inside the Lua side. + The CGHandle is create as Normal, and will be freed when the value is pop + + + + + + + Pushes binary buffer onto the stack (usually UTF encoded string) or any arbitraty binary data + + + + + + Pushes a string onto the stack + + + + + + Push a instring using string.Format + PushString("Foo {0}", 10); + + + + + + + Pushes a nil value onto the stack. + + + + + Pushes a double with value n onto the stack. + + + + + + Pushes the thread represented by L onto the stack. Returns true if this thread is the main thread of its state. + + + + + + + Pushes a copy of the element at the given index onto the stack. (lua_pushvalue) + The method was renamed, since pushvalue is a bit vague + + + + + + + Returns true if the two values in indices index1 and index2 are primitively equal (that is, without calling the __eq metamethod). Otherwise returns false. Also returns false if any of the indices are not valid. + + + + + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + + + + + Pushes onto the stack the value t[k], where t is the table at the given index and k is the pointer p represented as a light userdata. The access is raw; that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value. + + + + Returns the raw "length" of the value at the given index: for strings, this is the string length; for tables, this is the result of the length operator ('#') with no metamethods; for userdata, this is the size of the block of memory allocated for the userdata; for other values, it is 0. + + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + index of table + value + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + + + + + + Does the equivalent of t[p] = v, where t is the table at the given index, p is encoded as a light userdata, and v is the value at the top of the stack. + + + + + + + Sets the C# delegate f as the new value of global name + + + + + + + Removes the element at the given valid index, shifting down the elements above this index to fill the gap. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Moves the top element into the given valid index without shifting any element (therefore replacing the value at that given index), and then pops the top element. + + + + + + To start a coroutine, you push onto the thread stack the main function plus any arguments; then you call lua_resume, + with nargs being the number of arguments. This call returns when the coroutine suspends or finishes its execution. + When it returns, the stack contains all values passed to lua_yield, or all values returned by the body function. + lua_resume returns LUA_YIELD if the coroutine yields, LUA_OK if the coroutine finishes its execution without errors, + or an error code in case of errors (see lua_pcall). + In case of errors, the stack is not unwound, so you can use the debug API over it. + The error object is on the top of the stack. + To resume a coroutine, you remove any results from the last lua_yield, put on its stack only the values to be passed as results from yield, + and then call lua_resume. + The parameter from represents the coroutine that is resuming L. + If there is no such coroutine, this parameter can be NULL. + + + + + + + + Rotates the stack elements between the valid index idx and the top of the stack. The elements are rotated n positions in the direction of the top, for a positive n, or -n positions in the direction of the bottom, for a negative n. The absolute value of n must not be greater than the size of the slice being rotated. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + + Changes the allocator function of a given state to f with user data ud. + + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the debugging hook function. + + Argument f is the hook function. mask specifies on which events the hook will be called: it is formed by a bitwise OR of the constants + + Hook function callback + hook mask + count (used only with LuaHookMas.Count) + + + + Pops a value from the stack and sets it as the new value of global name. + + + + + + Does the equivalent to t[n] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Pops a table from the stack and sets it as the new metatable for the value at the given index. + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index, v is the value at the top of the stack, and k is the value just below the top + + + + + + Accepts any index, or 0, and sets the stack top to this index. If the new top is larger than the old one, then the new elements are filled with nil. If index is 0, then all stack elements are removed. + + + + + + Sets the value of a closure's upvalue. It assigns the value at the top of the stack to the upvalue and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index n is greater than the number of upvalues. + + + + Pops a value from the stack and sets it as the new value associated to the full userdata at the given index. + + + + + + The status can be 0 (LUA_OK) for a normal thread, an error code if the thread finished the execution of a lua_resume with an error, or LUA_YIELD if the thread is suspended. + You can only call functions in threads with status LUA_OK. You can resume threads with status LUA_OK (to start a new coroutine) or LUA_YIELD (to resume a coroutine). + + + + + Converts the zero-terminated string s to a number, pushes that number into the stack, + + + + + + + Converts the Lua value at the given index to a C# boolean value + + + + + + + Converts a value at the given index to a C# function. That value must be a C# function; otherwise, returns NULL + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given as byte array + + + + + + + Converts the Lua value at the given index to a byte array. + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# string + + + + + + + Converts the Lua value at the given index to a C# string + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# double + + + + + + + Converts the Lua value at the given index to a C# double? + + + + + + + Converts the value at the given index to a generic C pointer (void*). The value can be a userdata, a table, a thread, or a function; otherwise, lua_topointer returns NULL. Different objects will give different pointers. There is no way to convert the pointer back to its original value. + Typically this function is used only for hashing and debug information. + + + + + + + Converts the value at the given index to a Lua thread + or return the self if is the main thread + + + + + + + Return an object (refence) at the index + Important if a object was push the object need to fetched using + this method, otherwise the C# object will never be collected + + + + True to free the GCHandle + + + + + If the value at the given index is a full userdata, returns its block address. If the value is a light userdata, returns its pointer. Otherwise, returns NULL + + + + + + + + + + + + + Returns the name of the type of the value at the given index. + + + Name of the type of the value at the given index + + + + Returns a unique identifier for the upvalue numbered n from the closure at index funcindex. + + + + + + + + Returns the pseudo-index that represents the i-th upvalue of the running function + + + + + + + Make the n1-th upvalue of the Lua closure at index funcindex1 refer to the n2-th upvalue of the Lua closure at index funcindex2 + + + + + + + + + Return the version of Lua (e.g 503) + + + + + + Exchange values between different threads of the same state. + This function pops n values from the current stack, and pushes them onto the stack to. + + + + + + + + This function is equivalent to lua_yieldk, but it has no continuation (see §4.7). Therefore, when the thread resumes, it continues the function that called the function calling lua_yield. + + + + + + + Yields a coroutine (thread). When a C function calls lua_yieldk, the running coroutine suspends its execution, and the call to lua_resume that started this coroutine returns + + Number of values from the stack that will be passed as results to lua_resume. + + + + + + + Checks whether cond is true. If it is not, raises an error with a standard message + + + + + + + + Raises an error reporting a problem with argument arg of the C function that called it, using a standard message that includes extramsg as a comment: + + + + + + + + If the object at index obj has a metatable and this metatable has a field e, this function calls this field passing the object as its only argument. + + + + If there is no metatable or no metamethod, this function returns false (without pushing any value on the stack) + + + + Checks whether the function has an argument of any type (including nil) at position arg. + + + + + + Checks whether the function argument arg is an integer (or can be converted to an integer) + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a number and returns this number. + + + + + + + Checks whether the function argument arg is a string and searches for this string in the array lst + + + + + + + + + Grows the stack size to top + sz elements, raising an error if the stack cannot grow + + + + + + + Checks whether the function argument arg has type type + + + + + + + Checks whether the function argument arg is a userdata of the type tname + + + + + True to release the GCHandle + + + + + Checks whether the function argument arg is a userdata of the type tname (see luaL_newmetatable) and returns the userdata address + + + + + + + + Loads and runs the given file + + + It returns false if there are no errors or true in case of errors. + + + + Loads and runs the given string + + + It returns false if there are no errors or true in case of errors. + + + + Raises an error. The error message format is given by fmt plus any extra arguments + + + + + + + + This function produces the return values for process-related functions in the standard library + + + + + + + This function produces the return values for file-related functions in the standard library + + + + + + + + Pushes onto the stack the field e from the metatable of the object at index obj and returns the type of the pushed value + + + + + + + + Pushes onto the stack the metatable associated with name tname in the registry (see luaL_newmetatable) (nil if there is no metatable associated with that name) + + + Returns the type of the pushed value. + + + + Ensures that the value t[fname], where t is the value at index idx, is a table, and pushes that table onto the stack. Returns true if it finds a previous table there and false if it creates a new table + + + + + + + + Returns the "length" of the value at the given index as a number; it is equivalent to the '#' operator in Lua + + + + + + + Loads a buffer as a Lua chunk + + + + + + + + + + + + + + + + Loads a buffer as a Lua chunk + + + + + + + Loads a string as a Lua chunk + + + + + + + + Loads a string as a Lua chunk + + + + + + + Loads a file as a Lua chunk. This function uses lua_load to load the chunk in the file named filename + + + + The status of operation + + + + Loads a file as a Lua chunk. + + + Return the status + + + + Creates a new table and registers there the functions in list library. + + + + + + Creates a new table with a size optimized to store all entries in the array l (but does not actually store them) + + + + + + Creates a new table to be used as a metatable for userdata + + + If the registry already has the key tname, returns false., + + + + Opens all standard Lua libraries into the given state. + + + + + If the function argument arg is an integer (or convertible to an integer), returns this integer. If this argument is absent or is nil, returns d + + + default value + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d /// + + + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d + + + + + + + + If the function argument arg is a number, returns this number. If this argument is absent or is nil, returns d + + + + + + + + Creates and returns a reference, in the table at index t, for the object at the top of the stack (and pops the object). + + + + + + + If modname is not already present in package.loaded, calls function openf with string modname as an argument and sets the call result in package.loaded[modname], as if that function has been called through require + + + + + + + + Registers all functions in the array l (see luaL_Reg) into the table on the top of the stack (below optional upvalues, see next). /// + + + + + + Sets the metatable of the object at the top of the stack as the metatable associated with name tname in the registry + + + + + + Test if the value at index is a reference data + + + + + True to release the GCHandle of object + + + + + This function works like luaL_checkudata, except that, when the test fails, it returns NULL instead of raising an error. + + + + + + + + Creates and pushes a traceback of the stack L1 + + + Tells at which level to start the traceback + + + + Creates and pushes a traceback of the stack L1 + + + appended at the beginning of the traceback + Tells at which level to start the traceback + + + + Returns the name of the type of the value at the given index. + + + + + + + Releases reference ref from the table at index t (see luaL_ref). The entry is removed from the table, so that the referred object can be collected. The reference ref is also freed to be used again + + + + + + + Pushes onto the stack a string identifying the current position of the control at level lvl in the call stack + + + + + + Used by Compare + + + + + compares for equality (==) + + + + + compares for less than + + + + + compares for less or equal + + + + + Structure for lua debug information + + + Do not change this struct because it must match the lua structure lua_Debug + + Reinhard Ostermeier + + + + Get a LuaDebug from IntPtr + + + + + + + Debug event code + + + + + a reasonable name for the given function. Because functions in Lua are first-class values, they do not have a fixed name: some functions can be the value of multiple global variables, while others can be stored only in a table field + + + + + explains the name field. The value of namewhat can be "global", "local", "method", "field", "upvalue", or "" (the empty string) + + + + + the string "Lua" if the function is a Lua function, "C" if it is a C function, "main" if it is the main part of a chunk + + + + + the name of the chunk that created the function. If source starts with a '@', it means that the function was defined in a file where the file name follows the '@'. + + + + + + the current line where the given function is executing. When no line information is available, currentline is set to -1 + + + + + + + + + + the line number where the definition of the function ends. + + + + + number of upvalues + + + + + number of parameters + + + + + true if the function is a vararg function (always true for C functions). + + + + + true if this function invocation was called by a tail call. In this case, the caller of this level is not in the stack. + + + + + a "printable" version of source, to be used in error messages + + + + + Garbage Collector operations + + + + + Stops the garbage collector. + + + + + Restarts the garbage collector. + + + + + Performs a full garbage-collection cycle. + + + + + Returns the current amount of memory (in Kbytes) in use by Lua. + + + + + Returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024 + + + + + Performs an incremental step of garbage collection. + + + + + Sets data as the new value for the pause of the collector (see §2.5) and returns the previous value + + + + + sets data as the new value for the step multiplier of the collector + + + + + returns a boolean that tells whether the collector is running + + + + + Whenever a hook is called, its ar argument has its field event set to the specific event that triggered the hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Tail Call + + + + + Operation value used by Arith method + + + + + adition(+) + + + + + substraction (-) + + + + + Multiplication (*) + + + + + Modulo (%) + + + + + Exponentiation (^) + + + + + performs float division (/) + + + + + performs floor division (//) + + + + + performs bitwise AND + + + + + performs bitwise OR (|) + + + + + performs bitwise exclusive OR (~) + + + + + performs left shift + + + + + performs right shift + + + + + performs mathematical negation (unary -) + + + + + performs bitwise NOT (~) + + + + + LuaRegister store the name and the delegate to register a native function + + + + + Function name + + + + + Function delegate + + + + + Enum for pseudo-index used by registry table + + + + + pseudo-index used by registry table + + + + + Registry index + + + + + At this index the registry has the main thread of the state. + + + + + At this index the registry has the global environment. + + + + + Lua Load/Call status return + + + + + success + + + + + Yield + + + + + a runtime error. + + + + + syntax error during precompilation + + + + + memory allocation error. For such errors, Lua does not call the message handler. + + + + + error while running a __gc metamethod. For such errors, Lua does not call the message handler + + + + + error while running the message handler. + + + + + Lua types + + + + + + + + + + LUA_TNIL + + + + + LUA_TBOOLEAN + + + + + LUA_TLIGHTUSERDATA + + + + + LUA_TNUMBER + + + + + LUA_TSTRING + + + + + LUA_TTABLE + + + + + LUA_TFUNCTION + + + + + LUA_TUSERDATA + + + + + LUA_TTHREAD + + // + + + diff --git a/packages/KeraLua.0.1.14/lib/netstandard2.0/KeraLua.dll b/packages/KeraLua.0.1.14/lib/netstandard2.0/KeraLua.dll new file mode 100644 index 0000000000000000000000000000000000000000..aa2d9c7f4249b3306210356c5eaa0560984e90e3 Binary files /dev/null and b/packages/KeraLua.0.1.14/lib/netstandard2.0/KeraLua.dll differ diff --git a/packages/KeraLua.0.1.14/lib/netstandard2.0/KeraLua.xml b/packages/KeraLua.0.1.14/lib/netstandard2.0/KeraLua.xml new file mode 100644 index 0000000000000000000000000000000000000000..9acb1163bb9756b1dbc486165ba8f453b52f742b --- /dev/null +++ b/packages/KeraLua.0.1.14/lib/netstandard2.0/KeraLua.xml @@ -0,0 +1,1834 @@ + + + + KeraLua + + + + + Lua Hook Event Masks + + + + + Disabled hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Type for C# callbacks + In order to communicate properly with Lua, a C function must use the following protocol, which defines the way parameters and results are passed: a C function receives its arguments from Lua in its stack in direct order (the first argument is pushed first). So, when the function starts, lua_gettop(L) returns the number of arguments received by the function. The first argument (if any) is at index 1 and its last argument is at index lua_gettop(L). To return values to Lua, a C function just pushes them onto the stack, in direct order (the first result is pushed first), and returns the number of results. Any other value in the stack below the results will be properly discarded by Lua. Like a Lua function, a C function called by Lua can also return many results. + + + + + + + Type for debugging hook functions callbacks. + + + + + + + Type for continuation functions + + + + + + + + + The reader function used by lua_load. Every time it needs another piece of the chunk, lua_load calls the reader, passing along its data parameter. The reader must return a pointer to a block of memory with a new piece of the chunk and set size to the block size + + + + + + + + + + + + + + + + + + + The type of the memory-allocation function used by Lua states. The allocator function must provide a functionality similar to realloc + + + + + + + + + + Lua state class, main interface to use Lua library. + + + + + Internal Lua handle pointer. + + + + + Encoding for the string conversions + ASCII by default. + + + + + Returns a pointer to a raw memory area associated with the given Lua state. The application can use this area for any purpose; Lua does not use it for anything. + Each new thread has this area initialized with a copy of the area of the main thread. + + + + + + Get the main thread object, if the object is the main thread will be equal this + + + + + Initialize Lua state, and open the default libs + + flag to enable/disable opening the default libs + + + + Initialize Lua state with allocator function and user data value + This method will NOT open the default libs. + Creates a new thread running in a new, independent state. Returns NULL if it cannot create the thread or the state (due to lack of memory). The argument f is the allocator function; Lua does all memory allocation for this state through this function (see lua_Alloc). The second argument, ud, is an opaque pointer that Lua passes to the allocator in every call. + + LuaAlloc allocator function called to alloc/free memory + opaque pointer passed to allocator + + + + Get the Lua object from IntPtr + Useful for LuaFunction callbacks, if the Lua object was already collected will return null. + + + + + + + Finalizer, will dispose the lua state if wasn't closed + + + + + Dispose lua state + + + + + + Destroys all objects in the given Lua state (calling the corresponding garbage-collection metamethods, if any) and frees all dynamic memory used by this state + + + + + Dispose the lua context (calling Close) + + + + + Converts the acceptable index idx into an equivalent absolute index (that is, one that does not depend on the stack top). + + + + + + + Performs an arithmetic or bitwise operation over the two values (or one, in the case of negations) at the top of the stack, with the value at the top being the second operand, pops these values, and pushes the result of the operation. The function follows the semantics of the corresponding Lua operator (that is, it may call metamethods). + + + + + + Sets a new panic function and returns the old one + + + + + + + Calls a function. + To call a function you must use the following protocol: first, the function to be called is pushed onto the stack; then, the arguments to the function are pushed in direct order; + that is, the first argument is pushed first. Finally you call lua_call; nargs is the number of arguments that you pushed onto the stack. + All arguments and the function value are popped from the stack when the function is called. The function results are pushed onto the stack when the function returns. + The number of results is adjusted to nresults, unless nresults is LUA_MULTRET. In this case, all results from the function are pushed; + Lua takes care that the returned values fit into the stack space, but it does not ensure any extra space in the stack. The function results are pushed onto the stack in direct order (the first result is pushed first), so that after the call the last result is on the top of the stack. + + + + + + + This function behaves exactly like lua_call, but allows the called function to yield + + + + + + + + + Ensures that the stack has space for at least n extra slots (that is, that you can safely push up to n values into it). It returns false if it cannot fulfill the request, + + + + + + Compares two Lua values. Returns 1 if the value at index index1 satisfies op when compared with the value at index index2 + + + + + + + + + Concatenates the n values at the top of the stack, pops them, and leaves the result at the top. If n is 1, the result is the single value on the stack (that is, the function does nothing); + + + + + + Copies the element at index fromidx into the valid index toidx, replacing the value at that position + + + + + + + Creates a new empty table and pushes it onto the stack. Parameter narr is a hint for how many elements the table will have as a sequence; parameter nrec is a hint for how many other elements the table will have + + + + + + + Dumps a function as a binary chunk. Receives a Lua function on the top of the stack and produces a binary chunk that, if loaded again, results in a function equivalent to the one dumped + + + + + + + + + Generates a Lua error, using the value at the top of the stack as the error object. This function does a long jump + + + + + + Controls the garbage collector. + + + + + + + + Returns the memory-allocation function of a given state. If ud is not NULL, Lua stores in *ud the opaque pointer given when the memory-allocator function was set. + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value of the global name. Returns the type of that value + + + + + + + Pushes onto the stack the value t[i], where t is the value at the given index + + + + Returns the type of the pushed value + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + If the value at the given index has a metatable, the function pushes that metatable onto the stack and returns 1 + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Returns the index of the top element in the stack. 0 means an empty stack. + + Returns the index of the top element in the stack. + + + + Pushes onto the stack the Lua value associated with the full userdata at the given index. + + + Returns the type of the pushed value. + + + + Gets information about the n-th upvalue of the closure at index funcindex. It pushes the upvalue's value onto the stack and returns its name. Returns NULL (and pushes nothing) when the index n is greater than the number of upvalues. + For C functions, this function uses the empty string "" as a name for all upvalues. (For Lua functions, upvalues are the external local variables that the function uses, and that are consequently included in its closure.) + Upvalues have no particular order, as they are active through the whole function. They are numbered in an arbitrary order. + + + + Returns the type of the pushed value. + + + + Returns the current hook function. + + + + + Returns the current hook count. + + + + + Returns the current hook mask. + + + + + Moves the top element into the given valid index, shifting up the elements above this index to open space. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Returns if the value at the given index is a boolean + + + + + + + Returns if the value at the given index is a C(#) function + + + + + + + Returns if the value at the given index is a function + + + + + + + Returns if the value at the given index is an integer + + + + + + + Returns if the value at the given index is light user data + + + + + + + Returns if the value at the given index is nil + + + + + + + Returns if the value at the given index is none + + + + + + + Check if the value at the index is none or nil + + + + + + + Returns if the value at the given index is a number + + + + + + + Returns if the value at the given index is a string or a number (which is always convertible to a string) + + + + + + + Returns if the value at the given index is a string + NOTE: This is different from the lua_isstring, which return true if the value is a number + + + + + + + Returns if the value at the given index is a table. + + + + + + + Returns if the value at the given index is a thread. + + + + + + + Returns if the value at the given index is a user data. + + + + + + + Returns if the given coroutine can yield, and 0 otherwise + + + + + Push the length of the value at the given index on the stack. It is equivalent to the '#' operator in Lua (see §3.4.7) and may trigger a metamethod for the "length" event (see §2.4). The result is pushed on the stack. + + + + + + Loads a Lua chunk without running it. If there are no errors, lua_load pushes the compiled chunk as a Lua function on top of the stack. Otherwise, it pushes an error message. + The lua_load function uses a user-supplied reader function to read the chunk (see lua_Reader). The data argument is an opaque value passed to the reader function. + + + + + + + + + + Creates a new empty table and pushes it onto the stack + + + + + Creates a new thread, pushes it on the stack, and returns a pointer to a lua_State that represents this new thread. The new thread returned by this function shares with the original thread its global environment, but has an independent execution stack. + + + + + + This function allocates a new block of memory with the given size, pushes onto the stack a new full userdata with the block address, and returns this address. The host program can freely use this memory + + + + + + + Pops a key from the stack, and pushes a key–value pair from the table at the given index (the "next" pair after the given key). + + + + + + + Calls a function in protected mode. + + + + + + + + This function behaves exactly like lua_pcall, but allows the called function to yield + + + + + + + + + + Pops n elements from the stack. + + + + + + Pushes a boolean value with value b onto the stack. + + + + + + Pushes a new C closure onto the stack. When a C function is created, it is possible to associate + some values with it, thus creating a C closure (see §4.4); these values are then accessible to the function + whenever it is called. To associate values with a C function, first these values must be pushed onto the + stack (when there are multiple values, the first value is pushed first). + Then lua_pushcclosure is called to create and push the C function onto the stack, + with the argument n telling how many values will be associated with the function. + lua_pushcclosure also pops these values from the stack. + + + + + + + Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function. + + + + + + Pushes the global environment onto the stack. + + + + + Pushes an integer with value n onto the stack. + + + + + + Pushes a light userdata onto the stack. + Userdata represent C values in Lua. A light userdata represents a pointer, a void*. It is a value (like a number): you do not create it, it has no individual metatable, and it is not collected (as it was never created). A light userdata is equal to "any" light userdata with the same C address. + + + + + + Pushes a reference data (C# object) onto the stack. + This function uses lua_pushlightuserdata, but uses a GCHandle to store the reference inside the Lua side. + The CGHandle is create as Normal, and will be freed when the value is pop + + + + + + + Pushes binary buffer onto the stack (usually UTF encoded string) or any arbitraty binary data + + + + + + Pushes a string onto the stack + + + + + + Push a instring using string.Format + PushString("Foo {0}", 10); + + + + + + + Pushes a nil value onto the stack. + + + + + Pushes a double with value n onto the stack. + + + + + + Pushes the thread represented by L onto the stack. Returns true if this thread is the main thread of its state. + + + + + + + Pushes a copy of the element at the given index onto the stack. (lua_pushvalue) + The method was renamed, since pushvalue is a bit vague + + + + + + + Returns true if the two values in indices index1 and index2 are primitively equal (that is, without calling the __eq metamethod). Otherwise returns false. Also returns false if any of the indices are not valid. + + + + + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + + + + + Pushes onto the stack the value t[k], where t is the table at the given index and k is the pointer p represented as a light userdata. The access is raw; that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value. + + + + Returns the raw "length" of the value at the given index: for strings, this is the string length; for tables, this is the result of the length operator ('#') with no metamethods; for userdata, this is the size of the block of memory allocated for the userdata; for other values, it is 0. + + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + index of table + value + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + + + + + + Does the equivalent of t[p] = v, where t is the table at the given index, p is encoded as a light userdata, and v is the value at the top of the stack. + + + + + + + Sets the C# delegate f as the new value of global name + + + + + + + Removes the element at the given valid index, shifting down the elements above this index to fill the gap. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Moves the top element into the given valid index without shifting any element (therefore replacing the value at that given index), and then pops the top element. + + + + + + To start a coroutine, you push onto the thread stack the main function plus any arguments; then you call lua_resume, + with nargs being the number of arguments. This call returns when the coroutine suspends or finishes its execution. + When it returns, the stack contains all values passed to lua_yield, or all values returned by the body function. + lua_resume returns LUA_YIELD if the coroutine yields, LUA_OK if the coroutine finishes its execution without errors, + or an error code in case of errors (see lua_pcall). + In case of errors, the stack is not unwound, so you can use the debug API over it. + The error object is on the top of the stack. + To resume a coroutine, you remove any results from the last lua_yield, put on its stack only the values to be passed as results from yield, + and then call lua_resume. + The parameter from represents the coroutine that is resuming L. + If there is no such coroutine, this parameter can be NULL. + + + + + + + + Rotates the stack elements between the valid index idx and the top of the stack. The elements are rotated n positions in the direction of the top, for a positive n, or -n positions in the direction of the bottom, for a negative n. The absolute value of n must not be greater than the size of the slice being rotated. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + + Changes the allocator function of a given state to f with user data ud. + + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the debugging hook function. + + Argument f is the hook function. mask specifies on which events the hook will be called: it is formed by a bitwise OR of the constants + + Hook function callback + hook mask + count (used only with LuaHookMas.Count) + + + + Pops a value from the stack and sets it as the new value of global name. + + + + + + Does the equivalent to t[n] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Pops a table from the stack and sets it as the new metatable for the value at the given index. + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index, v is the value at the top of the stack, and k is the value just below the top + + + + + + Accepts any index, or 0, and sets the stack top to this index. If the new top is larger than the old one, then the new elements are filled with nil. If index is 0, then all stack elements are removed. + + + + + + Sets the value of a closure's upvalue. It assigns the value at the top of the stack to the upvalue and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index n is greater than the number of upvalues. + + + + Pops a value from the stack and sets it as the new value associated to the full userdata at the given index. + + + + + + The status can be 0 (LUA_OK) for a normal thread, an error code if the thread finished the execution of a lua_resume with an error, or LUA_YIELD if the thread is suspended. + You can only call functions in threads with status LUA_OK. You can resume threads with status LUA_OK (to start a new coroutine) or LUA_YIELD (to resume a coroutine). + + + + + Converts the zero-terminated string s to a number, pushes that number into the stack, + + + + + + + Converts the Lua value at the given index to a C# boolean value + + + + + + + Converts a value at the given index to a C# function. That value must be a C# function; otherwise, returns NULL + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given as byte array + + + + + + + Converts the Lua value at the given index to a byte array. + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# string + + + + + + + Converts the Lua value at the given index to a C# string + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# double + + + + + + + Converts the Lua value at the given index to a C# double? + + + + + + + Converts the value at the given index to a generic C pointer (void*). The value can be a userdata, a table, a thread, or a function; otherwise, lua_topointer returns NULL. Different objects will give different pointers. There is no way to convert the pointer back to its original value. + Typically this function is used only for hashing and debug information. + + + + + + + Converts the value at the given index to a Lua thread + or return the self if is the main thread + + + + + + + Return an object (refence) at the index + Important if a object was push the object need to fetched using + this method, otherwise the C# object will never be collected + + + + True to free the GCHandle + + + + + If the value at the given index is a full userdata, returns its block address. If the value is a light userdata, returns its pointer. Otherwise, returns NULL + + + + + + + + + + + + + Returns the name of the type of the value at the given index. + + + Name of the type of the value at the given index + + + + Returns a unique identifier for the upvalue numbered n from the closure at index funcindex. + + + + + + + + Returns the pseudo-index that represents the i-th upvalue of the running function + + + + + + + Make the n1-th upvalue of the Lua closure at index funcindex1 refer to the n2-th upvalue of the Lua closure at index funcindex2 + + + + + + + + + Return the version of Lua (e.g 503) + + + + + + Exchange values between different threads of the same state. + This function pops n values from the current stack, and pushes them onto the stack to. + + + + + + + + This function is equivalent to lua_yieldk, but it has no continuation (see §4.7). Therefore, when the thread resumes, it continues the function that called the function calling lua_yield. + + + + + + + Yields a coroutine (thread). When a C function calls lua_yieldk, the running coroutine suspends its execution, and the call to lua_resume that started this coroutine returns + + Number of values from the stack that will be passed as results to lua_resume. + + + + + + + Checks whether cond is true. If it is not, raises an error with a standard message + + + + + + + + Raises an error reporting a problem with argument arg of the C function that called it, using a standard message that includes extramsg as a comment: + + + + + + + + If the object at index obj has a metatable and this metatable has a field e, this function calls this field passing the object as its only argument. + + + + If there is no metatable or no metamethod, this function returns false (without pushing any value on the stack) + + + + Checks whether the function has an argument of any type (including nil) at position arg. + + + + + + Checks whether the function argument arg is an integer (or can be converted to an integer) + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a number and returns this number. + + + + + + + Checks whether the function argument arg is a string and searches for this string in the array lst + + + + + + + + + Grows the stack size to top + sz elements, raising an error if the stack cannot grow + + + + + + + Checks whether the function argument arg has type type + + + + + + + Checks whether the function argument arg is a userdata of the type tname + + + + + True to release the GCHandle + + + + + Checks whether the function argument arg is a userdata of the type tname (see luaL_newmetatable) and returns the userdata address + + + + + + + + Loads and runs the given file + + + It returns false if there are no errors or true in case of errors. + + + + Loads and runs the given string + + + It returns false if there are no errors or true in case of errors. + + + + Raises an error. The error message format is given by fmt plus any extra arguments + + + + + + + + This function produces the return values for process-related functions in the standard library + + + + + + + This function produces the return values for file-related functions in the standard library + + + + + + + + Pushes onto the stack the field e from the metatable of the object at index obj and returns the type of the pushed value + + + + + + + + Pushes onto the stack the metatable associated with name tname in the registry (see luaL_newmetatable) (nil if there is no metatable associated with that name) + + + Returns the type of the pushed value. + + + + Ensures that the value t[fname], where t is the value at index idx, is a table, and pushes that table onto the stack. Returns true if it finds a previous table there and false if it creates a new table + + + + + + + + Returns the "length" of the value at the given index as a number; it is equivalent to the '#' operator in Lua + + + + + + + Loads a buffer as a Lua chunk + + + + + + + + + + + + + + + + Loads a buffer as a Lua chunk + + + + + + + Loads a string as a Lua chunk + + + + + + + + Loads a string as a Lua chunk + + + + + + + Loads a file as a Lua chunk. This function uses lua_load to load the chunk in the file named filename + + + + The status of operation + + + + Loads a file as a Lua chunk. + + + Return the status + + + + Creates a new table and registers there the functions in list library. + + + + + + Creates a new table with a size optimized to store all entries in the array l (but does not actually store them) + + + + + + Creates a new table to be used as a metatable for userdata + + + If the registry already has the key tname, returns false., + + + + Opens all standard Lua libraries into the given state. + + + + + If the function argument arg is an integer (or convertible to an integer), returns this integer. If this argument is absent or is nil, returns d + + + default value + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d /// + + + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d + + + + + + + + If the function argument arg is a number, returns this number. If this argument is absent or is nil, returns d + + + + + + + + Creates and returns a reference, in the table at index t, for the object at the top of the stack (and pops the object). + + + + + + + If modname is not already present in package.loaded, calls function openf with string modname as an argument and sets the call result in package.loaded[modname], as if that function has been called through require + + + + + + + + Registers all functions in the array l (see luaL_Reg) into the table on the top of the stack (below optional upvalues, see next). /// + + + + + + Sets the metatable of the object at the top of the stack as the metatable associated with name tname in the registry + + + + + + Test if the value at index is a reference data + + + + + True to release the GCHandle of object + + + + + This function works like luaL_checkudata, except that, when the test fails, it returns NULL instead of raising an error. + + + + + + + + Creates and pushes a traceback of the stack L1 + + + Tells at which level to start the traceback + + + + Creates and pushes a traceback of the stack L1 + + + appended at the beginning of the traceback + Tells at which level to start the traceback + + + + Returns the name of the type of the value at the given index. + + + + + + + Releases reference ref from the table at index t (see luaL_ref). The entry is removed from the table, so that the referred object can be collected. The reference ref is also freed to be used again + + + + + + + Pushes onto the stack a string identifying the current position of the control at level lvl in the call stack + + + + + + Used by Compare + + + + + compares for equality (==) + + + + + compares for less than + + + + + compares for less or equal + + + + + Structure for lua debug information + + + Do not change this struct because it must match the lua structure lua_Debug + + Reinhard Ostermeier + + + + Get a LuaDebug from IntPtr + + + + + + + Debug event code + + + + + a reasonable name for the given function. Because functions in Lua are first-class values, they do not have a fixed name: some functions can be the value of multiple global variables, while others can be stored only in a table field + + + + + explains the name field. The value of namewhat can be "global", "local", "method", "field", "upvalue", or "" (the empty string) + + + + + the string "Lua" if the function is a Lua function, "C" if it is a C function, "main" if it is the main part of a chunk + + + + + the name of the chunk that created the function. If source starts with a '@', it means that the function was defined in a file where the file name follows the '@'. + + + + + + the current line where the given function is executing. When no line information is available, currentline is set to -1 + + + + + + + + + + the line number where the definition of the function ends. + + + + + number of upvalues + + + + + number of parameters + + + + + true if the function is a vararg function (always true for C functions). + + + + + true if this function invocation was called by a tail call. In this case, the caller of this level is not in the stack. + + + + + a "printable" version of source, to be used in error messages + + + + + Garbage Collector operations + + + + + Stops the garbage collector. + + + + + Restarts the garbage collector. + + + + + Performs a full garbage-collection cycle. + + + + + Returns the current amount of memory (in Kbytes) in use by Lua. + + + + + Returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024 + + + + + Performs an incremental step of garbage collection. + + + + + Sets data as the new value for the pause of the collector (see §2.5) and returns the previous value + + + + + sets data as the new value for the step multiplier of the collector + + + + + returns a boolean that tells whether the collector is running + + + + + Whenever a hook is called, its ar argument has its field event set to the specific event that triggered the hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Tail Call + + + + + Operation value used by Arith method + + + + + adition(+) + + + + + substraction (-) + + + + + Multiplication (*) + + + + + Modulo (%) + + + + + Exponentiation (^) + + + + + performs float division (/) + + + + + performs floor division (//) + + + + + performs bitwise AND + + + + + performs bitwise OR (|) + + + + + performs bitwise exclusive OR (~) + + + + + performs left shift + + + + + performs right shift + + + + + performs mathematical negation (unary -) + + + + + performs bitwise NOT (~) + + + + + LuaRegister store the name and the delegate to register a native function + + + + + Function name + + + + + Function delegate + + + + + Enum for pseudo-index used by registry table + + + + + pseudo-index used by registry table + + + + + Registry index + + + + + At this index the registry has the main thread of the state. + + + + + At this index the registry has the global environment. + + + + + Lua Load/Call status return + + + + + success + + + + + Yield + + + + + a runtime error. + + + + + syntax error during precompilation + + + + + memory allocation error. For such errors, Lua does not call the message handler. + + + + + error while running a __gc metamethod. For such errors, Lua does not call the message handler + + + + + error while running the message handler. + + + + + Lua types + + + + + + + + + + LUA_TNIL + + + + + LUA_TBOOLEAN + + + + + LUA_TLIGHTUSERDATA + + + + + LUA_TNUMBER + + + + + LUA_TSTRING + + + + + LUA_TTABLE + + + + + LUA_TFUNCTION + + + + + LUA_TUSERDATA + + + + + LUA_TTHREAD + + // + + + diff --git a/packages/KeraLua.0.1.14/lib/xamarinios/KeraLua.dll b/packages/KeraLua.0.1.14/lib/xamarinios/KeraLua.dll new file mode 100644 index 0000000000000000000000000000000000000000..d1f31b0012a6dd53004aa0df78453e073a0d3d3d Binary files /dev/null and b/packages/KeraLua.0.1.14/lib/xamarinios/KeraLua.dll differ diff --git a/packages/KeraLua.0.1.14/lib/xamarinios/KeraLua.xml b/packages/KeraLua.0.1.14/lib/xamarinios/KeraLua.xml new file mode 100644 index 0000000000000000000000000000000000000000..9acb1163bb9756b1dbc486165ba8f453b52f742b --- /dev/null +++ b/packages/KeraLua.0.1.14/lib/xamarinios/KeraLua.xml @@ -0,0 +1,1834 @@ + + + + KeraLua + + + + + Lua Hook Event Masks + + + + + Disabled hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Type for C# callbacks + In order to communicate properly with Lua, a C function must use the following protocol, which defines the way parameters and results are passed: a C function receives its arguments from Lua in its stack in direct order (the first argument is pushed first). So, when the function starts, lua_gettop(L) returns the number of arguments received by the function. The first argument (if any) is at index 1 and its last argument is at index lua_gettop(L). To return values to Lua, a C function just pushes them onto the stack, in direct order (the first result is pushed first), and returns the number of results. Any other value in the stack below the results will be properly discarded by Lua. Like a Lua function, a C function called by Lua can also return many results. + + + + + + + Type for debugging hook functions callbacks. + + + + + + + Type for continuation functions + + + + + + + + + The reader function used by lua_load. Every time it needs another piece of the chunk, lua_load calls the reader, passing along its data parameter. The reader must return a pointer to a block of memory with a new piece of the chunk and set size to the block size + + + + + + + + + + + + + + + + + + + The type of the memory-allocation function used by Lua states. The allocator function must provide a functionality similar to realloc + + + + + + + + + + Lua state class, main interface to use Lua library. + + + + + Internal Lua handle pointer. + + + + + Encoding for the string conversions + ASCII by default. + + + + + Returns a pointer to a raw memory area associated with the given Lua state. The application can use this area for any purpose; Lua does not use it for anything. + Each new thread has this area initialized with a copy of the area of the main thread. + + + + + + Get the main thread object, if the object is the main thread will be equal this + + + + + Initialize Lua state, and open the default libs + + flag to enable/disable opening the default libs + + + + Initialize Lua state with allocator function and user data value + This method will NOT open the default libs. + Creates a new thread running in a new, independent state. Returns NULL if it cannot create the thread or the state (due to lack of memory). The argument f is the allocator function; Lua does all memory allocation for this state through this function (see lua_Alloc). The second argument, ud, is an opaque pointer that Lua passes to the allocator in every call. + + LuaAlloc allocator function called to alloc/free memory + opaque pointer passed to allocator + + + + Get the Lua object from IntPtr + Useful for LuaFunction callbacks, if the Lua object was already collected will return null. + + + + + + + Finalizer, will dispose the lua state if wasn't closed + + + + + Dispose lua state + + + + + + Destroys all objects in the given Lua state (calling the corresponding garbage-collection metamethods, if any) and frees all dynamic memory used by this state + + + + + Dispose the lua context (calling Close) + + + + + Converts the acceptable index idx into an equivalent absolute index (that is, one that does not depend on the stack top). + + + + + + + Performs an arithmetic or bitwise operation over the two values (or one, in the case of negations) at the top of the stack, with the value at the top being the second operand, pops these values, and pushes the result of the operation. The function follows the semantics of the corresponding Lua operator (that is, it may call metamethods). + + + + + + Sets a new panic function and returns the old one + + + + + + + Calls a function. + To call a function you must use the following protocol: first, the function to be called is pushed onto the stack; then, the arguments to the function are pushed in direct order; + that is, the first argument is pushed first. Finally you call lua_call; nargs is the number of arguments that you pushed onto the stack. + All arguments and the function value are popped from the stack when the function is called. The function results are pushed onto the stack when the function returns. + The number of results is adjusted to nresults, unless nresults is LUA_MULTRET. In this case, all results from the function are pushed; + Lua takes care that the returned values fit into the stack space, but it does not ensure any extra space in the stack. The function results are pushed onto the stack in direct order (the first result is pushed first), so that after the call the last result is on the top of the stack. + + + + + + + This function behaves exactly like lua_call, but allows the called function to yield + + + + + + + + + Ensures that the stack has space for at least n extra slots (that is, that you can safely push up to n values into it). It returns false if it cannot fulfill the request, + + + + + + Compares two Lua values. Returns 1 if the value at index index1 satisfies op when compared with the value at index index2 + + + + + + + + + Concatenates the n values at the top of the stack, pops them, and leaves the result at the top. If n is 1, the result is the single value on the stack (that is, the function does nothing); + + + + + + Copies the element at index fromidx into the valid index toidx, replacing the value at that position + + + + + + + Creates a new empty table and pushes it onto the stack. Parameter narr is a hint for how many elements the table will have as a sequence; parameter nrec is a hint for how many other elements the table will have + + + + + + + Dumps a function as a binary chunk. Receives a Lua function on the top of the stack and produces a binary chunk that, if loaded again, results in a function equivalent to the one dumped + + + + + + + + + Generates a Lua error, using the value at the top of the stack as the error object. This function does a long jump + + + + + + Controls the garbage collector. + + + + + + + + Returns the memory-allocation function of a given state. If ud is not NULL, Lua stores in *ud the opaque pointer given when the memory-allocator function was set. + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value of the global name. Returns the type of that value + + + + + + + Pushes onto the stack the value t[i], where t is the value at the given index + + + + Returns the type of the pushed value + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + If the value at the given index has a metatable, the function pushes that metatable onto the stack and returns 1 + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Returns the index of the top element in the stack. 0 means an empty stack. + + Returns the index of the top element in the stack. + + + + Pushes onto the stack the Lua value associated with the full userdata at the given index. + + + Returns the type of the pushed value. + + + + Gets information about the n-th upvalue of the closure at index funcindex. It pushes the upvalue's value onto the stack and returns its name. Returns NULL (and pushes nothing) when the index n is greater than the number of upvalues. + For C functions, this function uses the empty string "" as a name for all upvalues. (For Lua functions, upvalues are the external local variables that the function uses, and that are consequently included in its closure.) + Upvalues have no particular order, as they are active through the whole function. They are numbered in an arbitrary order. + + + + Returns the type of the pushed value. + + + + Returns the current hook function. + + + + + Returns the current hook count. + + + + + Returns the current hook mask. + + + + + Moves the top element into the given valid index, shifting up the elements above this index to open space. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Returns if the value at the given index is a boolean + + + + + + + Returns if the value at the given index is a C(#) function + + + + + + + Returns if the value at the given index is a function + + + + + + + Returns if the value at the given index is an integer + + + + + + + Returns if the value at the given index is light user data + + + + + + + Returns if the value at the given index is nil + + + + + + + Returns if the value at the given index is none + + + + + + + Check if the value at the index is none or nil + + + + + + + Returns if the value at the given index is a number + + + + + + + Returns if the value at the given index is a string or a number (which is always convertible to a string) + + + + + + + Returns if the value at the given index is a string + NOTE: This is different from the lua_isstring, which return true if the value is a number + + + + + + + Returns if the value at the given index is a table. + + + + + + + Returns if the value at the given index is a thread. + + + + + + + Returns if the value at the given index is a user data. + + + + + + + Returns if the given coroutine can yield, and 0 otherwise + + + + + Push the length of the value at the given index on the stack. It is equivalent to the '#' operator in Lua (see §3.4.7) and may trigger a metamethod for the "length" event (see §2.4). The result is pushed on the stack. + + + + + + Loads a Lua chunk without running it. If there are no errors, lua_load pushes the compiled chunk as a Lua function on top of the stack. Otherwise, it pushes an error message. + The lua_load function uses a user-supplied reader function to read the chunk (see lua_Reader). The data argument is an opaque value passed to the reader function. + + + + + + + + + + Creates a new empty table and pushes it onto the stack + + + + + Creates a new thread, pushes it on the stack, and returns a pointer to a lua_State that represents this new thread. The new thread returned by this function shares with the original thread its global environment, but has an independent execution stack. + + + + + + This function allocates a new block of memory with the given size, pushes onto the stack a new full userdata with the block address, and returns this address. The host program can freely use this memory + + + + + + + Pops a key from the stack, and pushes a key–value pair from the table at the given index (the "next" pair after the given key). + + + + + + + Calls a function in protected mode. + + + + + + + + This function behaves exactly like lua_pcall, but allows the called function to yield + + + + + + + + + + Pops n elements from the stack. + + + + + + Pushes a boolean value with value b onto the stack. + + + + + + Pushes a new C closure onto the stack. When a C function is created, it is possible to associate + some values with it, thus creating a C closure (see §4.4); these values are then accessible to the function + whenever it is called. To associate values with a C function, first these values must be pushed onto the + stack (when there are multiple values, the first value is pushed first). + Then lua_pushcclosure is called to create and push the C function onto the stack, + with the argument n telling how many values will be associated with the function. + lua_pushcclosure also pops these values from the stack. + + + + + + + Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function. + + + + + + Pushes the global environment onto the stack. + + + + + Pushes an integer with value n onto the stack. + + + + + + Pushes a light userdata onto the stack. + Userdata represent C values in Lua. A light userdata represents a pointer, a void*. It is a value (like a number): you do not create it, it has no individual metatable, and it is not collected (as it was never created). A light userdata is equal to "any" light userdata with the same C address. + + + + + + Pushes a reference data (C# object) onto the stack. + This function uses lua_pushlightuserdata, but uses a GCHandle to store the reference inside the Lua side. + The CGHandle is create as Normal, and will be freed when the value is pop + + + + + + + Pushes binary buffer onto the stack (usually UTF encoded string) or any arbitraty binary data + + + + + + Pushes a string onto the stack + + + + + + Push a instring using string.Format + PushString("Foo {0}", 10); + + + + + + + Pushes a nil value onto the stack. + + + + + Pushes a double with value n onto the stack. + + + + + + Pushes the thread represented by L onto the stack. Returns true if this thread is the main thread of its state. + + + + + + + Pushes a copy of the element at the given index onto the stack. (lua_pushvalue) + The method was renamed, since pushvalue is a bit vague + + + + + + + Returns true if the two values in indices index1 and index2 are primitively equal (that is, without calling the __eq metamethod). Otherwise returns false. Also returns false if any of the indices are not valid. + + + + + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + + + + + Pushes onto the stack the value t[k], where t is the table at the given index and k is the pointer p represented as a light userdata. The access is raw; that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value. + + + + Returns the raw "length" of the value at the given index: for strings, this is the string length; for tables, this is the result of the length operator ('#') with no metamethods; for userdata, this is the size of the block of memory allocated for the userdata; for other values, it is 0. + + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + index of table + value + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + + + + + + Does the equivalent of t[p] = v, where t is the table at the given index, p is encoded as a light userdata, and v is the value at the top of the stack. + + + + + + + Sets the C# delegate f as the new value of global name + + + + + + + Removes the element at the given valid index, shifting down the elements above this index to fill the gap. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Moves the top element into the given valid index without shifting any element (therefore replacing the value at that given index), and then pops the top element. + + + + + + To start a coroutine, you push onto the thread stack the main function plus any arguments; then you call lua_resume, + with nargs being the number of arguments. This call returns when the coroutine suspends or finishes its execution. + When it returns, the stack contains all values passed to lua_yield, or all values returned by the body function. + lua_resume returns LUA_YIELD if the coroutine yields, LUA_OK if the coroutine finishes its execution without errors, + or an error code in case of errors (see lua_pcall). + In case of errors, the stack is not unwound, so you can use the debug API over it. + The error object is on the top of the stack. + To resume a coroutine, you remove any results from the last lua_yield, put on its stack only the values to be passed as results from yield, + and then call lua_resume. + The parameter from represents the coroutine that is resuming L. + If there is no such coroutine, this parameter can be NULL. + + + + + + + + Rotates the stack elements between the valid index idx and the top of the stack. The elements are rotated n positions in the direction of the top, for a positive n, or -n positions in the direction of the bottom, for a negative n. The absolute value of n must not be greater than the size of the slice being rotated. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + + Changes the allocator function of a given state to f with user data ud. + + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the debugging hook function. + + Argument f is the hook function. mask specifies on which events the hook will be called: it is formed by a bitwise OR of the constants + + Hook function callback + hook mask + count (used only with LuaHookMas.Count) + + + + Pops a value from the stack and sets it as the new value of global name. + + + + + + Does the equivalent to t[n] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Pops a table from the stack and sets it as the new metatable for the value at the given index. + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index, v is the value at the top of the stack, and k is the value just below the top + + + + + + Accepts any index, or 0, and sets the stack top to this index. If the new top is larger than the old one, then the new elements are filled with nil. If index is 0, then all stack elements are removed. + + + + + + Sets the value of a closure's upvalue. It assigns the value at the top of the stack to the upvalue and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index n is greater than the number of upvalues. + + + + Pops a value from the stack and sets it as the new value associated to the full userdata at the given index. + + + + + + The status can be 0 (LUA_OK) for a normal thread, an error code if the thread finished the execution of a lua_resume with an error, or LUA_YIELD if the thread is suspended. + You can only call functions in threads with status LUA_OK. You can resume threads with status LUA_OK (to start a new coroutine) or LUA_YIELD (to resume a coroutine). + + + + + Converts the zero-terminated string s to a number, pushes that number into the stack, + + + + + + + Converts the Lua value at the given index to a C# boolean value + + + + + + + Converts a value at the given index to a C# function. That value must be a C# function; otherwise, returns NULL + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given as byte array + + + + + + + Converts the Lua value at the given index to a byte array. + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# string + + + + + + + Converts the Lua value at the given index to a C# string + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# double + + + + + + + Converts the Lua value at the given index to a C# double? + + + + + + + Converts the value at the given index to a generic C pointer (void*). The value can be a userdata, a table, a thread, or a function; otherwise, lua_topointer returns NULL. Different objects will give different pointers. There is no way to convert the pointer back to its original value. + Typically this function is used only for hashing and debug information. + + + + + + + Converts the value at the given index to a Lua thread + or return the self if is the main thread + + + + + + + Return an object (refence) at the index + Important if a object was push the object need to fetched using + this method, otherwise the C# object will never be collected + + + + True to free the GCHandle + + + + + If the value at the given index is a full userdata, returns its block address. If the value is a light userdata, returns its pointer. Otherwise, returns NULL + + + + + + + + + + + + + Returns the name of the type of the value at the given index. + + + Name of the type of the value at the given index + + + + Returns a unique identifier for the upvalue numbered n from the closure at index funcindex. + + + + + + + + Returns the pseudo-index that represents the i-th upvalue of the running function + + + + + + + Make the n1-th upvalue of the Lua closure at index funcindex1 refer to the n2-th upvalue of the Lua closure at index funcindex2 + + + + + + + + + Return the version of Lua (e.g 503) + + + + + + Exchange values between different threads of the same state. + This function pops n values from the current stack, and pushes them onto the stack to. + + + + + + + + This function is equivalent to lua_yieldk, but it has no continuation (see §4.7). Therefore, when the thread resumes, it continues the function that called the function calling lua_yield. + + + + + + + Yields a coroutine (thread). When a C function calls lua_yieldk, the running coroutine suspends its execution, and the call to lua_resume that started this coroutine returns + + Number of values from the stack that will be passed as results to lua_resume. + + + + + + + Checks whether cond is true. If it is not, raises an error with a standard message + + + + + + + + Raises an error reporting a problem with argument arg of the C function that called it, using a standard message that includes extramsg as a comment: + + + + + + + + If the object at index obj has a metatable and this metatable has a field e, this function calls this field passing the object as its only argument. + + + + If there is no metatable or no metamethod, this function returns false (without pushing any value on the stack) + + + + Checks whether the function has an argument of any type (including nil) at position arg. + + + + + + Checks whether the function argument arg is an integer (or can be converted to an integer) + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a number and returns this number. + + + + + + + Checks whether the function argument arg is a string and searches for this string in the array lst + + + + + + + + + Grows the stack size to top + sz elements, raising an error if the stack cannot grow + + + + + + + Checks whether the function argument arg has type type + + + + + + + Checks whether the function argument arg is a userdata of the type tname + + + + + True to release the GCHandle + + + + + Checks whether the function argument arg is a userdata of the type tname (see luaL_newmetatable) and returns the userdata address + + + + + + + + Loads and runs the given file + + + It returns false if there are no errors or true in case of errors. + + + + Loads and runs the given string + + + It returns false if there are no errors or true in case of errors. + + + + Raises an error. The error message format is given by fmt plus any extra arguments + + + + + + + + This function produces the return values for process-related functions in the standard library + + + + + + + This function produces the return values for file-related functions in the standard library + + + + + + + + Pushes onto the stack the field e from the metatable of the object at index obj and returns the type of the pushed value + + + + + + + + Pushes onto the stack the metatable associated with name tname in the registry (see luaL_newmetatable) (nil if there is no metatable associated with that name) + + + Returns the type of the pushed value. + + + + Ensures that the value t[fname], where t is the value at index idx, is a table, and pushes that table onto the stack. Returns true if it finds a previous table there and false if it creates a new table + + + + + + + + Returns the "length" of the value at the given index as a number; it is equivalent to the '#' operator in Lua + + + + + + + Loads a buffer as a Lua chunk + + + + + + + + + + + + + + + + Loads a buffer as a Lua chunk + + + + + + + Loads a string as a Lua chunk + + + + + + + + Loads a string as a Lua chunk + + + + + + + Loads a file as a Lua chunk. This function uses lua_load to load the chunk in the file named filename + + + + The status of operation + + + + Loads a file as a Lua chunk. + + + Return the status + + + + Creates a new table and registers there the functions in list library. + + + + + + Creates a new table with a size optimized to store all entries in the array l (but does not actually store them) + + + + + + Creates a new table to be used as a metatable for userdata + + + If the registry already has the key tname, returns false., + + + + Opens all standard Lua libraries into the given state. + + + + + If the function argument arg is an integer (or convertible to an integer), returns this integer. If this argument is absent or is nil, returns d + + + default value + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d /// + + + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d + + + + + + + + If the function argument arg is a number, returns this number. If this argument is absent or is nil, returns d + + + + + + + + Creates and returns a reference, in the table at index t, for the object at the top of the stack (and pops the object). + + + + + + + If modname is not already present in package.loaded, calls function openf with string modname as an argument and sets the call result in package.loaded[modname], as if that function has been called through require + + + + + + + + Registers all functions in the array l (see luaL_Reg) into the table on the top of the stack (below optional upvalues, see next). /// + + + + + + Sets the metatable of the object at the top of the stack as the metatable associated with name tname in the registry + + + + + + Test if the value at index is a reference data + + + + + True to release the GCHandle of object + + + + + This function works like luaL_checkudata, except that, when the test fails, it returns NULL instead of raising an error. + + + + + + + + Creates and pushes a traceback of the stack L1 + + + Tells at which level to start the traceback + + + + Creates and pushes a traceback of the stack L1 + + + appended at the beginning of the traceback + Tells at which level to start the traceback + + + + Returns the name of the type of the value at the given index. + + + + + + + Releases reference ref from the table at index t (see luaL_ref). The entry is removed from the table, so that the referred object can be collected. The reference ref is also freed to be used again + + + + + + + Pushes onto the stack a string identifying the current position of the control at level lvl in the call stack + + + + + + Used by Compare + + + + + compares for equality (==) + + + + + compares for less than + + + + + compares for less or equal + + + + + Structure for lua debug information + + + Do not change this struct because it must match the lua structure lua_Debug + + Reinhard Ostermeier + + + + Get a LuaDebug from IntPtr + + + + + + + Debug event code + + + + + a reasonable name for the given function. Because functions in Lua are first-class values, they do not have a fixed name: some functions can be the value of multiple global variables, while others can be stored only in a table field + + + + + explains the name field. The value of namewhat can be "global", "local", "method", "field", "upvalue", or "" (the empty string) + + + + + the string "Lua" if the function is a Lua function, "C" if it is a C function, "main" if it is the main part of a chunk + + + + + the name of the chunk that created the function. If source starts with a '@', it means that the function was defined in a file where the file name follows the '@'. + + + + + + the current line where the given function is executing. When no line information is available, currentline is set to -1 + + + + + + + + + + the line number where the definition of the function ends. + + + + + number of upvalues + + + + + number of parameters + + + + + true if the function is a vararg function (always true for C functions). + + + + + true if this function invocation was called by a tail call. In this case, the caller of this level is not in the stack. + + + + + a "printable" version of source, to be used in error messages + + + + + Garbage Collector operations + + + + + Stops the garbage collector. + + + + + Restarts the garbage collector. + + + + + Performs a full garbage-collection cycle. + + + + + Returns the current amount of memory (in Kbytes) in use by Lua. + + + + + Returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024 + + + + + Performs an incremental step of garbage collection. + + + + + Sets data as the new value for the pause of the collector (see §2.5) and returns the previous value + + + + + sets data as the new value for the step multiplier of the collector + + + + + returns a boolean that tells whether the collector is running + + + + + Whenever a hook is called, its ar argument has its field event set to the specific event that triggered the hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Tail Call + + + + + Operation value used by Arith method + + + + + adition(+) + + + + + substraction (-) + + + + + Multiplication (*) + + + + + Modulo (%) + + + + + Exponentiation (^) + + + + + performs float division (/) + + + + + performs floor division (//) + + + + + performs bitwise AND + + + + + performs bitwise OR (|) + + + + + performs bitwise exclusive OR (~) + + + + + performs left shift + + + + + performs right shift + + + + + performs mathematical negation (unary -) + + + + + performs bitwise NOT (~) + + + + + LuaRegister store the name and the delegate to register a native function + + + + + Function name + + + + + Function delegate + + + + + Enum for pseudo-index used by registry table + + + + + pseudo-index used by registry table + + + + + Registry index + + + + + At this index the registry has the main thread of the state. + + + + + At this index the registry has the global environment. + + + + + Lua Load/Call status return + + + + + success + + + + + Yield + + + + + a runtime error. + + + + + syntax error during precompilation + + + + + memory allocation error. For such errors, Lua does not call the message handler. + + + + + error while running a __gc metamethod. For such errors, Lua does not call the message handler + + + + + error while running the message handler. + + + + + Lua types + + + + + + + + + + LUA_TNIL + + + + + LUA_TBOOLEAN + + + + + LUA_TLIGHTUSERDATA + + + + + LUA_TNUMBER + + + + + LUA_TSTRING + + + + + LUA_TTABLE + + + + + LUA_TFUNCTION + + + + + LUA_TUSERDATA + + + + + LUA_TTHREAD + + // + + + diff --git a/packages/KeraLua.0.1.14/lib/xamarinmac/KeraLua.dll b/packages/KeraLua.0.1.14/lib/xamarinmac/KeraLua.dll new file mode 100644 index 0000000000000000000000000000000000000000..694ea61a698291fbd90508af4d0ba254856863be Binary files /dev/null and b/packages/KeraLua.0.1.14/lib/xamarinmac/KeraLua.dll differ diff --git a/packages/KeraLua.0.1.14/lib/xamarinmac/KeraLua.xml b/packages/KeraLua.0.1.14/lib/xamarinmac/KeraLua.xml new file mode 100644 index 0000000000000000000000000000000000000000..9acb1163bb9756b1dbc486165ba8f453b52f742b --- /dev/null +++ b/packages/KeraLua.0.1.14/lib/xamarinmac/KeraLua.xml @@ -0,0 +1,1834 @@ + + + + KeraLua + + + + + Lua Hook Event Masks + + + + + Disabled hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Type for C# callbacks + In order to communicate properly with Lua, a C function must use the following protocol, which defines the way parameters and results are passed: a C function receives its arguments from Lua in its stack in direct order (the first argument is pushed first). So, when the function starts, lua_gettop(L) returns the number of arguments received by the function. The first argument (if any) is at index 1 and its last argument is at index lua_gettop(L). To return values to Lua, a C function just pushes them onto the stack, in direct order (the first result is pushed first), and returns the number of results. Any other value in the stack below the results will be properly discarded by Lua. Like a Lua function, a C function called by Lua can also return many results. + + + + + + + Type for debugging hook functions callbacks. + + + + + + + Type for continuation functions + + + + + + + + + The reader function used by lua_load. Every time it needs another piece of the chunk, lua_load calls the reader, passing along its data parameter. The reader must return a pointer to a block of memory with a new piece of the chunk and set size to the block size + + + + + + + + + + + + + + + + + + + The type of the memory-allocation function used by Lua states. The allocator function must provide a functionality similar to realloc + + + + + + + + + + Lua state class, main interface to use Lua library. + + + + + Internal Lua handle pointer. + + + + + Encoding for the string conversions + ASCII by default. + + + + + Returns a pointer to a raw memory area associated with the given Lua state. The application can use this area for any purpose; Lua does not use it for anything. + Each new thread has this area initialized with a copy of the area of the main thread. + + + + + + Get the main thread object, if the object is the main thread will be equal this + + + + + Initialize Lua state, and open the default libs + + flag to enable/disable opening the default libs + + + + Initialize Lua state with allocator function and user data value + This method will NOT open the default libs. + Creates a new thread running in a new, independent state. Returns NULL if it cannot create the thread or the state (due to lack of memory). The argument f is the allocator function; Lua does all memory allocation for this state through this function (see lua_Alloc). The second argument, ud, is an opaque pointer that Lua passes to the allocator in every call. + + LuaAlloc allocator function called to alloc/free memory + opaque pointer passed to allocator + + + + Get the Lua object from IntPtr + Useful for LuaFunction callbacks, if the Lua object was already collected will return null. + + + + + + + Finalizer, will dispose the lua state if wasn't closed + + + + + Dispose lua state + + + + + + Destroys all objects in the given Lua state (calling the corresponding garbage-collection metamethods, if any) and frees all dynamic memory used by this state + + + + + Dispose the lua context (calling Close) + + + + + Converts the acceptable index idx into an equivalent absolute index (that is, one that does not depend on the stack top). + + + + + + + Performs an arithmetic or bitwise operation over the two values (or one, in the case of negations) at the top of the stack, with the value at the top being the second operand, pops these values, and pushes the result of the operation. The function follows the semantics of the corresponding Lua operator (that is, it may call metamethods). + + + + + + Sets a new panic function and returns the old one + + + + + + + Calls a function. + To call a function you must use the following protocol: first, the function to be called is pushed onto the stack; then, the arguments to the function are pushed in direct order; + that is, the first argument is pushed first. Finally you call lua_call; nargs is the number of arguments that you pushed onto the stack. + All arguments and the function value are popped from the stack when the function is called. The function results are pushed onto the stack when the function returns. + The number of results is adjusted to nresults, unless nresults is LUA_MULTRET. In this case, all results from the function are pushed; + Lua takes care that the returned values fit into the stack space, but it does not ensure any extra space in the stack. The function results are pushed onto the stack in direct order (the first result is pushed first), so that after the call the last result is on the top of the stack. + + + + + + + This function behaves exactly like lua_call, but allows the called function to yield + + + + + + + + + Ensures that the stack has space for at least n extra slots (that is, that you can safely push up to n values into it). It returns false if it cannot fulfill the request, + + + + + + Compares two Lua values. Returns 1 if the value at index index1 satisfies op when compared with the value at index index2 + + + + + + + + + Concatenates the n values at the top of the stack, pops them, and leaves the result at the top. If n is 1, the result is the single value on the stack (that is, the function does nothing); + + + + + + Copies the element at index fromidx into the valid index toidx, replacing the value at that position + + + + + + + Creates a new empty table and pushes it onto the stack. Parameter narr is a hint for how many elements the table will have as a sequence; parameter nrec is a hint for how many other elements the table will have + + + + + + + Dumps a function as a binary chunk. Receives a Lua function on the top of the stack and produces a binary chunk that, if loaded again, results in a function equivalent to the one dumped + + + + + + + + + Generates a Lua error, using the value at the top of the stack as the error object. This function does a long jump + + + + + + Controls the garbage collector. + + + + + + + + Returns the memory-allocation function of a given state. If ud is not NULL, Lua stores in *ud the opaque pointer given when the memory-allocator function was set. + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value of the global name. Returns the type of that value + + + + + + + Pushes onto the stack the value t[i], where t is the value at the given index + + + + Returns the type of the pushed value + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + If the value at the given index has a metatable, the function pushes that metatable onto the stack and returns 1 + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Returns the index of the top element in the stack. 0 means an empty stack. + + Returns the index of the top element in the stack. + + + + Pushes onto the stack the Lua value associated with the full userdata at the given index. + + + Returns the type of the pushed value. + + + + Gets information about the n-th upvalue of the closure at index funcindex. It pushes the upvalue's value onto the stack and returns its name. Returns NULL (and pushes nothing) when the index n is greater than the number of upvalues. + For C functions, this function uses the empty string "" as a name for all upvalues. (For Lua functions, upvalues are the external local variables that the function uses, and that are consequently included in its closure.) + Upvalues have no particular order, as they are active through the whole function. They are numbered in an arbitrary order. + + + + Returns the type of the pushed value. + + + + Returns the current hook function. + + + + + Returns the current hook count. + + + + + Returns the current hook mask. + + + + + Moves the top element into the given valid index, shifting up the elements above this index to open space. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Returns if the value at the given index is a boolean + + + + + + + Returns if the value at the given index is a C(#) function + + + + + + + Returns if the value at the given index is a function + + + + + + + Returns if the value at the given index is an integer + + + + + + + Returns if the value at the given index is light user data + + + + + + + Returns if the value at the given index is nil + + + + + + + Returns if the value at the given index is none + + + + + + + Check if the value at the index is none or nil + + + + + + + Returns if the value at the given index is a number + + + + + + + Returns if the value at the given index is a string or a number (which is always convertible to a string) + + + + + + + Returns if the value at the given index is a string + NOTE: This is different from the lua_isstring, which return true if the value is a number + + + + + + + Returns if the value at the given index is a table. + + + + + + + Returns if the value at the given index is a thread. + + + + + + + Returns if the value at the given index is a user data. + + + + + + + Returns if the given coroutine can yield, and 0 otherwise + + + + + Push the length of the value at the given index on the stack. It is equivalent to the '#' operator in Lua (see §3.4.7) and may trigger a metamethod for the "length" event (see §2.4). The result is pushed on the stack. + + + + + + Loads a Lua chunk without running it. If there are no errors, lua_load pushes the compiled chunk as a Lua function on top of the stack. Otherwise, it pushes an error message. + The lua_load function uses a user-supplied reader function to read the chunk (see lua_Reader). The data argument is an opaque value passed to the reader function. + + + + + + + + + + Creates a new empty table and pushes it onto the stack + + + + + Creates a new thread, pushes it on the stack, and returns a pointer to a lua_State that represents this new thread. The new thread returned by this function shares with the original thread its global environment, but has an independent execution stack. + + + + + + This function allocates a new block of memory with the given size, pushes onto the stack a new full userdata with the block address, and returns this address. The host program can freely use this memory + + + + + + + Pops a key from the stack, and pushes a key–value pair from the table at the given index (the "next" pair after the given key). + + + + + + + Calls a function in protected mode. + + + + + + + + This function behaves exactly like lua_pcall, but allows the called function to yield + + + + + + + + + + Pops n elements from the stack. + + + + + + Pushes a boolean value with value b onto the stack. + + + + + + Pushes a new C closure onto the stack. When a C function is created, it is possible to associate + some values with it, thus creating a C closure (see §4.4); these values are then accessible to the function + whenever it is called. To associate values with a C function, first these values must be pushed onto the + stack (when there are multiple values, the first value is pushed first). + Then lua_pushcclosure is called to create and push the C function onto the stack, + with the argument n telling how many values will be associated with the function. + lua_pushcclosure also pops these values from the stack. + + + + + + + Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function. + + + + + + Pushes the global environment onto the stack. + + + + + Pushes an integer with value n onto the stack. + + + + + + Pushes a light userdata onto the stack. + Userdata represent C values in Lua. A light userdata represents a pointer, a void*. It is a value (like a number): you do not create it, it has no individual metatable, and it is not collected (as it was never created). A light userdata is equal to "any" light userdata with the same C address. + + + + + + Pushes a reference data (C# object) onto the stack. + This function uses lua_pushlightuserdata, but uses a GCHandle to store the reference inside the Lua side. + The CGHandle is create as Normal, and will be freed when the value is pop + + + + + + + Pushes binary buffer onto the stack (usually UTF encoded string) or any arbitraty binary data + + + + + + Pushes a string onto the stack + + + + + + Push a instring using string.Format + PushString("Foo {0}", 10); + + + + + + + Pushes a nil value onto the stack. + + + + + Pushes a double with value n onto the stack. + + + + + + Pushes the thread represented by L onto the stack. Returns true if this thread is the main thread of its state. + + + + + + + Pushes a copy of the element at the given index onto the stack. (lua_pushvalue) + The method was renamed, since pushvalue is a bit vague + + + + + + + Returns true if the two values in indices index1 and index2 are primitively equal (that is, without calling the __eq metamethod). Otherwise returns false. Also returns false if any of the indices are not valid. + + + + + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + + + + + Pushes onto the stack the value t[k], where t is the table at the given index and k is the pointer p represented as a light userdata. The access is raw; that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value. + + + + Returns the raw "length" of the value at the given index: for strings, this is the string length; for tables, this is the result of the length operator ('#') with no metamethods; for userdata, this is the size of the block of memory allocated for the userdata; for other values, it is 0. + + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + index of table + value + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + + + + + + Does the equivalent of t[p] = v, where t is the table at the given index, p is encoded as a light userdata, and v is the value at the top of the stack. + + + + + + + Sets the C# delegate f as the new value of global name + + + + + + + Removes the element at the given valid index, shifting down the elements above this index to fill the gap. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Moves the top element into the given valid index without shifting any element (therefore replacing the value at that given index), and then pops the top element. + + + + + + To start a coroutine, you push onto the thread stack the main function plus any arguments; then you call lua_resume, + with nargs being the number of arguments. This call returns when the coroutine suspends or finishes its execution. + When it returns, the stack contains all values passed to lua_yield, or all values returned by the body function. + lua_resume returns LUA_YIELD if the coroutine yields, LUA_OK if the coroutine finishes its execution without errors, + or an error code in case of errors (see lua_pcall). + In case of errors, the stack is not unwound, so you can use the debug API over it. + The error object is on the top of the stack. + To resume a coroutine, you remove any results from the last lua_yield, put on its stack only the values to be passed as results from yield, + and then call lua_resume. + The parameter from represents the coroutine that is resuming L. + If there is no such coroutine, this parameter can be NULL. + + + + + + + + Rotates the stack elements between the valid index idx and the top of the stack. The elements are rotated n positions in the direction of the top, for a positive n, or -n positions in the direction of the bottom, for a negative n. The absolute value of n must not be greater than the size of the slice being rotated. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + + Changes the allocator function of a given state to f with user data ud. + + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the debugging hook function. + + Argument f is the hook function. mask specifies on which events the hook will be called: it is formed by a bitwise OR of the constants + + Hook function callback + hook mask + count (used only with LuaHookMas.Count) + + + + Pops a value from the stack and sets it as the new value of global name. + + + + + + Does the equivalent to t[n] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Pops a table from the stack and sets it as the new metatable for the value at the given index. + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index, v is the value at the top of the stack, and k is the value just below the top + + + + + + Accepts any index, or 0, and sets the stack top to this index. If the new top is larger than the old one, then the new elements are filled with nil. If index is 0, then all stack elements are removed. + + + + + + Sets the value of a closure's upvalue. It assigns the value at the top of the stack to the upvalue and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index n is greater than the number of upvalues. + + + + Pops a value from the stack and sets it as the new value associated to the full userdata at the given index. + + + + + + The status can be 0 (LUA_OK) for a normal thread, an error code if the thread finished the execution of a lua_resume with an error, or LUA_YIELD if the thread is suspended. + You can only call functions in threads with status LUA_OK. You can resume threads with status LUA_OK (to start a new coroutine) or LUA_YIELD (to resume a coroutine). + + + + + Converts the zero-terminated string s to a number, pushes that number into the stack, + + + + + + + Converts the Lua value at the given index to a C# boolean value + + + + + + + Converts a value at the given index to a C# function. That value must be a C# function; otherwise, returns NULL + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given as byte array + + + + + + + Converts the Lua value at the given index to a byte array. + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# string + + + + + + + Converts the Lua value at the given index to a C# string + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# double + + + + + + + Converts the Lua value at the given index to a C# double? + + + + + + + Converts the value at the given index to a generic C pointer (void*). The value can be a userdata, a table, a thread, or a function; otherwise, lua_topointer returns NULL. Different objects will give different pointers. There is no way to convert the pointer back to its original value. + Typically this function is used only for hashing and debug information. + + + + + + + Converts the value at the given index to a Lua thread + or return the self if is the main thread + + + + + + + Return an object (refence) at the index + Important if a object was push the object need to fetched using + this method, otherwise the C# object will never be collected + + + + True to free the GCHandle + + + + + If the value at the given index is a full userdata, returns its block address. If the value is a light userdata, returns its pointer. Otherwise, returns NULL + + + + + + + + + + + + + Returns the name of the type of the value at the given index. + + + Name of the type of the value at the given index + + + + Returns a unique identifier for the upvalue numbered n from the closure at index funcindex. + + + + + + + + Returns the pseudo-index that represents the i-th upvalue of the running function + + + + + + + Make the n1-th upvalue of the Lua closure at index funcindex1 refer to the n2-th upvalue of the Lua closure at index funcindex2 + + + + + + + + + Return the version of Lua (e.g 503) + + + + + + Exchange values between different threads of the same state. + This function pops n values from the current stack, and pushes them onto the stack to. + + + + + + + + This function is equivalent to lua_yieldk, but it has no continuation (see §4.7). Therefore, when the thread resumes, it continues the function that called the function calling lua_yield. + + + + + + + Yields a coroutine (thread). When a C function calls lua_yieldk, the running coroutine suspends its execution, and the call to lua_resume that started this coroutine returns + + Number of values from the stack that will be passed as results to lua_resume. + + + + + + + Checks whether cond is true. If it is not, raises an error with a standard message + + + + + + + + Raises an error reporting a problem with argument arg of the C function that called it, using a standard message that includes extramsg as a comment: + + + + + + + + If the object at index obj has a metatable and this metatable has a field e, this function calls this field passing the object as its only argument. + + + + If there is no metatable or no metamethod, this function returns false (without pushing any value on the stack) + + + + Checks whether the function has an argument of any type (including nil) at position arg. + + + + + + Checks whether the function argument arg is an integer (or can be converted to an integer) + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a number and returns this number. + + + + + + + Checks whether the function argument arg is a string and searches for this string in the array lst + + + + + + + + + Grows the stack size to top + sz elements, raising an error if the stack cannot grow + + + + + + + Checks whether the function argument arg has type type + + + + + + + Checks whether the function argument arg is a userdata of the type tname + + + + + True to release the GCHandle + + + + + Checks whether the function argument arg is a userdata of the type tname (see luaL_newmetatable) and returns the userdata address + + + + + + + + Loads and runs the given file + + + It returns false if there are no errors or true in case of errors. + + + + Loads and runs the given string + + + It returns false if there are no errors or true in case of errors. + + + + Raises an error. The error message format is given by fmt plus any extra arguments + + + + + + + + This function produces the return values for process-related functions in the standard library + + + + + + + This function produces the return values for file-related functions in the standard library + + + + + + + + Pushes onto the stack the field e from the metatable of the object at index obj and returns the type of the pushed value + + + + + + + + Pushes onto the stack the metatable associated with name tname in the registry (see luaL_newmetatable) (nil if there is no metatable associated with that name) + + + Returns the type of the pushed value. + + + + Ensures that the value t[fname], where t is the value at index idx, is a table, and pushes that table onto the stack. Returns true if it finds a previous table there and false if it creates a new table + + + + + + + + Returns the "length" of the value at the given index as a number; it is equivalent to the '#' operator in Lua + + + + + + + Loads a buffer as a Lua chunk + + + + + + + + + + + + + + + + Loads a buffer as a Lua chunk + + + + + + + Loads a string as a Lua chunk + + + + + + + + Loads a string as a Lua chunk + + + + + + + Loads a file as a Lua chunk. This function uses lua_load to load the chunk in the file named filename + + + + The status of operation + + + + Loads a file as a Lua chunk. + + + Return the status + + + + Creates a new table and registers there the functions in list library. + + + + + + Creates a new table with a size optimized to store all entries in the array l (but does not actually store them) + + + + + + Creates a new table to be used as a metatable for userdata + + + If the registry already has the key tname, returns false., + + + + Opens all standard Lua libraries into the given state. + + + + + If the function argument arg is an integer (or convertible to an integer), returns this integer. If this argument is absent or is nil, returns d + + + default value + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d /// + + + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d + + + + + + + + If the function argument arg is a number, returns this number. If this argument is absent or is nil, returns d + + + + + + + + Creates and returns a reference, in the table at index t, for the object at the top of the stack (and pops the object). + + + + + + + If modname is not already present in package.loaded, calls function openf with string modname as an argument and sets the call result in package.loaded[modname], as if that function has been called through require + + + + + + + + Registers all functions in the array l (see luaL_Reg) into the table on the top of the stack (below optional upvalues, see next). /// + + + + + + Sets the metatable of the object at the top of the stack as the metatable associated with name tname in the registry + + + + + + Test if the value at index is a reference data + + + + + True to release the GCHandle of object + + + + + This function works like luaL_checkudata, except that, when the test fails, it returns NULL instead of raising an error. + + + + + + + + Creates and pushes a traceback of the stack L1 + + + Tells at which level to start the traceback + + + + Creates and pushes a traceback of the stack L1 + + + appended at the beginning of the traceback + Tells at which level to start the traceback + + + + Returns the name of the type of the value at the given index. + + + + + + + Releases reference ref from the table at index t (see luaL_ref). The entry is removed from the table, so that the referred object can be collected. The reference ref is also freed to be used again + + + + + + + Pushes onto the stack a string identifying the current position of the control at level lvl in the call stack + + + + + + Used by Compare + + + + + compares for equality (==) + + + + + compares for less than + + + + + compares for less or equal + + + + + Structure for lua debug information + + + Do not change this struct because it must match the lua structure lua_Debug + + Reinhard Ostermeier + + + + Get a LuaDebug from IntPtr + + + + + + + Debug event code + + + + + a reasonable name for the given function. Because functions in Lua are first-class values, they do not have a fixed name: some functions can be the value of multiple global variables, while others can be stored only in a table field + + + + + explains the name field. The value of namewhat can be "global", "local", "method", "field", "upvalue", or "" (the empty string) + + + + + the string "Lua" if the function is a Lua function, "C" if it is a C function, "main" if it is the main part of a chunk + + + + + the name of the chunk that created the function. If source starts with a '@', it means that the function was defined in a file where the file name follows the '@'. + + + + + + the current line where the given function is executing. When no line information is available, currentline is set to -1 + + + + + + + + + + the line number where the definition of the function ends. + + + + + number of upvalues + + + + + number of parameters + + + + + true if the function is a vararg function (always true for C functions). + + + + + true if this function invocation was called by a tail call. In this case, the caller of this level is not in the stack. + + + + + a "printable" version of source, to be used in error messages + + + + + Garbage Collector operations + + + + + Stops the garbage collector. + + + + + Restarts the garbage collector. + + + + + Performs a full garbage-collection cycle. + + + + + Returns the current amount of memory (in Kbytes) in use by Lua. + + + + + Returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024 + + + + + Performs an incremental step of garbage collection. + + + + + Sets data as the new value for the pause of the collector (see §2.5) and returns the previous value + + + + + sets data as the new value for the step multiplier of the collector + + + + + returns a boolean that tells whether the collector is running + + + + + Whenever a hook is called, its ar argument has its field event set to the specific event that triggered the hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Tail Call + + + + + Operation value used by Arith method + + + + + adition(+) + + + + + substraction (-) + + + + + Multiplication (*) + + + + + Modulo (%) + + + + + Exponentiation (^) + + + + + performs float division (/) + + + + + performs floor division (//) + + + + + performs bitwise AND + + + + + performs bitwise OR (|) + + + + + performs bitwise exclusive OR (~) + + + + + performs left shift + + + + + performs right shift + + + + + performs mathematical negation (unary -) + + + + + performs bitwise NOT (~) + + + + + LuaRegister store the name and the delegate to register a native function + + + + + Function name + + + + + Function delegate + + + + + Enum for pseudo-index used by registry table + + + + + pseudo-index used by registry table + + + + + Registry index + + + + + At this index the registry has the main thread of the state. + + + + + At this index the registry has the global environment. + + + + + Lua Load/Call status return + + + + + success + + + + + Yield + + + + + a runtime error. + + + + + syntax error during precompilation + + + + + memory allocation error. For such errors, Lua does not call the message handler. + + + + + error while running a __gc metamethod. For such errors, Lua does not call the message handler + + + + + error while running the message handler. + + + + + Lua types + + + + + + + + + + LUA_TNIL + + + + + LUA_TBOOLEAN + + + + + LUA_TLIGHTUSERDATA + + + + + LUA_TNUMBER + + + + + LUA_TSTRING + + + + + LUA_TTABLE + + + + + LUA_TFUNCTION + + + + + LUA_TUSERDATA + + + + + LUA_TTHREAD + + // + + + diff --git a/packages/KeraLua.0.1.14/lib/xamarintvos/KeraLua.dll b/packages/KeraLua.0.1.14/lib/xamarintvos/KeraLua.dll new file mode 100644 index 0000000000000000000000000000000000000000..a9b246dbb2b53fd59ca971ee1ba1560a97266101 Binary files /dev/null and b/packages/KeraLua.0.1.14/lib/xamarintvos/KeraLua.dll differ diff --git a/packages/KeraLua.0.1.14/lib/xamarintvos/KeraLua.xml b/packages/KeraLua.0.1.14/lib/xamarintvos/KeraLua.xml new file mode 100644 index 0000000000000000000000000000000000000000..9acb1163bb9756b1dbc486165ba8f453b52f742b --- /dev/null +++ b/packages/KeraLua.0.1.14/lib/xamarintvos/KeraLua.xml @@ -0,0 +1,1834 @@ + + + + KeraLua + + + + + Lua Hook Event Masks + + + + + Disabled hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Type for C# callbacks + In order to communicate properly with Lua, a C function must use the following protocol, which defines the way parameters and results are passed: a C function receives its arguments from Lua in its stack in direct order (the first argument is pushed first). So, when the function starts, lua_gettop(L) returns the number of arguments received by the function. The first argument (if any) is at index 1 and its last argument is at index lua_gettop(L). To return values to Lua, a C function just pushes them onto the stack, in direct order (the first result is pushed first), and returns the number of results. Any other value in the stack below the results will be properly discarded by Lua. Like a Lua function, a C function called by Lua can also return many results. + + + + + + + Type for debugging hook functions callbacks. + + + + + + + Type for continuation functions + + + + + + + + + The reader function used by lua_load. Every time it needs another piece of the chunk, lua_load calls the reader, passing along its data parameter. The reader must return a pointer to a block of memory with a new piece of the chunk and set size to the block size + + + + + + + + + + + + + + + + + + + The type of the memory-allocation function used by Lua states. The allocator function must provide a functionality similar to realloc + + + + + + + + + + Lua state class, main interface to use Lua library. + + + + + Internal Lua handle pointer. + + + + + Encoding for the string conversions + ASCII by default. + + + + + Returns a pointer to a raw memory area associated with the given Lua state. The application can use this area for any purpose; Lua does not use it for anything. + Each new thread has this area initialized with a copy of the area of the main thread. + + + + + + Get the main thread object, if the object is the main thread will be equal this + + + + + Initialize Lua state, and open the default libs + + flag to enable/disable opening the default libs + + + + Initialize Lua state with allocator function and user data value + This method will NOT open the default libs. + Creates a new thread running in a new, independent state. Returns NULL if it cannot create the thread or the state (due to lack of memory). The argument f is the allocator function; Lua does all memory allocation for this state through this function (see lua_Alloc). The second argument, ud, is an opaque pointer that Lua passes to the allocator in every call. + + LuaAlloc allocator function called to alloc/free memory + opaque pointer passed to allocator + + + + Get the Lua object from IntPtr + Useful for LuaFunction callbacks, if the Lua object was already collected will return null. + + + + + + + Finalizer, will dispose the lua state if wasn't closed + + + + + Dispose lua state + + + + + + Destroys all objects in the given Lua state (calling the corresponding garbage-collection metamethods, if any) and frees all dynamic memory used by this state + + + + + Dispose the lua context (calling Close) + + + + + Converts the acceptable index idx into an equivalent absolute index (that is, one that does not depend on the stack top). + + + + + + + Performs an arithmetic or bitwise operation over the two values (or one, in the case of negations) at the top of the stack, with the value at the top being the second operand, pops these values, and pushes the result of the operation. The function follows the semantics of the corresponding Lua operator (that is, it may call metamethods). + + + + + + Sets a new panic function and returns the old one + + + + + + + Calls a function. + To call a function you must use the following protocol: first, the function to be called is pushed onto the stack; then, the arguments to the function are pushed in direct order; + that is, the first argument is pushed first. Finally you call lua_call; nargs is the number of arguments that you pushed onto the stack. + All arguments and the function value are popped from the stack when the function is called. The function results are pushed onto the stack when the function returns. + The number of results is adjusted to nresults, unless nresults is LUA_MULTRET. In this case, all results from the function are pushed; + Lua takes care that the returned values fit into the stack space, but it does not ensure any extra space in the stack. The function results are pushed onto the stack in direct order (the first result is pushed first), so that after the call the last result is on the top of the stack. + + + + + + + This function behaves exactly like lua_call, but allows the called function to yield + + + + + + + + + Ensures that the stack has space for at least n extra slots (that is, that you can safely push up to n values into it). It returns false if it cannot fulfill the request, + + + + + + Compares two Lua values. Returns 1 if the value at index index1 satisfies op when compared with the value at index index2 + + + + + + + + + Concatenates the n values at the top of the stack, pops them, and leaves the result at the top. If n is 1, the result is the single value on the stack (that is, the function does nothing); + + + + + + Copies the element at index fromidx into the valid index toidx, replacing the value at that position + + + + + + + Creates a new empty table and pushes it onto the stack. Parameter narr is a hint for how many elements the table will have as a sequence; parameter nrec is a hint for how many other elements the table will have + + + + + + + Dumps a function as a binary chunk. Receives a Lua function on the top of the stack and produces a binary chunk that, if loaded again, results in a function equivalent to the one dumped + + + + + + + + + Generates a Lua error, using the value at the top of the stack as the error object. This function does a long jump + + + + + + Controls the garbage collector. + + + + + + + + Returns the memory-allocation function of a given state. If ud is not NULL, Lua stores in *ud the opaque pointer given when the memory-allocator function was set. + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value of the global name. Returns the type of that value + + + + + + + Pushes onto the stack the value t[i], where t is the value at the given index + + + + Returns the type of the pushed value + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + If the value at the given index has a metatable, the function pushes that metatable onto the stack and returns 1 + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Returns the index of the top element in the stack. 0 means an empty stack. + + Returns the index of the top element in the stack. + + + + Pushes onto the stack the Lua value associated with the full userdata at the given index. + + + Returns the type of the pushed value. + + + + Gets information about the n-th upvalue of the closure at index funcindex. It pushes the upvalue's value onto the stack and returns its name. Returns NULL (and pushes nothing) when the index n is greater than the number of upvalues. + For C functions, this function uses the empty string "" as a name for all upvalues. (For Lua functions, upvalues are the external local variables that the function uses, and that are consequently included in its closure.) + Upvalues have no particular order, as they are active through the whole function. They are numbered in an arbitrary order. + + + + Returns the type of the pushed value. + + + + Returns the current hook function. + + + + + Returns the current hook count. + + + + + Returns the current hook mask. + + + + + Moves the top element into the given valid index, shifting up the elements above this index to open space. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Returns if the value at the given index is a boolean + + + + + + + Returns if the value at the given index is a C(#) function + + + + + + + Returns if the value at the given index is a function + + + + + + + Returns if the value at the given index is an integer + + + + + + + Returns if the value at the given index is light user data + + + + + + + Returns if the value at the given index is nil + + + + + + + Returns if the value at the given index is none + + + + + + + Check if the value at the index is none or nil + + + + + + + Returns if the value at the given index is a number + + + + + + + Returns if the value at the given index is a string or a number (which is always convertible to a string) + + + + + + + Returns if the value at the given index is a string + NOTE: This is different from the lua_isstring, which return true if the value is a number + + + + + + + Returns if the value at the given index is a table. + + + + + + + Returns if the value at the given index is a thread. + + + + + + + Returns if the value at the given index is a user data. + + + + + + + Returns if the given coroutine can yield, and 0 otherwise + + + + + Push the length of the value at the given index on the stack. It is equivalent to the '#' operator in Lua (see §3.4.7) and may trigger a metamethod for the "length" event (see §2.4). The result is pushed on the stack. + + + + + + Loads a Lua chunk without running it. If there are no errors, lua_load pushes the compiled chunk as a Lua function on top of the stack. Otherwise, it pushes an error message. + The lua_load function uses a user-supplied reader function to read the chunk (see lua_Reader). The data argument is an opaque value passed to the reader function. + + + + + + + + + + Creates a new empty table and pushes it onto the stack + + + + + Creates a new thread, pushes it on the stack, and returns a pointer to a lua_State that represents this new thread. The new thread returned by this function shares with the original thread its global environment, but has an independent execution stack. + + + + + + This function allocates a new block of memory with the given size, pushes onto the stack a new full userdata with the block address, and returns this address. The host program can freely use this memory + + + + + + + Pops a key from the stack, and pushes a key–value pair from the table at the given index (the "next" pair after the given key). + + + + + + + Calls a function in protected mode. + + + + + + + + This function behaves exactly like lua_pcall, but allows the called function to yield + + + + + + + + + + Pops n elements from the stack. + + + + + + Pushes a boolean value with value b onto the stack. + + + + + + Pushes a new C closure onto the stack. When a C function is created, it is possible to associate + some values with it, thus creating a C closure (see §4.4); these values are then accessible to the function + whenever it is called. To associate values with a C function, first these values must be pushed onto the + stack (when there are multiple values, the first value is pushed first). + Then lua_pushcclosure is called to create and push the C function onto the stack, + with the argument n telling how many values will be associated with the function. + lua_pushcclosure also pops these values from the stack. + + + + + + + Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function. + + + + + + Pushes the global environment onto the stack. + + + + + Pushes an integer with value n onto the stack. + + + + + + Pushes a light userdata onto the stack. + Userdata represent C values in Lua. A light userdata represents a pointer, a void*. It is a value (like a number): you do not create it, it has no individual metatable, and it is not collected (as it was never created). A light userdata is equal to "any" light userdata with the same C address. + + + + + + Pushes a reference data (C# object) onto the stack. + This function uses lua_pushlightuserdata, but uses a GCHandle to store the reference inside the Lua side. + The CGHandle is create as Normal, and will be freed when the value is pop + + + + + + + Pushes binary buffer onto the stack (usually UTF encoded string) or any arbitraty binary data + + + + + + Pushes a string onto the stack + + + + + + Push a instring using string.Format + PushString("Foo {0}", 10); + + + + + + + Pushes a nil value onto the stack. + + + + + Pushes a double with value n onto the stack. + + + + + + Pushes the thread represented by L onto the stack. Returns true if this thread is the main thread of its state. + + + + + + + Pushes a copy of the element at the given index onto the stack. (lua_pushvalue) + The method was renamed, since pushvalue is a bit vague + + + + + + + Returns true if the two values in indices index1 and index2 are primitively equal (that is, without calling the __eq metamethod). Otherwise returns false. Also returns false if any of the indices are not valid. + + + + + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + + + + + Pushes onto the stack the value t[k], where t is the table at the given index and k is the pointer p represented as a light userdata. The access is raw; that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value. + + + + Returns the raw "length" of the value at the given index: for strings, this is the string length; for tables, this is the result of the length operator ('#') with no metamethods; for userdata, this is the size of the block of memory allocated for the userdata; for other values, it is 0. + + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + index of table + value + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + + + + + + Does the equivalent of t[p] = v, where t is the table at the given index, p is encoded as a light userdata, and v is the value at the top of the stack. + + + + + + + Sets the C# delegate f as the new value of global name + + + + + + + Removes the element at the given valid index, shifting down the elements above this index to fill the gap. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Moves the top element into the given valid index without shifting any element (therefore replacing the value at that given index), and then pops the top element. + + + + + + To start a coroutine, you push onto the thread stack the main function plus any arguments; then you call lua_resume, + with nargs being the number of arguments. This call returns when the coroutine suspends or finishes its execution. + When it returns, the stack contains all values passed to lua_yield, or all values returned by the body function. + lua_resume returns LUA_YIELD if the coroutine yields, LUA_OK if the coroutine finishes its execution without errors, + or an error code in case of errors (see lua_pcall). + In case of errors, the stack is not unwound, so you can use the debug API over it. + The error object is on the top of the stack. + To resume a coroutine, you remove any results from the last lua_yield, put on its stack only the values to be passed as results from yield, + and then call lua_resume. + The parameter from represents the coroutine that is resuming L. + If there is no such coroutine, this parameter can be NULL. + + + + + + + + Rotates the stack elements between the valid index idx and the top of the stack. The elements are rotated n positions in the direction of the top, for a positive n, or -n positions in the direction of the bottom, for a negative n. The absolute value of n must not be greater than the size of the slice being rotated. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + + Changes the allocator function of a given state to f with user data ud. + + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the debugging hook function. + + Argument f is the hook function. mask specifies on which events the hook will be called: it is formed by a bitwise OR of the constants + + Hook function callback + hook mask + count (used only with LuaHookMas.Count) + + + + Pops a value from the stack and sets it as the new value of global name. + + + + + + Does the equivalent to t[n] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Pops a table from the stack and sets it as the new metatable for the value at the given index. + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index, v is the value at the top of the stack, and k is the value just below the top + + + + + + Accepts any index, or 0, and sets the stack top to this index. If the new top is larger than the old one, then the new elements are filled with nil. If index is 0, then all stack elements are removed. + + + + + + Sets the value of a closure's upvalue. It assigns the value at the top of the stack to the upvalue and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index n is greater than the number of upvalues. + + + + Pops a value from the stack and sets it as the new value associated to the full userdata at the given index. + + + + + + The status can be 0 (LUA_OK) for a normal thread, an error code if the thread finished the execution of a lua_resume with an error, or LUA_YIELD if the thread is suspended. + You can only call functions in threads with status LUA_OK. You can resume threads with status LUA_OK (to start a new coroutine) or LUA_YIELD (to resume a coroutine). + + + + + Converts the zero-terminated string s to a number, pushes that number into the stack, + + + + + + + Converts the Lua value at the given index to a C# boolean value + + + + + + + Converts a value at the given index to a C# function. That value must be a C# function; otherwise, returns NULL + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given as byte array + + + + + + + Converts the Lua value at the given index to a byte array. + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# string + + + + + + + Converts the Lua value at the given index to a C# string + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# double + + + + + + + Converts the Lua value at the given index to a C# double? + + + + + + + Converts the value at the given index to a generic C pointer (void*). The value can be a userdata, a table, a thread, or a function; otherwise, lua_topointer returns NULL. Different objects will give different pointers. There is no way to convert the pointer back to its original value. + Typically this function is used only for hashing and debug information. + + + + + + + Converts the value at the given index to a Lua thread + or return the self if is the main thread + + + + + + + Return an object (refence) at the index + Important if a object was push the object need to fetched using + this method, otherwise the C# object will never be collected + + + + True to free the GCHandle + + + + + If the value at the given index is a full userdata, returns its block address. If the value is a light userdata, returns its pointer. Otherwise, returns NULL + + + + + + + + + + + + + Returns the name of the type of the value at the given index. + + + Name of the type of the value at the given index + + + + Returns a unique identifier for the upvalue numbered n from the closure at index funcindex. + + + + + + + + Returns the pseudo-index that represents the i-th upvalue of the running function + + + + + + + Make the n1-th upvalue of the Lua closure at index funcindex1 refer to the n2-th upvalue of the Lua closure at index funcindex2 + + + + + + + + + Return the version of Lua (e.g 503) + + + + + + Exchange values between different threads of the same state. + This function pops n values from the current stack, and pushes them onto the stack to. + + + + + + + + This function is equivalent to lua_yieldk, but it has no continuation (see §4.7). Therefore, when the thread resumes, it continues the function that called the function calling lua_yield. + + + + + + + Yields a coroutine (thread). When a C function calls lua_yieldk, the running coroutine suspends its execution, and the call to lua_resume that started this coroutine returns + + Number of values from the stack that will be passed as results to lua_resume. + + + + + + + Checks whether cond is true. If it is not, raises an error with a standard message + + + + + + + + Raises an error reporting a problem with argument arg of the C function that called it, using a standard message that includes extramsg as a comment: + + + + + + + + If the object at index obj has a metatable and this metatable has a field e, this function calls this field passing the object as its only argument. + + + + If there is no metatable or no metamethod, this function returns false (without pushing any value on the stack) + + + + Checks whether the function has an argument of any type (including nil) at position arg. + + + + + + Checks whether the function argument arg is an integer (or can be converted to an integer) + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a number and returns this number. + + + + + + + Checks whether the function argument arg is a string and searches for this string in the array lst + + + + + + + + + Grows the stack size to top + sz elements, raising an error if the stack cannot grow + + + + + + + Checks whether the function argument arg has type type + + + + + + + Checks whether the function argument arg is a userdata of the type tname + + + + + True to release the GCHandle + + + + + Checks whether the function argument arg is a userdata of the type tname (see luaL_newmetatable) and returns the userdata address + + + + + + + + Loads and runs the given file + + + It returns false if there are no errors or true in case of errors. + + + + Loads and runs the given string + + + It returns false if there are no errors or true in case of errors. + + + + Raises an error. The error message format is given by fmt plus any extra arguments + + + + + + + + This function produces the return values for process-related functions in the standard library + + + + + + + This function produces the return values for file-related functions in the standard library + + + + + + + + Pushes onto the stack the field e from the metatable of the object at index obj and returns the type of the pushed value + + + + + + + + Pushes onto the stack the metatable associated with name tname in the registry (see luaL_newmetatable) (nil if there is no metatable associated with that name) + + + Returns the type of the pushed value. + + + + Ensures that the value t[fname], where t is the value at index idx, is a table, and pushes that table onto the stack. Returns true if it finds a previous table there and false if it creates a new table + + + + + + + + Returns the "length" of the value at the given index as a number; it is equivalent to the '#' operator in Lua + + + + + + + Loads a buffer as a Lua chunk + + + + + + + + + + + + + + + + Loads a buffer as a Lua chunk + + + + + + + Loads a string as a Lua chunk + + + + + + + + Loads a string as a Lua chunk + + + + + + + Loads a file as a Lua chunk. This function uses lua_load to load the chunk in the file named filename + + + + The status of operation + + + + Loads a file as a Lua chunk. + + + Return the status + + + + Creates a new table and registers there the functions in list library. + + + + + + Creates a new table with a size optimized to store all entries in the array l (but does not actually store them) + + + + + + Creates a new table to be used as a metatable for userdata + + + If the registry already has the key tname, returns false., + + + + Opens all standard Lua libraries into the given state. + + + + + If the function argument arg is an integer (or convertible to an integer), returns this integer. If this argument is absent or is nil, returns d + + + default value + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d /// + + + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d + + + + + + + + If the function argument arg is a number, returns this number. If this argument is absent or is nil, returns d + + + + + + + + Creates and returns a reference, in the table at index t, for the object at the top of the stack (and pops the object). + + + + + + + If modname is not already present in package.loaded, calls function openf with string modname as an argument and sets the call result in package.loaded[modname], as if that function has been called through require + + + + + + + + Registers all functions in the array l (see luaL_Reg) into the table on the top of the stack (below optional upvalues, see next). /// + + + + + + Sets the metatable of the object at the top of the stack as the metatable associated with name tname in the registry + + + + + + Test if the value at index is a reference data + + + + + True to release the GCHandle of object + + + + + This function works like luaL_checkudata, except that, when the test fails, it returns NULL instead of raising an error. + + + + + + + + Creates and pushes a traceback of the stack L1 + + + Tells at which level to start the traceback + + + + Creates and pushes a traceback of the stack L1 + + + appended at the beginning of the traceback + Tells at which level to start the traceback + + + + Returns the name of the type of the value at the given index. + + + + + + + Releases reference ref from the table at index t (see luaL_ref). The entry is removed from the table, so that the referred object can be collected. The reference ref is also freed to be used again + + + + + + + Pushes onto the stack a string identifying the current position of the control at level lvl in the call stack + + + + + + Used by Compare + + + + + compares for equality (==) + + + + + compares for less than + + + + + compares for less or equal + + + + + Structure for lua debug information + + + Do not change this struct because it must match the lua structure lua_Debug + + Reinhard Ostermeier + + + + Get a LuaDebug from IntPtr + + + + + + + Debug event code + + + + + a reasonable name for the given function. Because functions in Lua are first-class values, they do not have a fixed name: some functions can be the value of multiple global variables, while others can be stored only in a table field + + + + + explains the name field. The value of namewhat can be "global", "local", "method", "field", "upvalue", or "" (the empty string) + + + + + the string "Lua" if the function is a Lua function, "C" if it is a C function, "main" if it is the main part of a chunk + + + + + the name of the chunk that created the function. If source starts with a '@', it means that the function was defined in a file where the file name follows the '@'. + + + + + + the current line where the given function is executing. When no line information is available, currentline is set to -1 + + + + + + + + + + the line number where the definition of the function ends. + + + + + number of upvalues + + + + + number of parameters + + + + + true if the function is a vararg function (always true for C functions). + + + + + true if this function invocation was called by a tail call. In this case, the caller of this level is not in the stack. + + + + + a "printable" version of source, to be used in error messages + + + + + Garbage Collector operations + + + + + Stops the garbage collector. + + + + + Restarts the garbage collector. + + + + + Performs a full garbage-collection cycle. + + + + + Returns the current amount of memory (in Kbytes) in use by Lua. + + + + + Returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024 + + + + + Performs an incremental step of garbage collection. + + + + + Sets data as the new value for the pause of the collector (see §2.5) and returns the previous value + + + + + sets data as the new value for the step multiplier of the collector + + + + + returns a boolean that tells whether the collector is running + + + + + Whenever a hook is called, its ar argument has its field event set to the specific event that triggered the hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Tail Call + + + + + Operation value used by Arith method + + + + + adition(+) + + + + + substraction (-) + + + + + Multiplication (*) + + + + + Modulo (%) + + + + + Exponentiation (^) + + + + + performs float division (/) + + + + + performs floor division (//) + + + + + performs bitwise AND + + + + + performs bitwise OR (|) + + + + + performs bitwise exclusive OR (~) + + + + + performs left shift + + + + + performs right shift + + + + + performs mathematical negation (unary -) + + + + + performs bitwise NOT (~) + + + + + LuaRegister store the name and the delegate to register a native function + + + + + Function name + + + + + Function delegate + + + + + Enum for pseudo-index used by registry table + + + + + pseudo-index used by registry table + + + + + Registry index + + + + + At this index the registry has the main thread of the state. + + + + + At this index the registry has the global environment. + + + + + Lua Load/Call status return + + + + + success + + + + + Yield + + + + + a runtime error. + + + + + syntax error during precompilation + + + + + memory allocation error. For such errors, Lua does not call the message handler. + + + + + error while running a __gc metamethod. For such errors, Lua does not call the message handler + + + + + error while running the message handler. + + + + + Lua types + + + + + + + + + + LUA_TNIL + + + + + LUA_TBOOLEAN + + + + + LUA_TLIGHTUSERDATA + + + + + LUA_TNUMBER + + + + + LUA_TSTRING + + + + + LUA_TTABLE + + + + + LUA_TFUNCTION + + + + + LUA_TUSERDATA + + + + + LUA_TTHREAD + + // + + + diff --git a/packages/KeraLua.0.1.14/lib/xamarinwatchos/KeraLua.dll b/packages/KeraLua.0.1.14/lib/xamarinwatchos/KeraLua.dll new file mode 100644 index 0000000000000000000000000000000000000000..68b2e5446e787ec7cd0f207e0353bca56a97aa55 Binary files /dev/null and b/packages/KeraLua.0.1.14/lib/xamarinwatchos/KeraLua.dll differ diff --git a/packages/KeraLua.0.1.14/lib/xamarinwatchos/KeraLua.xml b/packages/KeraLua.0.1.14/lib/xamarinwatchos/KeraLua.xml new file mode 100644 index 0000000000000000000000000000000000000000..9acb1163bb9756b1dbc486165ba8f453b52f742b --- /dev/null +++ b/packages/KeraLua.0.1.14/lib/xamarinwatchos/KeraLua.xml @@ -0,0 +1,1834 @@ + + + + KeraLua + + + + + Lua Hook Event Masks + + + + + Disabled hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Type for C# callbacks + In order to communicate properly with Lua, a C function must use the following protocol, which defines the way parameters and results are passed: a C function receives its arguments from Lua in its stack in direct order (the first argument is pushed first). So, when the function starts, lua_gettop(L) returns the number of arguments received by the function. The first argument (if any) is at index 1 and its last argument is at index lua_gettop(L). To return values to Lua, a C function just pushes them onto the stack, in direct order (the first result is pushed first), and returns the number of results. Any other value in the stack below the results will be properly discarded by Lua. Like a Lua function, a C function called by Lua can also return many results. + + + + + + + Type for debugging hook functions callbacks. + + + + + + + Type for continuation functions + + + + + + + + + The reader function used by lua_load. Every time it needs another piece of the chunk, lua_load calls the reader, passing along its data parameter. The reader must return a pointer to a block of memory with a new piece of the chunk and set size to the block size + + + + + + + + + + + + + + + + + + + The type of the memory-allocation function used by Lua states. The allocator function must provide a functionality similar to realloc + + + + + + + + + + Lua state class, main interface to use Lua library. + + + + + Internal Lua handle pointer. + + + + + Encoding for the string conversions + ASCII by default. + + + + + Returns a pointer to a raw memory area associated with the given Lua state. The application can use this area for any purpose; Lua does not use it for anything. + Each new thread has this area initialized with a copy of the area of the main thread. + + + + + + Get the main thread object, if the object is the main thread will be equal this + + + + + Initialize Lua state, and open the default libs + + flag to enable/disable opening the default libs + + + + Initialize Lua state with allocator function and user data value + This method will NOT open the default libs. + Creates a new thread running in a new, independent state. Returns NULL if it cannot create the thread or the state (due to lack of memory). The argument f is the allocator function; Lua does all memory allocation for this state through this function (see lua_Alloc). The second argument, ud, is an opaque pointer that Lua passes to the allocator in every call. + + LuaAlloc allocator function called to alloc/free memory + opaque pointer passed to allocator + + + + Get the Lua object from IntPtr + Useful for LuaFunction callbacks, if the Lua object was already collected will return null. + + + + + + + Finalizer, will dispose the lua state if wasn't closed + + + + + Dispose lua state + + + + + + Destroys all objects in the given Lua state (calling the corresponding garbage-collection metamethods, if any) and frees all dynamic memory used by this state + + + + + Dispose the lua context (calling Close) + + + + + Converts the acceptable index idx into an equivalent absolute index (that is, one that does not depend on the stack top). + + + + + + + Performs an arithmetic or bitwise operation over the two values (or one, in the case of negations) at the top of the stack, with the value at the top being the second operand, pops these values, and pushes the result of the operation. The function follows the semantics of the corresponding Lua operator (that is, it may call metamethods). + + + + + + Sets a new panic function and returns the old one + + + + + + + Calls a function. + To call a function you must use the following protocol: first, the function to be called is pushed onto the stack; then, the arguments to the function are pushed in direct order; + that is, the first argument is pushed first. Finally you call lua_call; nargs is the number of arguments that you pushed onto the stack. + All arguments and the function value are popped from the stack when the function is called. The function results are pushed onto the stack when the function returns. + The number of results is adjusted to nresults, unless nresults is LUA_MULTRET. In this case, all results from the function are pushed; + Lua takes care that the returned values fit into the stack space, but it does not ensure any extra space in the stack. The function results are pushed onto the stack in direct order (the first result is pushed first), so that after the call the last result is on the top of the stack. + + + + + + + This function behaves exactly like lua_call, but allows the called function to yield + + + + + + + + + Ensures that the stack has space for at least n extra slots (that is, that you can safely push up to n values into it). It returns false if it cannot fulfill the request, + + + + + + Compares two Lua values. Returns 1 if the value at index index1 satisfies op when compared with the value at index index2 + + + + + + + + + Concatenates the n values at the top of the stack, pops them, and leaves the result at the top. If n is 1, the result is the single value on the stack (that is, the function does nothing); + + + + + + Copies the element at index fromidx into the valid index toidx, replacing the value at that position + + + + + + + Creates a new empty table and pushes it onto the stack. Parameter narr is a hint for how many elements the table will have as a sequence; parameter nrec is a hint for how many other elements the table will have + + + + + + + Dumps a function as a binary chunk. Receives a Lua function on the top of the stack and produces a binary chunk that, if loaded again, results in a function equivalent to the one dumped + + + + + + + + + Generates a Lua error, using the value at the top of the stack as the error object. This function does a long jump + + + + + + Controls the garbage collector. + + + + + + + + Returns the memory-allocation function of a given state. If ud is not NULL, Lua stores in *ud the opaque pointer given when the memory-allocator function was set. + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). + Returns the type of the pushed value. + + + + + + + + Pushes onto the stack the value of the global name. Returns the type of that value + + + + + + + Pushes onto the stack the value t[i], where t is the value at the given index + + + + Returns the type of the pushed value + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a specific function or function invocation. + + + + This function returns false on error (for instance, an invalid option in what). + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + Gets information about a local variable of a given activation record or a given function. + + + + + + + + If the value at the given index has a metatable, the function pushes that metatable onto the stack and returns 1 + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Gets information about the interpreter runtime stack. + + + + + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. + + + Returns the type of the pushed value + + + + Returns the index of the top element in the stack. 0 means an empty stack. + + Returns the index of the top element in the stack. + + + + Pushes onto the stack the Lua value associated with the full userdata at the given index. + + + Returns the type of the pushed value. + + + + Gets information about the n-th upvalue of the closure at index funcindex. It pushes the upvalue's value onto the stack and returns its name. Returns NULL (and pushes nothing) when the index n is greater than the number of upvalues. + For C functions, this function uses the empty string "" as a name for all upvalues. (For Lua functions, upvalues are the external local variables that the function uses, and that are consequently included in its closure.) + Upvalues have no particular order, as they are active through the whole function. They are numbered in an arbitrary order. + + + + Returns the type of the pushed value. + + + + Returns the current hook function. + + + + + Returns the current hook count. + + + + + Returns the current hook mask. + + + + + Moves the top element into the given valid index, shifting up the elements above this index to open space. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Returns if the value at the given index is a boolean + + + + + + + Returns if the value at the given index is a C(#) function + + + + + + + Returns if the value at the given index is a function + + + + + + + Returns if the value at the given index is an integer + + + + + + + Returns if the value at the given index is light user data + + + + + + + Returns if the value at the given index is nil + + + + + + + Returns if the value at the given index is none + + + + + + + Check if the value at the index is none or nil + + + + + + + Returns if the value at the given index is a number + + + + + + + Returns if the value at the given index is a string or a number (which is always convertible to a string) + + + + + + + Returns if the value at the given index is a string + NOTE: This is different from the lua_isstring, which return true if the value is a number + + + + + + + Returns if the value at the given index is a table. + + + + + + + Returns if the value at the given index is a thread. + + + + + + + Returns if the value at the given index is a user data. + + + + + + + Returns if the given coroutine can yield, and 0 otherwise + + + + + Push the length of the value at the given index on the stack. It is equivalent to the '#' operator in Lua (see §3.4.7) and may trigger a metamethod for the "length" event (see §2.4). The result is pushed on the stack. + + + + + + Loads a Lua chunk without running it. If there are no errors, lua_load pushes the compiled chunk as a Lua function on top of the stack. Otherwise, it pushes an error message. + The lua_load function uses a user-supplied reader function to read the chunk (see lua_Reader). The data argument is an opaque value passed to the reader function. + + + + + + + + + + Creates a new empty table and pushes it onto the stack + + + + + Creates a new thread, pushes it on the stack, and returns a pointer to a lua_State that represents this new thread. The new thread returned by this function shares with the original thread its global environment, but has an independent execution stack. + + + + + + This function allocates a new block of memory with the given size, pushes onto the stack a new full userdata with the block address, and returns this address. The host program can freely use this memory + + + + + + + Pops a key from the stack, and pushes a key–value pair from the table at the given index (the "next" pair after the given key). + + + + + + + Calls a function in protected mode. + + + + + + + + This function behaves exactly like lua_pcall, but allows the called function to yield + + + + + + + + + + Pops n elements from the stack. + + + + + + Pushes a boolean value with value b onto the stack. + + + + + + Pushes a new C closure onto the stack. When a C function is created, it is possible to associate + some values with it, thus creating a C closure (see §4.4); these values are then accessible to the function + whenever it is called. To associate values with a C function, first these values must be pushed onto the + stack (when there are multiple values, the first value is pushed first). + Then lua_pushcclosure is called to create and push the C function onto the stack, + with the argument n telling how many values will be associated with the function. + lua_pushcclosure also pops these values from the stack. + + + + + + + Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function. + + + + + + Pushes the global environment onto the stack. + + + + + Pushes an integer with value n onto the stack. + + + + + + Pushes a light userdata onto the stack. + Userdata represent C values in Lua. A light userdata represents a pointer, a void*. It is a value (like a number): you do not create it, it has no individual metatable, and it is not collected (as it was never created). A light userdata is equal to "any" light userdata with the same C address. + + + + + + Pushes a reference data (C# object) onto the stack. + This function uses lua_pushlightuserdata, but uses a GCHandle to store the reference inside the Lua side. + The CGHandle is create as Normal, and will be freed when the value is pop + + + + + + + Pushes binary buffer onto the stack (usually UTF encoded string) or any arbitraty binary data + + + + + + Pushes a string onto the stack + + + + + + Push a instring using string.Format + PushString("Foo {0}", 10); + + + + + + + Pushes a nil value onto the stack. + + + + + Pushes a double with value n onto the stack. + + + + + + Pushes the thread represented by L onto the stack. Returns true if this thread is the main thread of its state. + + + + + + + Pushes a copy of the element at the given index onto the stack. (lua_pushvalue) + The method was renamed, since pushvalue is a bit vague + + + + + + + Returns true if the two values in indices index1 and index2 are primitively equal (that is, without calling the __eq metamethod). Otherwise returns false. Also returns false if any of the indices are not valid. + + + + + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Similar to GetTable, but does a raw access (i.e., without metamethods). + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value + + + + Pushes onto the stack the value t[n], where t is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. + + + + + + + + Pushes onto the stack the value t[k], where t is the table at the given index and k is the pointer p represented as a light userdata. The access is raw; that is, it does not invoke the __index metamethod. + + + + Returns the type of the pushed value. + + + + Returns the raw "length" of the value at the given index: for strings, this is the string length; for tables, this is the result of the length operator ('#') with no metamethods; for userdata, this is the size of the block of memory allocated for the userdata; for other values, it is 0. + + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Similar to lua_settable, but does a raw assignment (i.e., without metamethods). + + + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + index of table + value + + + + Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. + This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod. + + + + + + + Does the equivalent of t[p] = v, where t is the table at the given index, p is encoded as a light userdata, and v is the value at the top of the stack. + + + + + + + Sets the C# delegate f as the new value of global name + + + + + + + Removes the element at the given valid index, shifting down the elements above this index to fill the gap. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + Moves the top element into the given valid index without shifting any element (therefore replacing the value at that given index), and then pops the top element. + + + + + + To start a coroutine, you push onto the thread stack the main function plus any arguments; then you call lua_resume, + with nargs being the number of arguments. This call returns when the coroutine suspends or finishes its execution. + When it returns, the stack contains all values passed to lua_yield, or all values returned by the body function. + lua_resume returns LUA_YIELD if the coroutine yields, LUA_OK if the coroutine finishes its execution without errors, + or an error code in case of errors (see lua_pcall). + In case of errors, the stack is not unwound, so you can use the debug API over it. + The error object is on the top of the stack. + To resume a coroutine, you remove any results from the last lua_yield, put on its stack only the values to be passed as results from yield, + and then call lua_resume. + The parameter from represents the coroutine that is resuming L. + If there is no such coroutine, this parameter can be NULL. + + + + + + + + Rotates the stack elements between the valid index idx and the top of the stack. The elements are rotated n positions in the direction of the top, for a positive n, or -n positions in the direction of the bottom, for a negative n. The absolute value of n must not be greater than the size of the slice being rotated. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. + + + + + + + Changes the allocator function of a given state to f with user data ud. + + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the debugging hook function. + + Argument f is the hook function. mask specifies on which events the hook will be called: it is formed by a bitwise OR of the constants + + Hook function callback + hook mask + count (used only with LuaHookMas.Count) + + + + Pops a value from the stack and sets it as the new value of global name. + + + + + + Does the equivalent to t[n] = v, where t is the value at the given index and v is the value at the top of the stack. + + + + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index is greater than the number of active local variables. + + + + Pops a table from the stack and sets it as the new metatable for the value at the given index. + + + + + + Does the equivalent to t[k] = v, where t is the value at the given index, v is the value at the top of the stack, and k is the value just below the top + + + + + + Accepts any index, or 0, and sets the stack top to this index. If the new top is larger than the old one, then the new elements are filled with nil. If index is 0, then all stack elements are removed. + + + + + + Sets the value of a closure's upvalue. It assigns the value at the top of the stack to the upvalue and returns its name. It also pops the value from the stack. + + + + Returns NULL (and pops nothing) when the index n is greater than the number of upvalues. + + + + Pops a value from the stack and sets it as the new value associated to the full userdata at the given index. + + + + + + The status can be 0 (LUA_OK) for a normal thread, an error code if the thread finished the execution of a lua_resume with an error, or LUA_YIELD if the thread is suspended. + You can only call functions in threads with status LUA_OK. You can resume threads with status LUA_OK (to start a new coroutine) or LUA_YIELD (to resume a coroutine). + + + + + Converts the zero-terminated string s to a number, pushes that number into the stack, + + + + + + + Converts the Lua value at the given index to a C# boolean value + + + + + + + Converts a value at the given index to a C# function. That value must be a C# function; otherwise, returns NULL + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given index to the signed integral type lua_Integer. The Lua value must be an integer, or a number or string convertible to an integer (see §3.4.3); otherwise, lua_tointegerx returns 0. + + + + + + + Converts the Lua value at the given as byte array + + + + + + + Converts the Lua value at the given index to a byte array. + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# string + + + + + + + Converts the Lua value at the given index to a C# string + + + Calls __tostring field if present + + + + + Converts the Lua value at the given index to a C# double + + + + + + + Converts the Lua value at the given index to a C# double? + + + + + + + Converts the value at the given index to a generic C pointer (void*). The value can be a userdata, a table, a thread, or a function; otherwise, lua_topointer returns NULL. Different objects will give different pointers. There is no way to convert the pointer back to its original value. + Typically this function is used only for hashing and debug information. + + + + + + + Converts the value at the given index to a Lua thread + or return the self if is the main thread + + + + + + + Return an object (refence) at the index + Important if a object was push the object need to fetched using + this method, otherwise the C# object will never be collected + + + + True to free the GCHandle + + + + + If the value at the given index is a full userdata, returns its block address. If the value is a light userdata, returns its pointer. Otherwise, returns NULL + + + + + + + + + + + + + Returns the name of the type of the value at the given index. + + + Name of the type of the value at the given index + + + + Returns a unique identifier for the upvalue numbered n from the closure at index funcindex. + + + + + + + + Returns the pseudo-index that represents the i-th upvalue of the running function + + + + + + + Make the n1-th upvalue of the Lua closure at index funcindex1 refer to the n2-th upvalue of the Lua closure at index funcindex2 + + + + + + + + + Return the version of Lua (e.g 503) + + + + + + Exchange values between different threads of the same state. + This function pops n values from the current stack, and pushes them onto the stack to. + + + + + + + + This function is equivalent to lua_yieldk, but it has no continuation (see §4.7). Therefore, when the thread resumes, it continues the function that called the function calling lua_yield. + + + + + + + Yields a coroutine (thread). When a C function calls lua_yieldk, the running coroutine suspends its execution, and the call to lua_resume that started this coroutine returns + + Number of values from the stack that will be passed as results to lua_resume. + + + + + + + Checks whether cond is true. If it is not, raises an error with a standard message + + + + + + + + Raises an error reporting a problem with argument arg of the C function that called it, using a standard message that includes extramsg as a comment: + + + + + + + + If the object at index obj has a metatable and this metatable has a field e, this function calls this field passing the object as its only argument. + + + + If there is no metatable or no metamethod, this function returns false (without pushing any value on the stack) + + + + Checks whether the function has an argument of any type (including nil) at position arg. + + + + + + Checks whether the function argument arg is an integer (or can be converted to an integer) + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a string and returns this string; + + + + + + + Checks whether the function argument arg is a number and returns this number. + + + + + + + Checks whether the function argument arg is a string and searches for this string in the array lst + + + + + + + + + Grows the stack size to top + sz elements, raising an error if the stack cannot grow + + + + + + + Checks whether the function argument arg has type type + + + + + + + Checks whether the function argument arg is a userdata of the type tname + + + + + True to release the GCHandle + + + + + Checks whether the function argument arg is a userdata of the type tname (see luaL_newmetatable) and returns the userdata address + + + + + + + + Loads and runs the given file + + + It returns false if there are no errors or true in case of errors. + + + + Loads and runs the given string + + + It returns false if there are no errors or true in case of errors. + + + + Raises an error. The error message format is given by fmt plus any extra arguments + + + + + + + + This function produces the return values for process-related functions in the standard library + + + + + + + This function produces the return values for file-related functions in the standard library + + + + + + + + Pushes onto the stack the field e from the metatable of the object at index obj and returns the type of the pushed value + + + + + + + + Pushes onto the stack the metatable associated with name tname in the registry (see luaL_newmetatable) (nil if there is no metatable associated with that name) + + + Returns the type of the pushed value. + + + + Ensures that the value t[fname], where t is the value at index idx, is a table, and pushes that table onto the stack. Returns true if it finds a previous table there and false if it creates a new table + + + + + + + + Returns the "length" of the value at the given index as a number; it is equivalent to the '#' operator in Lua + + + + + + + Loads a buffer as a Lua chunk + + + + + + + + + + + + + + + + Loads a buffer as a Lua chunk + + + + + + + Loads a string as a Lua chunk + + + + + + + + Loads a string as a Lua chunk + + + + + + + Loads a file as a Lua chunk. This function uses lua_load to load the chunk in the file named filename + + + + The status of operation + + + + Loads a file as a Lua chunk. + + + Return the status + + + + Creates a new table and registers there the functions in list library. + + + + + + Creates a new table with a size optimized to store all entries in the array l (but does not actually store them) + + + + + + Creates a new table to be used as a metatable for userdata + + + If the registry already has the key tname, returns false., + + + + Opens all standard Lua libraries into the given state. + + + + + If the function argument arg is an integer (or convertible to an integer), returns this integer. If this argument is absent or is nil, returns d + + + default value + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d /// + + + + + + + If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d + + + + + + + + If the function argument arg is a number, returns this number. If this argument is absent or is nil, returns d + + + + + + + + Creates and returns a reference, in the table at index t, for the object at the top of the stack (and pops the object). + + + + + + + If modname is not already present in package.loaded, calls function openf with string modname as an argument and sets the call result in package.loaded[modname], as if that function has been called through require + + + + + + + + Registers all functions in the array l (see luaL_Reg) into the table on the top of the stack (below optional upvalues, see next). /// + + + + + + Sets the metatable of the object at the top of the stack as the metatable associated with name tname in the registry + + + + + + Test if the value at index is a reference data + + + + + True to release the GCHandle of object + + + + + This function works like luaL_checkudata, except that, when the test fails, it returns NULL instead of raising an error. + + + + + + + + Creates and pushes a traceback of the stack L1 + + + Tells at which level to start the traceback + + + + Creates and pushes a traceback of the stack L1 + + + appended at the beginning of the traceback + Tells at which level to start the traceback + + + + Returns the name of the type of the value at the given index. + + + + + + + Releases reference ref from the table at index t (see luaL_ref). The entry is removed from the table, so that the referred object can be collected. The reference ref is also freed to be used again + + + + + + + Pushes onto the stack a string identifying the current position of the control at level lvl in the call stack + + + + + + Used by Compare + + + + + compares for equality (==) + + + + + compares for less than + + + + + compares for less or equal + + + + + Structure for lua debug information + + + Do not change this struct because it must match the lua structure lua_Debug + + Reinhard Ostermeier + + + + Get a LuaDebug from IntPtr + + + + + + + Debug event code + + + + + a reasonable name for the given function. Because functions in Lua are first-class values, they do not have a fixed name: some functions can be the value of multiple global variables, while others can be stored only in a table field + + + + + explains the name field. The value of namewhat can be "global", "local", "method", "field", "upvalue", or "" (the empty string) + + + + + the string "Lua" if the function is a Lua function, "C" if it is a C function, "main" if it is the main part of a chunk + + + + + the name of the chunk that created the function. If source starts with a '@', it means that the function was defined in a file where the file name follows the '@'. + + + + + + the current line where the given function is executing. When no line information is available, currentline is set to -1 + + + + + + + + + + the line number where the definition of the function ends. + + + + + number of upvalues + + + + + number of parameters + + + + + true if the function is a vararg function (always true for C functions). + + + + + true if this function invocation was called by a tail call. In this case, the caller of this level is not in the stack. + + + + + a "printable" version of source, to be used in error messages + + + + + Garbage Collector operations + + + + + Stops the garbage collector. + + + + + Restarts the garbage collector. + + + + + Performs a full garbage-collection cycle. + + + + + Returns the current amount of memory (in Kbytes) in use by Lua. + + + + + Returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024 + + + + + Performs an incremental step of garbage collection. + + + + + Sets data as the new value for the pause of the collector (see §2.5) and returns the previous value + + + + + sets data as the new value for the step multiplier of the collector + + + + + returns a boolean that tells whether the collector is running + + + + + Whenever a hook is called, its ar argument has its field event set to the specific event that triggered the hook + + + + + The call hook: is called when the interpreter calls a function. The hook is called just after Lua enters the new function, before the function gets its arguments. + + + + + The return hook: is called when the interpreter returns from a function. The hook is called just before Lua leaves the function. There is no standard way to access the values to be returned by the function. + + + + + The line hook: is called when the interpreter is about to start the execution of a new line of code, or when it jumps back in the code (even to the same line). (This event only happens while Lua is executing a Lua function.) + + + + + The count hook: is called after the interpreter executes every count instructions. (This event only happens while Lua is executing a Lua function.) + + + + + Tail Call + + + + + Operation value used by Arith method + + + + + adition(+) + + + + + substraction (-) + + + + + Multiplication (*) + + + + + Modulo (%) + + + + + Exponentiation (^) + + + + + performs float division (/) + + + + + performs floor division (//) + + + + + performs bitwise AND + + + + + performs bitwise OR (|) + + + + + performs bitwise exclusive OR (~) + + + + + performs left shift + + + + + performs right shift + + + + + performs mathematical negation (unary -) + + + + + performs bitwise NOT (~) + + + + + LuaRegister store the name and the delegate to register a native function + + + + + Function name + + + + + Function delegate + + + + + Enum for pseudo-index used by registry table + + + + + pseudo-index used by registry table + + + + + Registry index + + + + + At this index the registry has the main thread of the state. + + + + + At this index the registry has the global environment. + + + + + Lua Load/Call status return + + + + + success + + + + + Yield + + + + + a runtime error. + + + + + syntax error during precompilation + + + + + memory allocation error. For such errors, Lua does not call the message handler. + + + + + error while running a __gc metamethod. For such errors, Lua does not call the message handler + + + + + error while running the message handler. + + + + + Lua types + + + + + + + + + + LUA_TNIL + + + + + LUA_TBOOLEAN + + + + + LUA_TLIGHTUSERDATA + + + + + LUA_TNUMBER + + + + + LUA_TSTRING + + + + + LUA_TTABLE + + + + + LUA_TFUNCTION + + + + + LUA_TUSERDATA + + + + + LUA_TTHREAD + + // + + + diff --git a/packages/KeraLua.0.1.14/runtimes/linux-x64/native/liblua53.so b/packages/KeraLua.0.1.14/runtimes/linux-x64/native/liblua53.so new file mode 100644 index 0000000000000000000000000000000000000000..61d28b33c6737c33fb7342e5015141ad20d2ec39 Binary files /dev/null and b/packages/KeraLua.0.1.14/runtimes/linux-x64/native/liblua53.so differ diff --git a/packages/KeraLua.0.1.14/runtimes/osx/native/liblua53.dylib b/packages/KeraLua.0.1.14/runtimes/osx/native/liblua53.dylib new file mode 100644 index 0000000000000000000000000000000000000000..58a00b66dd7a34c3961dfa19f6d90277e2910480 Binary files /dev/null and b/packages/KeraLua.0.1.14/runtimes/osx/native/liblua53.dylib differ diff --git a/packages/KeraLua.0.1.14/runtimes/win-x64/native/lua53.dll b/packages/KeraLua.0.1.14/runtimes/win-x64/native/lua53.dll new file mode 100644 index 0000000000000000000000000000000000000000..bc3096aea6bff83e93cb62a298525d8e03079f05 Binary files /dev/null and b/packages/KeraLua.0.1.14/runtimes/win-x64/native/lua53.dll differ diff --git a/packages/KeraLua.0.1.14/runtimes/win-x86/native/lua53.dll b/packages/KeraLua.0.1.14/runtimes/win-x86/native/lua53.dll new file mode 100644 index 0000000000000000000000000000000000000000..e42641e2febe074adf4dac85a6ec34e9c8e880a3 Binary files /dev/null and b/packages/KeraLua.0.1.14/runtimes/win-x86/native/lua53.dll differ diff --git a/packages/NUnit.2.6.2/NUnit.2.6.2.nupkg b/packages/NUnit.2.6.2/NUnit.2.6.2.nupkg deleted file mode 100644 index 26f15bdc7f1075d97c4e8bdd2ee9bdaf7833fcb6..0000000000000000000000000000000000000000 Binary files a/packages/NUnit.2.6.2/NUnit.2.6.2.nupkg and /dev/null differ diff --git a/packages/NUnit.2.6.2/NUnit.2.6.2.nuspec b/packages/NUnit.2.6.2/NUnit.2.6.2.nuspec deleted file mode 100644 index 5f60f359ec13a3c60200ff19c9b86145cfd43ed9..0000000000000000000000000000000000000000 --- a/packages/NUnit.2.6.2/NUnit.2.6.2.nuspec +++ /dev/null @@ -1,28 +0,0 @@ - - - - NUnit - 2.6.2 - NUnit - Charlie Poole - Charlie Poole - http://nunit.org/nuget/license.html - http://nunit.org/ - http://nunit.org/nuget/nunit_32x32.png - false - NUnit features a fluent assert syntax, parameterized, generic and theory tests and is user-extensible. A number of runners, both from the NUnit project and by third parties, are able to execute NUnit tests. - -Version 2.6 is the seventh major release of this well-known and well-tested programming tool. - -This package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner. - NUnit is a unit-testing framework for all .Net languages with a strong TDD focus. - Version 2.6 is the seventh major release of NUnit. - -Unlike earlier versions, this package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner. - -The nunit.mocks assembly is now provided by the NUnit.Mocks package. The pnunit.framework assembly is provided by the pNUnit package. - - en-US - test testing tdd framework fluent assert theory plugin addin - - \ No newline at end of file diff --git a/packages/NUnit.2.6.2/lib/nunit.framework.dll b/packages/NUnit.2.6.2/lib/nunit.framework.dll deleted file mode 100644 index 3e24ba1ca6260d7d0499624d13d2c5a2cd75b52a..0000000000000000000000000000000000000000 Binary files a/packages/NUnit.2.6.2/lib/nunit.framework.dll and /dev/null differ diff --git a/packages/NUnit.2.6.2/lib/nunit.framework.xml b/packages/NUnit.2.6.2/lib/nunit.framework.xml deleted file mode 100644 index 7702ceebb5f2583a2b80f3490d7284f108630648..0000000000000000000000000000000000000000 --- a/packages/NUnit.2.6.2/lib/nunit.framework.xml +++ /dev/null @@ -1,10899 +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. Use - ExpectedResult by preference. - - The result. - - - - Gets or sets 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 data source, which must - be a property, field or method of the test class itself. - - An array of the names of the factories that will provide data - - - - Construct with a Type, which must implement IEnumerable - - The Type that will provide data - - - - Construct with a Type and name. - 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.2/license.txt b/packages/NUnit.2.6.2/license.txt deleted file mode 100644 index 724e4652e83c00187c188617d28392cfed3df51e..0000000000000000000000000000000000000000 --- a/packages/NUnit.2.6.2/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/NUnit.3.11.0/.signature.p7s b/packages/NUnit.3.11.0/.signature.p7s new file mode 100644 index 0000000000000000000000000000000000000000..3f1cd1b0990de17f1f6bcfc6cb08af75aa5179f3 Binary files /dev/null and b/packages/NUnit.3.11.0/.signature.p7s differ diff --git a/packages/NUnit.3.11.0/CHANGES.md b/packages/NUnit.3.11.0/CHANGES.md new file mode 100644 index 0000000000000000000000000000000000000000..d21193d83c3d72b9832e59500e3c7112504f6b26 --- /dev/null +++ b/packages/NUnit.3.11.0/CHANGES.md @@ -0,0 +1,1631 @@ +### NUnit 3.11 - October 11, 2018 + + * More informative assertion messages + * PlatformAttribute is available on and now detects .NET Core + * ValuesAttribute now works with nullable types + * Async tests detecting and running Windows Forms or WPF message pumps rather than deadlocking + * Support for UWP 10.0 is back via .NET Standard 1.4 + +#### Issues Resolved + + * 352 Test with infinite loop in TearDown cannot be aborted + * 452 Deprecate the existing Chocolatey framework package + * 660 Order dependence of And and Or constraints should be documented + * 1200 async test + Apartment(ApartmentState.STA) => await not returning on STA thread + * 2123 Task.Run inside a test will result in deadlock if a control was created previously + * 2146 Assert.That with a Throws constraint does not provide as much info as Assert.Throws + * 2427 PropertyConstraint throws away the more helpful message in the base constraint result + * 2432 Ability to exclude/include the platform .NET Core + * 2450 NullReferenceException in ExceptionHelper.BuildMessage on Mono + * 2536 SetArgDisplayNames for TestCaseData and TestFixtureData + * 2611 Enable .NET Standard 1.6 tests on non-Windows + * 2693 Ensure that resharper settings are consistent with the editorconfig configuration + * 2757 Broken `char` comparison in v3.7 and higher + * 2759 Test fails with "No arguments were provided" error when no values returned from IParameterDataSource + * 2761 Infinite loop in nunit 3.9 + * 2781 Fixed precompiler typo + * 2786 Timeout value not resetting on Retry of failed test + * 2790 Removing ITypeInfo abstraction + * 2798 [Request] Show actual count value when test fail on Has.Exactly(x).Items + * 2814 Remove public marker types + * 2819 Only run AppVeyor PR build against open PRs + * 2821 Save and restore the SynchronizationContext before and after each test case + * 2823 SetUp failed for test fixture - Array was not a one-dimensional array. Issue seems related to byte[,] method parameters + * 2829 Obsoletion warning for DataAttribute + * 2831 Regular "BusyExecIdle after 200 milliseconds delay" CI failures + * 2833 Use longer BusyExecIdle to avoid CI failures + * 2836 NUnit.Framework.Does cannot be extended + * 2837 DictionaryContainsKeyConstraint behaviour is inconstant with Dictionary.ContainsKey when the dictionary uses a custom Comparer + * 2842 Supporting inheritance of Assert and related classes + * 2854 Has.All.../Has.None... - show non-matching items in error message + * 2863 Make tests robust without depending on the order of attributes + * 2867 Skip executing TestCaseSources for tests which are not included in the filter + * 2876 Implement Discovery-time filtering for NUnitLite + * 2883 Our public ConcurrentQueue causes type conflicts + * 2885 Copy/paste error in Assert.That documentation + * 2887 NETStandard 1.3 support dropped in NUnit 3.10 + * 2896 Some tests are silently skipped on netstandard1.x since #2796 + * 2898 AssemblyPath contains invalid charaters + * 2901 Values attribute support for nullable bool and enum types + * 2923 Update outdated CategoryAttribute xmldoc + * 2928 Improve error message on EmptyConstraint + * 2929 Added NUnit XML schemas + * 2940 Increase StackTracesAreFiltered amount to 5 + * 2955 Potential threading issue in IsolatedContext + * 2965 NuGet Package : Add `repository` metadata. + * 2970 InvalidCastException @ NUnit.Framework.TestFixtureSourceAttribute.BuildFrom + * 2979 Warn.If in Assert.Multiple + * 2994 Error in .NET Standard 1.4 DictionaryContainsKeyConstraint MetadataToken compatibility methods + * 2996 Remove unused enum + * 3009 Fix failing CI Builds by upgrading to NUnit Console 3.9.0 + * 3020 Upgrade nunit-vs-adapter to 3.10 for nUnit 3.11 + * 3024 Unable to add `.IgnoreCase` modifier to an `AnyOf` constraint in collection constraints + * 3032 APIs to restore before 3.11 + +### NUnit 3.10.1 - March 12, 2018 + +Added a namespace to the props file included in the NuGet package to make it +compatible with versions of Visual Studio prior to VS 2017. + +### NUnit 3.10 - March 12, 2018 + +This release adds a .NET Standard 2.0 version of the framework which re-enables +most of the features that have been missing in our earlier .NET Standard builds +like parallelism, timeouts, directory and path based asserts, etc. It also contains +numerous bug fixes and smaller enhancements. We've improved our XML docs, +fixed performance issues and added more detail to Multiple Asserts. + +This release also contains source-indexed PDB files allowing developers to debug +into the NUnit Framework. This allows you to track down errors or see how the +framework works. + +In order to support the .NET Standard 2.0 version, the NUnit project switched to +the new CSPROJ format and now requires Visual Studio 2017 to compile. This only +effects people contributing to the project. NUnit still supports building and +compiling your tests in older .NET IDEs and NUnit still supports older versions +of the .NET Framework back to 2.0. For contributors, NUnit can now compile all +supported targets on Windows, Linux and Mac using the Cake command line build. + +#### Issues Resolved + + * 1373 Setting with a null value + * 1382 Use array argument contents in name of parameterized tests rather than just array type. + * 1578 TestContext.CurrentTest exposes too much internal info + * 1678 Result Message: OneTimeSetUp: Category name must not contain ',', '!', '+' or '-' + * 1944 Removing Compact Framework workarounds + * 1958 System.Reflection.TargetInvocationException after run finished + * 2033 Nameof refactor + * 2202 Best practices for XML doc comments + * 2325 Retry attribute doesn't retry the test. + * 2331 Repo does not build in VS without running `build -t build` first + * 2405 Improve PropertyConstraint error output + * 2421 Publishing symbols with releases + * 2494 CollectionAssert.AllItemsAreUnique() very slow + * 2515 Retarget Solution to use the New CSPROJ Format + * 2518 Bug in CollectionAssert.AreEqual for ValueTuples. + * 2530 Running tests on main thread. Revisiting #2483 + * 2542 NUnit does not support parallelism on .NET Core 2.0 + * 2555 CI timeout: NUnit.Framework.Assertions.CollectionAssertTest.PerformanceTests + * 2564 Add minClientVersion to .nuspec files + * 2566 Refactor `SimpleEnumerableWithIEquatable` test object + * 2577 Warning in TearDown is inconsistent with Assertion failure + * 2580 Remove unused defines + * 2591 NUnitEqualityComparer.Default should be replaced with new NUnitEqualityComparer() + * 2592 Add .props with ProjectCapability to suppress test project service GUID item + * 2608 Culture differences on .NET Core on non-Windows causes test failures + * 2622 Fix flakey test + * 2624 Prevent emails for successful builds on Travis + * 2626 SetUp/TearDown methods are invoked multiple times before/after test in .NET Standard targeted projects + * 2627 Breaking change in CollectionAssert.AllItemsAreUnique with NUnit 3.9 + * 2628 Error during installing tools when running build script + * 2630 Framework throws NullReferenceException if test parameter is marked with [Values(null)] + * 2632 Parallel tests are loading 100% CPU when nested SetUpFixture exists + * 2639 ValuesAttribute causes ExpectedResult to have no effect + * 2647 Add Current Attempt indicator in TestContext for use with RetryAttribute + * 2654 Address feedback from @oznetmaster + * 2656 NuGet package links to outdated license + * 2659 Naming Errors + * 2662 NullReferenceException after parallel tests have finished executing + * 2663 Building NUnit .NET 4.5 in VS2017 fails + * 2669 Removed vestigial build script helper method + * 2670 Invalid assemblies no longer give an error message + * 2671 Ensure that FailureSite.Child is used where appropriate. + * 2685 Remove Rebracer file + * 2688 Assert.Throws swallows console output + * 2695 MultipleAssertException doesn't provide proper details on failures + * 2698 Syntax suggestions errors as warnings + * 2704 Add Constraint to test whether actual item is contained in expected collection + * 2711 NUnitLite: Add support for --nocolor option + * 2714 AnyOfConstraint enumerates multiple times + * 2725 Enable 'strict' compilation flag + * 2726 Replace the ConcurrentQueue and SpinWait compatibility classes + * 2727 Avoid treating warnings as errors inside the IDE + * 2734 TestCaseAttribute: ExpectedResult should support same value conversion as normal method arguments + * 2742 FailureSite not correctly set on containing suites when tests are ignored. + * 2749 Update Travis SDK versions + +### NUnit 3.9 - November 10, 2017 + +This release addresses numerous parallelization issues that were introduced in 3.8 +when method level parallelization was added. Most of the parallelization issues +resolved were tests never completing when using some combinations of parallel tests +and `ApartmentState` not being properly applied to tests in all cases. + +#### Issues Resolved + + * 893 Inconsistent Tuple behavior. + * 1239 NUnit3 sometimes hangs if SetUpFixtures are run in parallel + * 1346 NullReferenceException when [TestFixtureSource] refers to data in a generic class. + * 1473 Allow Is.Ordered to Compare Null Values + * 1899 Constraint Throws.Exception does not catch exception with async lambdas + * 1905 SetupFixture without namespace will make assembly-level Parallelizable attribute useless + * 2091 When a native exception of corrupted state is thrown, nunit test thread crashes and the nunit-console process hangs + * 2102 NUnitLite incorrectly reports Win 10 OS name + * 2271 When CollectionAssert.AreEqual do compare each element, it will ignore the IEquatable of the element too + * 2289 ResolveTypeNameDifference does not handle generic types well + * 2311 Resolve test projects' namespace situation + * 2319 Add .editorconfig to set file encodings so that people don't have to think about it + * 2364 Parallelizable attribute not invalidating invalid parallel scope combinations + * 2372 Create testing for compounded ConstraintFilters + * 2388 Parallelization causes test cases to stop respecting fixture's apartment state + * 2395 NUnit 3.8+ does not finish running tests + * 2398 NUnit CI spurious failures, NUnit.Framework.Internal.ThreadUtilityTests.Kill + * 2402 --labels=All doesn't show anything in console output executing NUnitLite Console Runner + * 2406 Summary descriptions replaced by more detailed ones + * 2411 And constraint on Has.Member throws + * 2412 Using fluent syntax unintentionally removed in 3.8 + * 2418 Support equality comparison delegate + * 2422 Has.Property causes AmbiguousMatchException for shadowing properties + * 2425 XML doc typo fix + * 2426 Regression in 3.8.1: ApartmentAttribute no longer works when applied to an assembly + * 2428 Fix NullReferenceExceptions caused by WorkItemQueue not being thread-safe + * 2429 Stack trace shown for Assert.Warn + * 2438 [Parallelizable] hangs after a few tests + * 2441 Allows to override load-time/execution-time interfaces in built-in tests attributes + * 2446 CI failure in mono Warning tests + * 2448 Inherited Test SetUp, TearDown, etc. are not executed in .NET Core if they are not public + * 2451 Compile RegEx to improve performance + * 2454 SetUpFixture not respecting NonParallelizable tag on TestFixtures. + * 2459 [Parallelizable(ParallelScope.Children)] Unable to finish tests + * 2465 Possible wrong properties are returned by reflection in ReflectionExtensions.cs + * 2467 Test execution hangs when using [SetUpFixture] with NUnit 3.8.x + * 2469 Allow RangeAttribute to be specified multiple times for the same argument + * 2471 Parametrized testcases not running in parallel + * 2475 Framework incorrectly identifies Win 10 in xml results + * 2478 Attributes on SetUpFixture are not applied + * 2486 Message when asserting null with Is.EquivalentTo could be more helpful + * 2497 Use ConstraintUtils.RequireActual through out the codebase + * 2504 Support changing test display name on TestFixtureData + * 2508 Correct divergence from shadowed Is / Has members. + * 2516 When test writes something to the stdErr there is no guaranteed way to link a test-output event to a target test using ITestEventListener + * 2525 Remove unwanted space from comment + * 2526 SerializationException in low trust floating point equality test + * 2533 Matches(Predicate) throws ArgumentException or Fails when actual is null + * 2534 SetUpFixture causes NUnit to lock with Apartment( STA ) + * 2551 CollectionItemsEqualConstraint is missing Using(Func) + * 2554 Made TestFixtureData.SetName internal for 3.9 + +### NUnit 3.8.1 - August 28, 2017 + +This release fixes two critical regressions in the 3.8 release. The first caused the console +runner to crash if you are using test parameters. The second issue caused collection +constraints checking for multiple items in a collection to fail. + +#### Issues Resolved + + * 2386 Contains.Item() fails for collections in NUnit 3.8 + * 2390 Missing value attribute in test parameters setting causes NullReferenceException in console + +### NUnit 3.8 - August 27, 2017 + +This release removes several methods and attributes that were marked obsolete in the +original 3.0 release. Support for iOS and Android has been improved. + +An issue that caused unit tests to run slower was addressed as was a bug that prevented +the use of Assert.Multiple in async code. + +The Order attribute can now also be applied to the class level to set the order +that test fixtures will be run. + +#### Issues Resolved + + * 345 Order of Fixture Execution + * 1151 Include differences in output for Is.EquivalentTo + * 1324 Remove CollectionContainsConstraint + * 1670 Attaching files to the test result + * 1674 InRange-Constraint must work with object + * 1851 TestCaseSource unable to pass one element byte array + * 1996 Timeout does not work if native code is running at the time + * 2004 Has.One as synonym for Has.Exactly(1).Items + * 2062 TestCaseSource attribute causes test to pass when source is not defined + * 2144 Allow option on RandomAttribute to produce distinct values + * 2179 Some NUnit project's tests fail on systems with CultureInfo other than en + * 2195 Contains.Substring with custom StringComparison + * 2196 Expose ParallelizableAttribute (and other attribute) constructor arguments as properties + * 2201 Invalid platform name passed to PlatformAttribute should mark test NotRunnable + * 2208 StackFIlter trims leading spaces from each line + * 2213 SetCultureAttribute: CultureInfo ctor should use default culture settings + * 2217 Console runner performance varies wildly depending on environmental characteristics + * 2219 Remove Obsolete Attributes + * 2225 OneTimeTearDown and Dispose Ordering + * 2237 System.Runtime.Loader not available for iOS/Android + * 2242 Running tests directly should never surface a NullReferenceException + * 2244 Add KeyValuePair to the default formatters + * 2251 Randomizer.NextGuid() + * 2253 Parallelizable(ParallelScope.Fixtures) doesn't work on a TestFixture + * 2254 EqualTo on ValueTuple with Nullable unexpected + * 2261 When an assembly is marked with ParallelScope.None and there are Parallelizable tests NUnit hangs + * 2269 Parallelizable and NonParallelizable attributes on setup and teardown silently ignored + * 2276 Intermittent test failures in Travic CI: TestContextTests + * 2281 Add type constraint for Throws and any method requiring Exception + * 2288 Killing thread cancels test run + * 2292 Is.Ordered.By() with a field throws NullReferenceException + * 2298 Write TestParametersDictionary to xml result file in readable format + * 2299 NUnitLite NuGet package no longer installs NUnit NuGet package + * 2304 Revert accidental doc removal + * 2305 Correct misprint ".con" -> ".com" + * 2312 Prevent crash on invalid --result parsing in NUnitLite + * 2313 Incorrect xmldoc on RetryAttribute + * 2332 Update build script to use NUnitConsoleRunner v3.7.0 + * 2335 Execute OneTimeTearDown as early as possible when running fixtures in parallel + * 2342 Remove deprecated Is.String* Constraints + * 2348 Can't use Assert.Multiple with async code + * 2353 Provide additional Result information through TestContext + * 2358 Get framework to build under Mono 5.0 + * 2360 Obsolete CollectionContainsConstraint Constructors + * 2361 NUnit Parallelizable and OneTimeSetUp with no namespace results in single-threaded test execution + * 2370 TestCaseAttribute can't convert int to nullable long + +### NUnit 3.7.1 - June 6, 2017 + +This is a hotfix release that addresses occasional hangs when using test parallelization +and fixes crashes in NCrunch prior to version 3.9. + +#### Issues Resolved + + * 2205 Ncrunch: System.Xml.XmlException: Root element is missing, when adding NUnit 3.7.0 + * 2209 NUnit occasionally hangs when parallelizable TestFixture has OneTimeSetUp and OneTimeTearDown + +### NUnit 3.7 - May 29, 2017 + +This release of NUnit expands on parallel test execution to allow test methods to +be run in parallel. Please see the [Parallelizable Attribute](https://github.com/nunit/docs/wiki/Parallelizable-Attribute) +for more information. + +NUnit 3.7 also drops the Portable build of the framework and replaces it with a +.NET Standard 1.3 version to compliment the .NET Standard 1.6 version. This change +enables several constraints and other features in the .NET Standard builds that +weren't available in portable like Path and Directory based asserts. + +The AssertionHelper class has been deprecated because it is seldom used and has +not received any of the updates that Asserts and Constraints receive. If your code +is using the AssertionHelper class, we recommend that you migrate your asserts. + +#### Issues Resolved + + * 164 Run test methods within a fixture in parallel + * 391 Multiple Assertions + * 652 Add ability to execute test actions before SetUp or OneTimeSetUp + * 1000 Support multiple Author attributes per test + * 1096 Treat OneTimeSetup and OneTimeTearDown as separate work items + * 1143 NUnitLite - Explore flag does not apply where filter to output + * 1238 Feature request: Print LoaderExceptions when fixture loading fails + * 1363 Make Timeouts work without running test on its own thread + * 1474 Several SetUpFixtures at the same level may be active at the same time + * 1819 TestContext.Progress.Write writes new line + * 1830 Add --labels switch changes to nunilite and nunitlite tests + * 1859 ConcurrentQueue is duplicate with System.Threading.dll package + * 1877 Resolve differences between NUnit Console and NUnitLite implementations of @filename + * 1885 Test parameter containing a semicolon + * 1896 Test has passed however Reason with an empty message is printed in the xml + * 1918 Changing DefaultFloatingPointTolerance breaks tests running in parallel + * 1932 NUnit Warn class should be removed from stack trace by filter + * 1934 NullReferenceException when null arguments are used in TestFixtureAttribute + * 1952 TestContext.Out null when used in task with .NET Core + * 1963 Investigate removing SpecialValue + * 1965 TestContext does not flow in async method + * 1971 Switch CHANGES.txt to Markdown + * 1973 Implemented TestExecutionContext to use AsyncLocal<> for NETSTANDARD1_6 + * 1975 TestFixtureSource doesn't work with a class that has no namespace + * 1983 Add missing ConstraintExpression.Contain overload + * 1990 Add namespace filter + * 1997 Remove unused --verbose and --full command line options + * 1999 Author Tests assume ICustomAttributeProvider.GetCustomAttributes return order is defined + * 2003 Better user info about ParallelizableAttribute and ParallelScope + * 2005 Exclude empty failure messages from results xml + * 2007 3.6 Multiple assertion backwards compatibility + * 2010 Add DelayedConstraint in NetStandard 1.6 build + * 2020 Better message when timeout fails + * 2023 Ability to abort threads running a message pump + * 2025 NullReferenceException using Is.EqualTo on two unequal strings + * 2030 Add method to mark tests as invalid with a reason + * 2031 Limit Language level to C#6 + * 2034 Remove silverlight project - no longer used + * 2035 NullReferenceException inside failing Assert.That call + * 2040 Cannot catch AssertionException + * 2045 NUnitlite-runner crashes if no file is provided + * 2050 Creation of TestExecutionContext should be explicit + * 2052 NullReferenceException with TestCaseSource if a property has no setter + * 2061 TestContext.WorkDirectory not initialized during build process + * 2079 Make TestMethod.Arguments public or otherwise accessible (e.g. TestContext) + * 2080 Allow comments in @FILE files + * 2087 Enhance error message: Test is not runnable in single-threaded context. Timeout + * 2092 Convert Portable library to .NET Standard 1.3 + * 2095 Extend use of tolerance to ComparisonConstraints + * 2099 Include type in start-suite/start-test report elements + * 2110 NullReferenceException when getting TestDirectory from TestContext + * 2115 Mark AssertionHelper as Obsolete + * 2121 Chained PropertyConstraint constraints report incorrect ActualValue + * 2131 Remove "Version 3" suffix from NUnitLite NuGet Package + * 2132 TestFixtureTests.CapturesArgumentsForConstructorWithMultipleArgsSupplied assumes order of custom attributes + * 2143 Non-parallel fixture with parallel children runs in parallel with other fixtures + * 2147 Test Assembly using NUnitLite & Nunit 3.6.1 hangs under .NET Core when `--timeout` is supplied on command line + * 2150 Add portable-slow-tests to Cake file + * 2152 Allow attaching files to TestResults + * 2154 Fix execution of non-parallel test fixtures + * 2157 Getting WorkerId inside Assert.Throws / DoesNotThrow returns null instead of previous non-null value + * 2158 Update SetupFixtureAttribute XML Docs + * 2159 Prevent crash in .NET standard with log file path + * 2165 Trying to install NUnit 3.6.1 on .NET Framework asks for download of 20 more packages + * 2169 Incorrect xmldocs for SetUpAttribute + * 2170 Cake build fails if only Visual Studio 2017 installed + * 2173 Remove PreTestAttribute and PostTestAttribute + * 2186 Replace special characters as part of converting branch names to package versions + * 2191 System.Reflection.TargetInvocationException with nunit3-console --debug on Mono + +### NUnit 3.6.1 - February 26, 2017 + +This is a hotfix release of the framework that addresses critical issues found in +the 3.6 release. + +#### Issues Resolved + + * 1962 A Theory with no data passes + * 1986 NUnitLite ignores --workers option + * 1994 NUnitLite runner crashing when --trace is specified + * 2017 Two NUnit project's tests fail on systems with comma decimal mark settings + * 2043 Regression in 3.6.0 when catching AssertionException + +### NUnit 3.6 - January 9, 2017 + +This release of the framework no longer includes builds for Compact Framework or +for SilverLight, but adds a .NET Standard 1.6 build. If anyone still using +Compact Framework or SilverLight and would like to continue development on those +versions of the framework, please contact the NUnit team. + +#### Framework + + * .NET Standard 1.6 is now supported + * Adds support for Multiple Assert blocks + * Added the --params option to NUnitLite + * Theories now support Nullable enums + * Improved assert error messages to help differentiate differences in values + * Added warnings with Warn.If(), Warn.Unless() and Assert.Warn() + * Enabled Path, File and Directory Asserts/Contraints for .NET Core testing + * Added NonTestAssemblyAttribute for use by third-party developers to indicate + that their assemblies reference the NUnit framework, but do not contain tests + +#### Issues Resolved + + * 406 Warning-level Assertions + * 890 Allow file references anywhere in the command line. + * 1380 Appveyor Failures when branch name is too long + * 1589 Split the nunit repository into multiple repositories + * 1599 Move Compact Framework to separate project + * 1601 Move Silverlight to a separate project + * 1609 Upgrade Cake build to latest version + * 1661 Create .NET Standard Framework Build + * 1668 Need implementation-independent way to test number of items in a collection + * 1743 Provide multiple results for a test case in the XML output + * 1758 No direct inverse for Contains.Key + * 1765 TestCaseSourceAttribute constructor for method with parameters + * 1802 Design Multiple Assert syntax as seen by users + * 1808 Disambiguate error messages from EqualConstraint + * 1811 Build.ps1 fails if spaces in path + * 1823 Remove engine nuspecs and old global.json + * 1827 Remove unused repository paths from repositories.config + * 1828 Add Retry for failed tests only + * 1829 NUnitLite accepts --params option but does not make any use of it. + * 1836 Support nullable enums in Theories + * 1837 [Request] AfterContraint to support more readable usage + * 1840 Remove SL and CF #Defined source + * 1866 [Request] More readable way to set polling interval in After constraint + * 1870 EqualConstraint result failure message for DateTime doesn't show sufficient resolution + * 1872 Parameterized method being called with no parameter + * 1876 What should we do about Env.cs + * 1880 AttributeUsage for various Attributes + * 1889 Modify nunitlite to display multiple assert information + * 1891 TestContext.Progress and TestContext.Error silently drop text that is not properly XML encoded + * 1901 Make nunitlite-runner Prefer32Bit option consistent across Debug/Release + * 1904 Add .NET Standard 1.6 Dependencies to the Nuspec Files + * 1907 Handle early termination of multiple assert block + * 1911 Changing misleading comment that implies that every `ICollection` is a list + * 1912 Add new warning status and result state + * 1913 Report Warnings in NUnitLite + * 1914 Extra AssertionResult entries in TestResults + * 1915 Enable Path, File and Directory Assert/Constraints in the .NET Standard Build + * 1917 Use of IsolatedContext breaks tests in user-created AppDomain + * 1924 Run tests using the NUnit Console Runner + * 1929 Rename zip and remove source zip + * 1933 Tests should pass if test case source provides 0 test cases + * 1941 Use dictionary-based property for test run parameters + * 1945 Use high-quality icon for nuspecs + * 1947 Add NonTestAssemblyAttribute + * 1954 Change Error Message for Assert.Equals + * 1960 Typo fixes + * 1966 Xamarin Runner cannot reference NUnit NuGet Package + +### NUnit 3.5 - October 3, 2016 + +This is the first version of NUnit where the framework will be released separately from the +console runner, engine and other extensions. From this point forward, the NUnit Framework will be +released on its own schedule that is not bound to that of any other NUnit project and version numbers +may diverge over time. + +This is also the first release where the NUnit Framework will not be included in the installer. Only +the console runner, engine and extensions will be available as an MSI installer. We recommend that you +use the NUnit NuGet packages for the framework, but a ZIP file with the binaries will also be available. + +#### Framework + + * Added Assert.Zero and Assert.NotZero methods + * You can now pass a `Func` to Asserts to lazily evaluate exception messages + * Added the ability to Assert on the order of multiple properties in a collection + * Tests with a Timeout will no longer timeout while you are debugging + +#### Issues Resolved + + * 144 Pass a `Func` to lazily evaluate an exception message + * 995 Enable Warning as Error + * 1106 Move various Assembly Info files under Properties for CF + * 1334 Add Assert.Zero and Assert.NotZero + * 1479 Don't enforce [Timeout] when debugger is attached + * 1540 Remove old .NET Core Projects + * 1553 Allow ordering tests to be done in multiple properties + * 1575 Escaping control chars in custom message + * 1596 Eliminate code sharing across projects to be split + * 1598 Split framework and console/engine into separate projects + * 1610 Refactor dependencies in build.cake + * 1615 Appveyor error in TestCF + * 1621 Remove console and command-line option files from common + * 1640 When submitting only part of optional parameters, all are overriden by defaults + * 1641 Create OSX CI Build on Travis + * 1663 Find way to hide NUnit.Compatability.Path from intellisense + * 1681 NUnitLite under .net core doesn't support TeamCity output + * 1683 Existence of SerializableAttribute in .NET Core + * 1693 2 unit tests fail due to localization + * 1716 Move installer to new repository + * 1717 Change suffix for master builds + * 1723 Remove Cake target TestAll + * 1739 Create separate copies of MockAssembly for framework, engine and extensions + * 1751 Serializable attribute exists in both System.Runtime.Serialization.Formatters and nunit.framework + * 1775 Support NUnit assertions in partial trust code. + * 1800 Remove Console/Engine projects from nunit.linux.sln + * 1805 Error message "arguments provided for method not taking any" seems incomplete / doesn't make much sense + * 1815 Prevent NullReferenceException in SubPathConstraint + +### NUnit 3.4.1 - June 30, 2016 + +#### Console Runner + + * A new option, --list-extensions, will display all the engine extensions that + have been installed by the engine. + +#### Issues Resolved + + * 1623 NUnit 3.4 is not integrated with TeamCity + * 1626 NUnit.ConsoleRunner is not picking up NUnit.Extension.NUnitV2ResultWriter + * 1628 Agent's process stays in memory when it was failed to unload AppDomain + * 1635 Console option to list loaded extensions + +### NUnit 3.4 - June 25, 2016 + +#### Framework + + * Improvements in comparing equality using `IEquatable` + * Test case names will only be truncated if the runner requests it or it is overridden on the command line + with the --test-name-format option + * The .NET 2.0 version of the framework now includes LINQ. If your tests target .NET 2.0, you can now use + LINQ queries in your tests + +#### Engine + + * The TeamCity event listener has been separated out into an engine extension + * Fixed numerous issues around thread safety of parallel test runs + * Additional fixes to reduce memory usage + * Fixes for Mono 4.4 + +#### Console Runner + + * There is a new --params command line option that allows you to pass parameters to your tests + which can be retrieved using TestContext.Parameters + * Another new command line option --loaduserprofile causes the User Profile to be loaded into the + NUnit Agent process. + +#### Issues Resolved + + * 329 (CLI) Runner does not report AppDomain unloading timeout + * 720 Need a way to get test-specific command-line arguments at runtime + * 1010 Need to control engine use of extensions + * 1139 Nunit3 console doesn't show test output continously + * 1225 The --teamcity option should really be an extension + * 1241 Make TestDirectory accessible when TestCaseSource attributes are evaluated + * 1366 Classname for inherited test is not correct + * 1371 Support `dotnet test` in .NET CLI and .NET Core + * 1379 Console returns 0 for invalid fixtures + * 1422 Include TestListWithEmptyLine.tst in ZIP Package + * 1423 SingleThreaded attribute should raise an error if a thread is required + * 1425 Lazy initialization of OutWriter in TestResult is not thread safe + * 1427 Engine extensions load old packages + * 1430 TestObjects are retained for lifetime of test run, causing high memory usage + * 1432 NUnit hangs when reporting to TeamCity + * 1434 TestResult class needs to be thread-safe + * 1435 Parallel queue creation needs to be thread-safe + * 1436 CurrentFramework and Current Platform need to be more thread-safe + * 1439 EqualConstraint does Not use Equals Override on the Expected Object + * 1441 Add Linq for use internally in .NET 2.0 code + * 1446 TestOrderAttributeTests is not public + * 1450 Silverlight detection doesn't work when building on 32-bit OS + * 1457 Set the 2.0 build to ignore missing xml dcoumentation + * 1463 Should TestResult.AssertCount have a public setter? + * 1464 TNode.EscapeInvalidXmlCharacters recreates Regex continually + * 1470 Make EventQueue and associated classes lock-less and thread safe + * 1476 Examine need for "synchronous" events in event queue + * 1481 TestCase with generic return type causes NullReferenceException + * 1483 Remoting exceptions during test execution + * 1484 Comparing Equality using `IEquatable` Should Use Most Specific Method + * 1493 NUnit 2 test results report ParameterizedMethod but should be ParameterizedTest + * 1507 NullReferenceException when null arguments are used in TestFixtureAttribute + * 1513 Add new teamcity extension to packages + * 1518 NUnit does not send the "testStarted" TeamCity service message when exception was thrown from SetUp/OneTimeSetUp + * 1520 Detect Portable, Silverlight and Compact and give error message + * 1528 Use of Sleep(0) in NUnit + * 1543 Blank name attribute in nunit2-formatted XML result file test-run element + * 1547 Create separate assembly for System.Linq compatibility classes + * 1548 Invalid Exception when engine is in a 32-bit process + * 1549 Changing default behavior for generating test case names + * 1551 Path in default .addins file for ConsoleRunner package may not exist + * 1555 EndsWith calls in Constraint constructor can cause major perf issues + * 1560 Engine writes setting file unnecessarily + * 1573 Move Nunit.Portable.Agent to new Repo + * 1579 NUnit v3 dangerously overrides COMPLUS_Version environment variable + * 1582 Mono 4.4.0 Causes Test Failures + * 1593 Nunit Console Runner 3.2.1 and Mono 4.4 throws RemotingException + * 1597 Move Portable agent to its own repository + * 1605 TeamCity package has no pre-release suffix + * 1607 nunit.nuget.addins discovery pattern is wrong then restored through project.json + * 1617 Load user profile on test runners + +### NUnit 3.2.1 - April 19, 2016 + +#### Framework + + * The output and error files are now thread safe when running tests in parallel + * Added a .NET 3.5 build of the framework preventing conflicts with the compatiblity classes in the 2.0 framework + * Added a SingleThreadedAttribute to be added to a TestFixture to indicate all child tests should run on the same thread + +#### Engine + + * Unless required, run all tests within a fixture on the same thread + * Added an EventListener extension point + * Reduced memory usage + +#### Console Runner + + * No longer probes for newer versions of the engine, instead uses the engine that is included with the console + +#### Issues Resolved + + * 332 Add CF to the Appveyor CI build + * 640 Keep CF Build (and other future builds) in Sync + * 773 Upgrade Travis CI from Legacy Infrastructure + * 1141 Explicit Tests get run when using --where with some filters + * 1161 NUnit3-Console should disallow the combination of --inprocess and --x86, giving an error message + * 1208 Apartment on assembly level broken + * 1231 Build may silently fail some tests + * 1247 Potential memory issue + * 1266 SetCultureAttribute does not work if set on assembly level + * 1302 Create EventListener ExtensionPoint for the Engine + * 1317 Getting CF framework unit tests running on CI build + * 1318 NUnit console runner fails with error code -100 + * 1327 TestCaseSource in NUnit 3 converts an argument declared as String[] to String + * 1329 Unable to build without Compact Framework + * 1333 Single Thread per Worker + * 1338 BUILDING.txt is outdated + * 1349 Collision on System.Func from nunit.framework with System.Core in .Net 3.5 (CS0433) + * 1352 Tests losing data setup on thread + * 1359 Compilation error in NUnitPortableDriverTests.cs + * 1383 Skip Silverlight build if SDK not installed + * 1386 Bug when using Assert.Equals() with types that explicitly implement `IEquatable` + * 1390 --testlist with file with blank first line causes IndexOutOfRangeException + * 1399 Fixed NullReference issue introduced by the fix for #681 + * 1405 ITestRunner.StopRun throws exception of type 'System.MissingMethodException' + * 1406 TextCapture is not threadsafe but is used to intercept calls that are expected to be threadsafe + * 1410 Make OutFile and ErrFile streamwriters synchronized + * 1413 Switch console to use a local engine + +### NUnit 3.2 - March 5, 2016 + +#### Framework + + * Added an Order attribute that defines the order in which tests are run + * Added Assert.ThrowsAsync for testing if async methods throw an exception + * You can now compare unlike collections using Is.EquivalentTo().Using(...) + * Added the ability to add custom message formatters to MsgUtils + * TestCaseSourceAttribute now optionally takes an array of parameters that can be passed to the source method + * Added Is.Zero and Is.Not.Zero to the fluent syntax as a shorter option for Is.EqualTo(0) and Is.Not.EqualTo(0) + +#### Engine + + * Engine extensions can be installed via NuGet packages + +#### Issues Resolved + + * 170 Test Order Attribute + * 300 Create an NUnit Visual Studio Template + * 464 Async delegate assertions + * 532 Batch runner for Silverlight tests + * 533 Separate NUnitLite runner and autorunner + * 681 NUnit agent cannot resolve test dependency assemblies when mixed mode initialization runs in the default AppDomain + * 793 Replace CoreEngine by use of Extensions + * 907 Console report tests are too fragile + * 922 Wrap Console in NUnitLite + * 930 Switch from MSBuild based build system to Cake + * 981 Define NUnit Versioning for post-3.0 Development + * 1004 Poor formatting of results for Assert.AreEqual(DateTimeOffset, DateTimeOffset) + * 1018 ArgumentException when 2.x version of NUnit Framework is in the bin directory + * 1022 Support Comparing Unlike Collections using Is.EquivalentTo().Using(...) + * 1044 Re-order Test Summary Errors/Failures + * 1066 ApartmentAttribute and TestCaseAttribute(s) do not work together + * 1103 Can't use TestCaseData from base class + * 1109 NullReferenceException when using inherited property for ValueSource + * 1113 Console runner and xml output consistency + * 1117 Fix misbehaviour of Throws.Exception with non-void returning functions + * 1120 NUnitProject should parse .nunit project files containing Xml Declarations + * 1121 Usage of field set to null as value source leads to somewhat cryptic error + * 1122 Region may be disposed before test delegate is executed + * 1133 Provide a way to install extensions as nuget packages + * 1136 Don't allow V2 framework to update in V2 driver tests + * 1171 A bug when using Assert.That() with Is.Not.Empty + * 1185 Engine finds .NET 4.0 Client Profile twice + * 1187 ITestAssemblyRunner.StopRun as implemented by NUnitTestAssemblyRunner + * 1195 name attribute in test-suite and test-results element of output xml is different to nunit 2.6.4 using nunit2-format + * 1196 Custom value formatter for v3 via MsgUtils + * 1210 Available runtimes issues + * 1230 Add ability for testcasedatasource to have parameters passed to methods + * 1233 Add TestAssemblyRunner tests to both portable and silverlight builds + * 1234 Have default NUnitLite Runner Program.cs return exit code + * 1236 Make Appveyor NuGet feed more useable + * 1246 Introduce Is.Zero syntax to test for zero + * 1252 Exception thrown when any assembly is not found + * 1261 TypeHelper.GetDisplayName generates the wrong name for generic types with nested classes + * 1278 Fix optional parameters in TestCaseAttribute + * 1282 TestCase using Params Behaves Oddly + * 1283 Engine should expose available frameworks. + * 1286 value of the time attribute in nunit2 outputs depends on the machine culture + * 1297 NUnit.Engine nuget package improvements + * 1301 Assert.AreNotSame evaluates ToString unnecessarily + +### NUnit 3.0.1 - December 1, 2015 + +#### Console Runner + + * The Nunit.Runners NuGet package was updated to become a meta-package that pulls in the NUnit.Console package + * Reinstated the --pause command line option that will display a message box allowing you to attach a debugger if the --debug option does not work + +#### Issues Resolved + + * 994 Add max number of Agents to the NUnit project file + * 1014 Ensure NUnit API assembly updates with MSI installs + * 1024 Added --pause flag to console runner + * 1030 Update Nunit.Runners package to 3.0 + * 1033 "No arguments were provided" with Theory and Values combination + * 1035 Check null arguments + * 1037 Async tests not working on Windows 10 Universal + * 1041 NUnit2XmlResult Writer is reporting Sucess when test fails + * 1042 NUnit2 reports on 3.0 is different than 2.6.4 + * 1046 FloatingPointNumerics.AreAlmostEqualUlps throws OverflowException + * 1049 Cannot select Generic tests from command line + * 1050 Do not expose System.Runtime.CompilerServices.ExtensionAttribute to public + * 1054 Create nuget feeds for CI builds on Appveyor + * 1055 nunit3 console runner --where option does not return error on invalid selection string + * 1060 Remove "Version 3" from NUnit Nuget Package + * 1061 Nunit30Settings.xml becomes corrupted + * 1062 Console.WriteLine statements in "OneTimeSetUp" and "OneTimeTearDown" annotated methods are not directed to the console when using nunit3-console.exe runner + * 1063 Error in Random Test + +### NUnit 3.0.0 Final Release - November 15, 2015 + +#### Issues Resolved + + * 635 Mono 4.0 Support + +### NUnit 3.0.0 Release Candidate 3 - November 13, 2015 + +#### Engine + + * The engine now only sets the config file for project.nunit to project.config if project.config exists. Otherwise, each assembly uses its own config, provided it is run in a separate AppDomain by itself. + + NOTE: It is not possible for multiple assemblies in the same AppDomain to use different configs. This is not an NUnit limitation, it's just how configs work! + +#### Issues Resolved + + * 856 Extensions support for third party runners in NUnit 3.0 + * 1003 Delete TeamCityEventHandler as it is not used + * 1015 Specifying .nunit project and --framework on command line causes crash + * 1017 Remove Assert.Multiple from framework + +### NUnit 3.0.0 Release Candidate 2 - November 8, 2015 + +#### Engine + + * The IDriverFactory extensibility interface has been modified. + +#### Issues Resolved + + * 970 Define PARALLEL in CF build of nunitlite + * 978 It should be possible to determine version of NUnit using nunit console tool + * 983 Inconsistent return codes depending on ProcessModel + * 986 Update docs for parallel execution + * 988 Don't run portable tests from NUnit Console + * 990 V2 driver is passing invalid filter elements to NUnit + * 991 Mono.Options should not be exposed to public directly + * 993 Give error message when a regex filter is used with NUnit V2 + * 997 Add missing XML Documentation + * 1008 NUnitLite namespace not updated in the NuGet Packages + +### NUnit 3.0.0 Release Candidate - November 1, 2015 + +#### Framework + + * The portable build now supports ASP.NET 5 and the new Core CLR. + + NOTE: The `nunit3-console` runner cannot run tests that reference the portable build. + You may run such tests using NUnitLite or a platform-specific runner. + + * `TestCaseAttribute` and `TestCaseData` now allow modifying the test name without replacing it entirely. + * The Silverlight packages are now separate downloads. + +#### NUnitLite + + * The NUnitLite runner now produces the same output display and XML results as the console runner. + +#### Engine + + * The format of the XML result file has been finalized and documented. + +#### Console Runner + + * The console runner program is now called `nunit3-console`. + * Console runner output has been modified so that the summary comes at the end, to reduce the need for scrolling. + +#### Issues Resolved + + * 59 Length of generated test names should be limited + * 68 Customization of test case name generation + * 404 Split tests between nunitlite.runner and nunit.framework + * 575 Add support for ASP.NET 5 and the new Core CLR + * 783 Package separately for Silverlight + * 833 Intermittent failure of WorkItemQueueTests.StopQueue_WithWorkers + * 859 NUnit-Console output - move Test Run Summary to end + * 867 Remove Warnings from Ignored tests + * 868 Review skipped tests + * 887 Move environment and settings elements to the assembly suite in the result file + * 899 Colors for ColorConsole on grey background are too light + * 904 InternalPreserveStackTrace is not supported on all Portable platforms + * 914 Unclear error message from console runner when assembly has no tests + * 916 Console runner dies when test agent dies + * 918 Console runner --where parameter is case sensitive + * 920 Remove addins\nunit.engine.api.dll from NuGet package + * 929 Rename nunit-console.exe + * 931 Remove beta warnings from NuGet packages + * 936 Explicit skipped tests not displayed + * 939 Installer complains about .NET even if already installed + * 940 Confirm or modify list of packages for release + * 947 Breaking API change in ValueSourceAttribute + * 949 Update copyright in NUnit Console + * 954 NUnitLite XML output is not consistent with the engine's + * 955 NUnitLite does not display the where clause + * 959 Restore filter options for NUnitLite portable build + * 960 Intermittent failure of CategoryFilterTests + * 967 Run Settings Report is not being displayed. + +### NUnit 3.0.0 Beta 5 - October 16, 2015 + +#### Framework + + * Parameterized test cases now support nullable arguments. + * The NUnit framework may now be built for the .NET Core framework. Note that this is only available through building the source code. A binary will be available in the next release. + +#### Engine + + * The engine now runs multiple test assemblies in parallel by default + * The output XML now includes more information about the test run, including the text of the command used, any engine settings and the filter used to select tests. + * Extensions may now specify data in an identifying attribute, for use by the engine in deciding whether to load that extension. + + +#### Console Runner + + * The console now displays all settings used by the engine to run tests as well as the filter used to select tests. + * The console runner accepts a new option --maxagents. If multiple assemblies are run in separate processes, this value may be used to limit the number that are executed simultaneously in parallel. + * The console runner no longer accepts the --include and --exclude options. Instead, the new --where option provides a more general way to express which tests will be executed, such as --where "cat==Fast && Priority==High". See the docs for details of the syntax. + * The new --debug option causes NUnit to break in the debugger immediately before tests are run. This simplifies debugging, especially when the test is run in a separate process. + +##### Issues Resolved + + * 41 Check for zeroes in Assert messages + * 254 Finalize XML format for test results + * 275 NUnitEqualityComparer fails to compare `IEquatable` where second object is derived from T + * 304 Run test Assemblies in parallel + * 374 New syntax for selecting tests to be run + * 515 OSPlatform.IsMacOSX doesn't work + * 573 nunit-console hangs on Mac OS X after all tests have run + * 669 TeamCity service message should have assembly name as a part of test name. + * 689 The TeamCity service message "testFinished" should have an integer value in the "duration" attribute + * 713 Include command information in XML + * 719 We have no way to configure tests for several assemblies using NUnit project file and the common installation from msi file + * 735 Workers number in xml report file cannot be found + * 784 Build Portable Framework on Linux + * 790 Allow Extensions to provide data through an attribute + * 794 Make it easier to debug tests as well as NUnit itself + * 801 NUnit calls Dispose multiple times + * 814 Support nullable types with TestCase + * 818 Possible error in Merge Pull Request #797 + * 821 Wrapped method results in loss of result information + * 822 Test for Debugger in NUnitTestAssemblyRunner probably should not be in CF build + * 824 Remove unused System.Reflection using statements + * 826 Randomizer uniqueness tests fail randomly! + * 828 Merge pull request #827 (issue 826) + * 830 Add ability to report test results synchronously to test runners + * 837 Enumerators not disposed when comparing IEnumerables + * 840 Add missing copyright notices + * 844 Pull Request #835 (Issue #814) does not build in CF + * 847 Add new --process:inprocess and --inprocess options + * 850 Test runner fails if test name contains invalid xml characters + * 851 'Exclude' console option is not working in NUnit Lite + * 853 Cannot run NUnit Console from another directory + * 860 Use CDATA section for message, stack-trace and output elements of XML + * 863 Eliminate core engine + * 865 Intermittent failures of StopWatchTests + * 869 Tests that use directory separator char to determine platform misreport Linux on MaxOSX + * 870 NUnit Console Runtime Environment misreports on MacOSX + * 874 Add .NET Core Framework + * 878 Cannot exclude MacOSX or XBox platforms when running on CF + * 892 Fixed test runner returning early when executing more than one test run. + * 894 Give nunit.engine and nunit.engine.api assemblies strong names + * 896 NUnit 3.0 console runner not placing test result xml in --work directory + +### NUnit 3.0.0 Beta 4 - August 25, 2015 + +#### Framework + + * A new RetryAttribute allows retrying of failing tests. + * New SupersetConstraint and Is.SupersetOf syntax complement SubsetConstraint. + * Tests skipped due to ExplicitAttribute are now reported as skipped. + +#### Engine + + * We now use Cecil to examine assemblies prior to loading them. + * Extensions are no longer based on Mono.Addins but use our own extension framework. + +#### Issues Resolved + + * 125 3rd-party dependencies should be downloaded on demand + * 283 What should we do when a user extension does something bad? + * 585 RetryAttribute + * 642 Restructure MSBuild script + * 649 Change how we zip packages + * 654 ReflectionOnlyLoad and ReflectionOnlyLoadFrom + * 664 Invalid "id" attribute in the report for case "test started" + * 685 In the some cases when tests cannot be started NUnit returns exit code "0" + * 728 Missing Assert.That overload + * 741 Explicit Tests get run when using --exclude + * 746 Framework should send events for all tests + * 747 NUnit should apply attributes even if test is non-runnable + * 749 Review Use of Mono.Addins for Engine Extensibility + * 750 Include Explicit Tests in Test Results + * 753 Feature request: Is.SupersetOf() assertion constraint + * 755 TimeOut attribute doesn't work with TestCaseSource Attribute + * 757 Implement some way to wait for execution to complete in ITestEngineRunner + * 760 Packaging targets do not run on Linux + * 766 Added overloads for True()/False() accepting booleans + * 778 Build and build.cmd scripts invoke nuget.exe improperly + * 780 Teamcity fix + * 782 No sources for 2.6.4 + +### NUnit 3.0.0 Beta 3 - July 15, 2015 + +#### Framework + + * The RangeAttribute has been extended to support more data types including + uint, long and ulong + * Added platform support for Windows 10 and fixed issues with Windows 8 and + 8.1 support + * Added async support to the portable version of NUnit Framework + * The named members of the TestCaseSource and ValueSource attributes must now be + static. + * RandomAttribute has been extended to add support for new data types including + uint, long, ulong, short, ushort, float, byte and sbyte + * TestContext.Random has also been extended to add support for new data types including + uint, long, ulong, short, ushort, float, byte, sbyte and decimal + * Removed the dependency on Microsoft.Bcl.Async from the NUnit Framework assembly + targeting .NET 4.0. If you want to write async tests in .NET 4.0, you will need + to reference the NuGet package yourself. + * Added a new TestFixtureSource attribute which is the equivalent to TestCaseSource + but provides for instantiation of fixtures. + * Significant improvements have been made in how NUnit deduces the type arguments of + generic methods based on the arguments provided. + +#### Engine + + * If the target framework is not specified, test assemblies that are compiled + to target .NET 4.5 will no longer run in .NET 4.0 compatibility mode + +#### Console + + * If the console is run without arguments, it will now display help + +#### Issues Resolved + + * 47 Extensions to RangeAttribute + * 237 System.Uri .ctor works not properly under Nunit + * 244 NUnit should properly distinguish between .NET 4.0 and 4.5 + * 310 Target framework not specified on the AppDomain when running against .Net 4.5 + * 321 Rationalize how we count tests + * 472 Overflow exception and DivideByZero exception from the RangeAttribute + * 524 int and char do not compare correctly? + * 539 Truncation of string arguments + * 544 AsyncTestMethodTests for 4.5 Framework fails frequently on Travis CI + * 656 Unused parameter in Console.WriteLine found + * 670 Failing Tests in TeamCity Build + * 673 Ensure proper disposal of engine objects + * 674 Engine does not release test assemblies + * 679 Windows 10 Support + * 682 Add Async Support to Portable Framework + * 683 Make FrameworkController available in portable build + * 687 TestAgency does not launch agent process correctly if runtime type is not specified (i.e. v4.0) + * 692 PlatformAttribute_OperatingSystemBitNess fails when running in 32-bit process + * 693 Generic `Test` Method cannot determine type arguments for fixture when passed as `IEnumerable` + * 698 Require TestCaseSource and ValueSource named members to be static + * 703 TeamCity non-equal flowid for 'testStarted' and 'testFinished' messages + * 712 Extensions to RandomAttribute + * 715 Provide a data source attribute at TestFixture Level + * 718 RangeConstraint gives error with from and two args of differing types + * 723 Does nunit.nuspec require dependency on Microsoft.Bcl.Async? + * 724 Adds support for `Nullable` to Assert.IsTrue and Assert.IsFalse + * 734 Console without parameters doesn't show help + +### NUnit 3.0.0 Beta 2 - May 12, 2015 + +####Framework + + * The Compact Framework version of the framework is now packaged separately + and will be distributed as a ZIP file and as a NuGet package. + * The NUnit 2.x RepeatAttribute was added back into the framework. + * Added Throws.ArgumentNullException + * Added GetString methods to NUnit.Framework.Internal.RandomGenerator to + create repeatable random strings for testing + * When checking the equality of DateTimeOffset, you can now use the + WithSameOffset modifier + * Some classes intended for internal usage that were public for testing + have now been made internal. Additional classes will be made internal + for the final 3.0 release. + +#### Engine + + * Added a core engine which is a non-extensible, minimal engine for use by + devices and similar situations where reduced functionality is compensated + for by reduced size and simplicity of usage. See + https://github.com/nunit/dev/wiki/Core-Engine for more information. + +#### Issues Resolved + + * 22 Add OSArchitecture Attribute to Environment node in result xml + * 24 Assert on Dictionary Content + * 48 Explicit seems to conflict with Ignore + * 168 Create NUnit 3.0 documentation + * 196 Compare DateTimeOffsets including the offset in the comparison + * 217 New icon for the 3.0 release + * 316 NUnitLite TextUI Runner + * 320 No Tests found: Using parametrized Fixture and TestCaseSource + * 360 Better exception message when using non-BCL class in property + * 454 Rare registry configurations may cause NUnit to fail + * 478 RepeatAttribute + * 481 Testing multiple assemblies in nunitlite + * 538 Potential bug using TestContext in constructors + * 546 Enable Parallel in NUnitLite/CF (or more) builds + * 551 TextRunner not passing the NumWorkers option to the ITestAssemblyRunner + * 556 Executed tests should always return a non-zero duration + * 559 Fix text of NuGet packages + * 560 Fix PackageVersion property on wix install projects + * 562 Program.cs in NUnitLite NuGet package is incorrect + * 564 NUnitLite Nuget package is Beta 1a, Framework is Beta 1 + * 565 NUnitLite Nuget package adds Program.cs to a VB Project + * 568 Isolate packaging from building + * 570 ThrowsConstraint failure message should include stack trace of actual exception + * 576 Throws.ArgumentNullException would be nice + * 577 Documentation on some members of Throws falsely claims that they return `TargetInvocationException` constraints + * 579 No documentation for recommended usage of TestCaseSourceAttribute + * 580 TeamCity Service Message Uses Incorrect Test Name with NUnit2Driver + * 582 Test Ids Are Not Unique + * 583 TeamCity service messages to support parallel test execution + * 584 Non-runnable assembly has incorrect ResultState + * 609 Add support for integration with TeamCity + * 611 Remove unused --teamcity option from CF build of NUnitLite + * 612 MaxTime doesn't work when used for TestCase + * 621 Core Engine + * 622 nunit-console fails when use --output + * 628 Modify IService interface and simplify ServiceContext + * 631 Separate packaging for the compact framework + * 646 ConfigurationManager.AppSettings Params Return Null under Beta 1 + * 648 Passing 2 or more test assemblies targeting > .NET 2.0 to nunit-console fails + +### NUnit 3.0.0 Beta 1 - March 25, 2015 + +#### General + + * There is now a master windows installer for the framework, engine and console runner. + +#### Framework + + * We no longer create a separate framework build for .NET 3.5. The 2.0 and + 3.5 builds were essentially the same, so the former should now be used + under both runtimes. + * A new Constraint, DictionaryContainsKeyConstraint, may be used to test + that a specified key is present in a dictionary. + * LevelOfParallelizationAttribute has been renamed to LevelOfParallelismAttribute. + * The Silverlight runner now displays output in color and includes any + text output created by the tests. + * The class and method names of each test are included in the output xml + where applicable. + * String arguments used in test case names are now truncated to 40 rather + than 20 characters. + +#### Engine + + * The engine API has now been finalized. It permits specifying a minimum + version of the engine that a runner is able to use. The best installed + version of the engine will be loaded. Third-party runners may override + the selection process by including a copy of the engine in their + installation directory and specifying that it must be used. + * The V2 framework driver now uses the event listener and test listener + passed to it by the runner. This corrects several outstanding issues + caused by events not being received and allows selecting V2 tests to + be run from the command-line, in the same way that V3 tests are selected. + +#### Console + + * The console now defaults to not using shadowcopy. There is a new option --shadowcopy to turn it on if needed. + +#### Issues Resolved + + * 224 Silverlight Support + * 318 TestActionAttribute: Retrieving the TestFixture + * 428 Add ExpectedExceptionAttribute to C# samples + * 440 Automatic selection of Test Engine to use + * 450 Create master install that includes the framework, engine and console installs + * 477 Assert does not work with ArraySegment + * 482 nunit-console has multiple errors related to -framework option + * 483 Adds constraint for asserting that a dictionary contains a particular key + * 484 Missing file in NUnit.Console nuget package + * 485 Can't run v2 tests with nunit-console 3.0 + * 487 NUnitLite can't load assemblies by their file name + * 488 Async setup and teardown still don't work + * 497 Framework installer shold register the portable framework + * 504 Option --workers:0 is ignored + * 508 Travis builds with failure in engine tests show as successful + * 509 Under linux, not all mono profiles are listed as available + * 512 Drop the .NET 3.5 build + * 517 V2 FrameworkDriver does not make use of passed in TestEventListener + * 523 Provide an option to disable shadowcopy in NUnit v3 + * 528 V2 FrameworkDriver does not make use of passed in TestFilter + * 530 Color display for Silverlight runner + * 531 Display text output from tests in Silverlight runner + * 534 Add classname and methodname to test result xml + * 541 Console help doesn't indicate defaults + +### NUnit 3.0.0 Alpha 5 - January 30, 2015 + +#### General + + * A Windows installer is now included in the release packages. + +#### Framework + + * TestCaseAttribute now allows arguments with default values to be omitted. Additionaly, it accepts a Platform property to specify the platforms on which the test case should be run. + * TestFixture and TestCase attributes now enforce the requirement that a reason needs to be provided when ignoring a test. + * SetUp, TearDown, OneTimeSetUp and OneTimeTearDown methods may now be async. + * String arguments over 20 characters in length are truncated when used as part of a test name. + +#### Engine + + * The engine is now extensible using Mono.Addins. In this release, extension points are provided for FrameworkDrivers, ProjectLoaders and OutputWriters. The following addins are bundled as a part of NUnit: + * A FrameworkDriver that allows running NUnit V2 tests under NUnit 3.0. + * ProjectLoaders for NUnit and Visual Studio projects. + * An OutputWriter that creates XML output in NUnit V2 format. + * DomainUsage now defaults to Multiple if not specified by the runner + +#### Console + + * New options supported: + * testlist provides a list of tests to run in a file + * stoponerror indicates that the run should terminate when any test fails. + +#### Issues Resolved + + * 20 TestCaseAttribute needs Platform property. + * 60 NUnit should support async setup, teardown, fixture setup and fixture teardown. + * 257 TestCaseAttribute should not require parameters with default values to be specified. + * 266 Pluggable framework drivers. + * 368 Create addin model. + * 369 Project loader addins + * 370 OutputWriter addins + * 403 Move ConsoleOptions.cs and Options.cs to Common and share... + * 419 Create Windows Installer for NUnit. + * 427 [TestFixture(Ignore=true)] should not be allowed. + * 437 Errors in tests under Linux due to hard-coded paths. + * 441 NUnit-Console should support --testlist option + * 442 Add --stoponerror option back to nunit-console. + * 456 Fix memory leak in RuntimeFramework. + * 459 Remove the Mixed Platforms build configuration. + * 468 Change default domain usage to multiple. + * 469 Truncate string arguments in test names in order to limit the length. + +### NUnit 3.0.0 Alpha 4 - December 30, 2014 + +#### Framework + + * ApartmentAttribute has been added, replacing STAAttribute and MTAAttribute. + * Unnecessary overloads of Assert.That and Assume.That have been removed. + * Multiple SetUpFixtures may be specified in a single namespace. + * Improvements to the Pairwise strategy test case generation algorithm. + * The new NUnitLite runner --testlist option, allows a list of tests to be kept in a file. + +#### Engine + + * A driver is now included, which allows running NUnit 2.x tests under NUnit 3.0. + * The engine can now load and run tests specified in a number of project formats: + * NUnit (.nunit) + * Visual Studio C# projects (.csproj) + * Visual Studio F# projects (.vjsproj) + * Visual Studio Visual Basic projects (.vbproj) + * Visual Studio solutions (.sln) + * Legacy C++ and Visual JScript projects (.csproj and .vjsproj) are also supported + * Support for the current C++ format (.csxproj) is not yet available + * Creation of output files like TestResult.xml in various formats is now a + service of the engine, available to any runner. + +#### Console + + * The command-line may now include any number of assemblies and/or supported projects. + +#### Issues Resolved + + * 37 Multiple SetUpFixtures should be permitted on same namespace + * 210 TestContext.WriteLine in an AppDomain causes an error + * 227 Add support for VS projects and solutions + * 231 Update C# samples to use NUnit 3.0 + * 233 Update F# samples to use NUnit 3.0 + * 234 Update C++ samples to use NUnit 3.0 + * 265 Reorganize console reports for nunit-console and nunitlite + * 299 No full path to assembly in XML file under Compact Framework + * 301 Command-line length + * 363 Make Xml result output an engine service + * 377 CombiningStrategyAttributes don't work correctly on generic methods + * 388 Improvements to NUnitLite runner output + * 390 Specify exactly what happens when a test times out + * 396 ApartmentAttribute + * 397 CF nunitlite runner assembly has the wrong name + * 407 Assert.Pass() with ]]> in message crashes console runner + * 414 Simplify Assert overloads + * 416 NUnit 2.x Framework Driver + * 417 Complete work on NUnit projects + * 420 Create Settings file in proper location + +### NUnit 3.0.0 Alpha 3 - November 29, 2014 + +#### Breaking Changes + + * NUnitLite tests must reference both the nunit.framework and nunitlite assemblies. + +#### Framework + + * The NUnit and NUnitLite frameworks have now been merged. There is no longer any distinction + between them in terms of features, although some features are not available on all platforms. + * The release includes two new framework builds: compact framework 3.5 and portable. The portable + library is compatible with .NET 4.5, Silverlight 5.0, Windows 8, Windows Phone 8.1, + Windows Phone Silverlight 8, Mono for Android and MonoTouch. + * A number of previously unsupported features are available for the Compact Framework: + - Generic methods as tests + - RegexConstraint + - TimeoutAttribute + - FileAssert, DirectoryAssert and file-related constraints + +#### Engine + + * The logic of runtime selection has now changed so that each assembly runs by default + in a separate process using the runtime for which it was built. + * On 64-bit systems, each test process is automatically created as 32-bit or 64-bit, + depending on the platform specified for the test assembly. + +#### Console + + * The console runner now runs tests in a separate process per assembly by default. They may + still be run in process or in a single separate process by use of command-line options. + * The console runner now starts in the highest version of the .NET runtime available, making + it simpler to debug tests by specifying that they should run in-process on the command-line. + * The -x86 command-line option is provided to force execution in a 32-bit process on a 64-bit system. + * A writeability check is performed for each output result file before trying to run the tests. + * The -teamcity option is now supported. + +#### Issues Resolved + + * 12 Compact framework should support generic methods + * 145 NUnit-console fails if test result message contains invalid xml characters + * 155 Create utility classes for platform-specific code + * 223 Common code for NUnitLite console runner and NUnit-Console + * 225 Compact Framework Support + * 238 Improvements to running 32 bit tests on a 64 bit system + * 261 Add portable nunitlite build + * 284 NUnitLite Unification + * 293 CF does not have a CurrentDirectory + * 306 Assure NUnit can write resultfile + * 308 Early disposal of runners + * 309 NUnit-Console should support incremental output under TeamCity + * 325 Add RegexConstraint to compact framework build + * 326 Add TimeoutAttribute to compact framework build + * 327 Allow generic test methods in the compact framework + * 328 Use .NET Stopwatch class for compact framework builds + * 331 Alpha 2 CF does not build + * 333 Add parallel execution to desktop builds of NUnitLite + * 334 Include File-related constraints and syntax in NUnitLite builds + * 335 Re-introduce 'Classic' NUnit syntax in NUnitLite + * 336 Document use of separate obj directories per build in our projects + * 337 Update Standard Defines page for .NET 3.0 + * 341 Move the NUnitLite runners to separate assemblies + * 367 Refactor XML Escaping Tests + * 372 CF Build TestAssemblyRunnerTests + * 373 Minor CF Test Fixes + * 378 Correct documentation for PairwiseAttribute + * 386 Console Output Improvements + +### NUnit 3.0.0 Alpha 2 - November 2, 2014 + +#### Breaking Changes + + * The console runner no longer displays test results in the debugger. + * The NUnitLite compact framework 2.0 build has been removed. + * All addin support has been removed from the framework. Documentation of NUnit 3.0 extensibility features will be published in time for the beta release. In the interim, please ask for support on the nunit-discuss list. + +#### General + + * A separate solution has been created for Linux + * We now have continuous integration builds under both Travis and Appveyor + * The compact framework 3.5 build is now working and will be supported in future releases. + +#### New Features + + * The console runner now automatically detects 32- versus 64-bit test assemblies. + * The NUnitLite report output has been standardized to match that of nunit-console. + * The NUnitLite command-line has been standardized to match that of nunit-console where they share the same options. + * Both nunit-console and NUnitLite now display output in color. + * ActionAttributes now allow specification of multiple targets on the attribute as designed. This didn't work in the first alpha. + * OneTimeSetUp and OneTimeTearDown failures are now shown on the test report. Individual test failures after OneTimeSetUp failure are no longer shown. + * The console runner refuses to run tests build with older versions of NUnit. A plugin will be available to run older tests in the future. + +#### Issues Resolved + + * 222 Color console for NUnitLite + * 229 Timing failures in tests + * 241 Remove reference to Microslft BCL packages + * 243 Create solution for Linux + * 245 Multiple targets on action attributes not implemented + * 246 C++ tests do not compile in VS2013 + * 247 Eliminate trace display when running tests in debug + * 255 Add new result states for more precision in where failures occur + * 256 ContainsConstraint break when used with AndConstraint + * 264 Stacktrace displays too many entries + * 269 Add manifest to nunit-console and nunit-agent + * 270 OneTimeSetUp failure results in too much output + * 271 Invalid tests should be treated as errors + * 274 Command line options should be case insensitive + * 276 NUnit-console should not reference nunit.framework + * 278 New result states (ChildFailure and SetupFailure) break NUnit2XmlOutputWriter + * 282 Get tests for NUnit2XmlOutputWriter working + * 288 Set up Appveyor CI build + * 290 Stack trace still displays too many items + * 315 NUnit 3.0 alpha: Cannot run in console on my assembly + * 319 CI builds are not treating test failures as failures of the build + * 322 Remove Stopwatch tests where they test the real .NET Stopwatch + +### NUnit 3.0.0 Alpha 1 - September 22, 2014 + +#### Breaking Changes + + * Legacy suites are no longer supported + * Assert.NullOrEmpty is no longer supported (Use Is.Null.Or.Empty) + +#### General + + * MsBuild is now used for the build rather than NAnt + * The framework test harness has been removed now that nunit-console is at a point where it can run the tests. + +#### New Features + + * Action Attributes have been added with the same features as in NUnit 2.6.3. + * TestContext now has a method that allows writing to the XML output. + * TestContext.CurrentContext.Result now provides the error message and stack trace during teardown. + * Does prefix operator supplies several added constraints. + +#### Issues Resolved + + * 6 Log4net not working with NUnit + * 13 Standardize commandline options for nunitlite runner + * 17 No allowance is currently made for nullable arguents in TestCase parameter conversions + * 33 TestCaseSource cannot refer to a parameterized test fixture + * 54 Store message and stack trace in TestContext for use in TearDown + * 111 Implement Changes to File, Directory and Path Assertions + * 112 Implement Action Attributes + * 156 Accessing multiple AppDomains within unit tests result in SerializationException + * 163 Add --trace option to NUnitLite + * 167 Create interim documentation for the alpha release + * 169 Design and implement distribution of NUnit packages + * 171 Assert.That should work with any lambda returning bool + * 175 Test Harness should return an error if any tests fail + * 180 Errors in Linux CI build + * 181 Replace NAnt with MsBuild / XBuild + * 183 Standardize commandline options for test harness + * 188 No output from NUnitLite when selected test is not found + * 189 Add string operators to Does prefix + * 193 TestWorkerTests.BusyExecutedIdleEventsCalledInSequence fails occasionally + * 197 Deprecate or remove Assert.NullOrEmpty + * 202 Eliminate legacy suites + * 203 Combine framework, engine and console runner in a single solution and repository + * 209 Make Ignore attribute's reason mandatory + * 215 Running 32-bit tests on a 64-bit OS + * 219 Teardown failures are not reported + +#### Console Issues Resolved (Old nunit-console project, now combined with nunit) + + * 2 Failure in TestFixtureSetUp is not reported correctly + * 5 CI Server for nunit-console + * 6 System.NullReferenceException on start nunit-console-x86 + * 21 NUnitFrameworkDriverTests fail if not run from same directory + * 24 'Debug' value for /trace option is deprecated in 2.6.3 + * 38 Confusing Excluded categories output + +### NUnit 2.9.7 - August 8, 2014 + +#### Breaking Changes + + * NUnit no longer supports void async test methods. You should use a Task return Type instead. + * The ExpectedExceptionAttribute is no longer supported. Use Assert.Throws() or Assert.That(..., Throws) instead for a more precise specification of where the exception is expected to be thrown. + +#### New Features + + * Parallel test execution is supported down to the Fixture level. Use ParallelizableAttribute to indicate types that may be run in parallel. + * Async tests are supported for .NET 4.0 if the user has installed support for them. + * A new FileExistsConstraint has been added along with FileAssert.Exists and FileAssert.DoesNotExist + * ExpectedResult is now supported on simple (non-TestCase) tests. + * The Ignore attribute now takes a named parameter Until, which allows specifying a date after which the test is no longer ignored. + * The following new values are now recognized by PlatformAttribute: Win7, Win8, Win8.1, Win2012Server, Win2012ServerR2, NT6.1, NT6.2, 32-bit, 64-bit + * TimeoutAttribute is now supported under Silverlight + * ValuesAttribute may be used without any values on an enum or boolean argument. All possible values are used. + * You may now specify a tolerance using Within when testing equality of DateTimeOffset values. + * The XML output now includes a start and end time for each test. + +#### Issues Resolved + + * 8 [SetUpFixture] is not working as expected + * 14 CI Server for NUnit Framework + * 21 Is.InRange Constraint Ambiguity + * 27 Values attribute support for enum types + * 29 Specifying a tolerance with "Within" doesn't work for DateTimeOffset data types + * 31 Report start and end time of test execution + * 36 Make RequiresThread, RequiresSTA, RequiresMTA inheritable + * 45 Need of Enddate together with Ignore + * 55 Incorrect XML comments for CollectionAssert.IsSubsetOf + * 62 Matches(Constraint) does not work as expected + * 63 Async support should handle Task return type without state machine + * 64 AsyncStateMachineAttribute should only be checked by name + * 65 Update NUnit Wiki to show the new location of samples + * 66 Parallel Test Execution within test assemblies + * 67 Allow Expected Result on simple tests + * 70 EquivalentTo isn't compatible with IgnoreCase for dictioneries + * 75 Async tests should be supported for projects that target .NET 4.0 + * 82 nunit-framework tests are timing out on Linux + * 83 Path-related tests fail on Linux + * 85 Culture-dependent NUnit tests fail on non-English machine + * 88 TestCaseSourceAttribute documentation + * 90 EquivalentTo isn't compatible with IgnoreCase for char + * 100 Changes to Tolerance definitions + * 110 Add new platforms to PlatformAttribute + * 113 Remove ExpectedException + * 118 Workarounds for missing InternalPreserveStackTrace in mono + * 121 Test harness does not honor the --worker option when set to zero + * 129 Standardize Timeout in the Silverlight build + * 130 Add FileAssert.Exists and FileAssert.DoesNotExist + * 132 Drop support for void async methods + * 153 Surprising behavior of DelayedConstraint pollingInterval + * 161 Update API to support stopping an ongoing test run + +NOTE: Bug Fixes below this point refer to the number of the bug in Launchpad. + +### NUnit 2.9.6 - October 4, 2013 + +#### Main Features + + * Separate projects for nunit-console and nunit.engine + * New builds for .NET 4.5 and Silverlight + * TestContext is now supported + * External API is now stable; internal interfaces are separate from API + * Tests may be run in parallel on separate threads + * Solutions and projects now use VS2012 (except for Compact framework) + +#### Bug Fixes + + * 463470 We should encapsulate references to pre-2.0 collections + * 498690 Assert.That() doesn't like properties with scoped setters + * 501784 Theory tests do not work correctly when using null parameters + * 531873 Feature: Extraction of unit tests from NUnit test assembly and calling appropriate one + * 611325 Allow Teardown to detect if last test failed + * 611938 Generic Test Instances disappear + * 655882 Make CategoryAttribute inherited + * 664081 Add Server2008 R2 and Windows 7 to PlatformAttribute + * 671432 Upgrade NAnt to Latest Release + * 676560 Assert.AreEqual does not support `IEquatable` + * 691129 Add Category parameter to TestFixture + * 697069 Feature request: dynamic location for TestResult.xml + * 708173 NUnit's logic for comparing arrays - use `Comparer` if it is provided + * 709062 "System.ArgumentException : Cannot compare" when the element is a list + * 712156 Tests cannot use AppDomain.SetPrincipalPolicy + * 719184 Platformdependency in src/ClientUtilities/util/Services/DomainManager.cs:40 + * 719187 Using Path.GetTempPath() causes conflicts in shared temporary folders + * 735851 Add detection of 3.0, 3.5 and 4.0 frameworks to PlatformAttribute + * 736062 Deadlock when EventListener performs a Trace call + EventPump synchronisation + * 756843 Failing assertion does not show non-linear tolerance mode + * 766749 net-2.0\nunit-console-x86.exe.config should have a `` element and also enable loadFromRemoteSources + * 770471 Assert.IsEmpty does not support IEnumerable + * 785460 Add Category parameter to TestCaseSourceAttribute + * 787106 EqualConstraint provides inadequate failure information for IEnumerables + * 792466 TestContext MethodName + * 794115 HashSet incorrectly reported + * 800089 Assert.Throws() hides details of inner AssertionException + * 848713 Feature request: Add switch for console to break on any test case error + * 878376 Add 'Exactly(n)' to the NUnit constraint syntax + * 882137 When no tests are run, higher level suites display as Inconclusive + * 882517 NUnit 2.5.10 doesn't recognize TestFixture if there are only TestCaseSource inside + * 885173 Tests are still executed after cancellation by user + * 885277 Exception when project calls for a runtime using only 2 digits + * 885604 Feature request: Explicit named parameter to TestCaseAttribute + * 890129 DelayedConstraint doesn't appear to poll properties of objects + * 892844 Not using Mono 4.0 profile under Windows + * 893919 DelayedConstraint fails polling properties on references which are initially null + * 896973 Console output lines are run together under Linux + * 897289 Is.Empty constraint has unclear failure message + * 898192 Feature Request: Is.Negative, Is.Positive + * 898256 `IEnumerable` for Datapoints doesn't work + * 899178 Wrong failure message for parameterized tests that expect exceptions + * 904841 After exiting for timeout the teardown method is not executed + * 908829 TestCase attribute does not play well with variadic test functions + * 910218 NUnit should add a trailing separator to the ApplicationBase + * 920472 CollectionAssert.IsNotEmpty must dispose Enumerator + * 922455 Add Support for Windows 8 and Windows 2012 Server to PlatformAttribute + * 928246 Use assembly.Location instead of assembly.CodeBase + * 958766 For development work under TeamCity, we need to support nunit2 formatted output under direct-runner + * 1000181 Parameterized TestFixture with System.Type as constructor arguments fails + * 1000213 Inconclusive message Not in report output + * 1023084 Add Enum support to RandomAttribute + * 1028188 Add Support for Silverlight + * 1029785 Test loaded from remote folder failed to run with exception System.IODirectory + * 1037144 Add MonoTouch support to PlatformAttribute + * 1041365 Add MaxOsX and Xbox support to platform attribute + * 1057981 C#5 async tests are not supported + * 1060631 Add .NET 4.5 build + * 1064014 Simple async tests should not return `Task` + * 1071164 Support async methods in usage scenarios of Throws constraints + * 1071343 Runner.Load fails on CF if the test assembly contains a generic method + * 1071861 Error in Path Constraints + * 1072379 Report test execution time at a higher resolution + * 1074568 Assert/Assume should support an async method for the ActualValueDelegate + * 1082330 Better Exception if SetCulture attribute is applied multiple times + * 1111834 Expose Random Object as part of the test context + * 1111838 Include Random Seed in Test Report + * 1172979 Add Category Support to nunitlite Runner + * 1203361 Randomizer uniqueness tests sometimes fail + * 1221712 When non-existing test method is specified in -test, result is still "Tests run: 1, Passed: 1" + * 1223294 System.NullReferenceException thrown when ExpectedExceptionAttribute is used in a static class + * 1225542 Standardize commandline options for test harness + +#### Bug Fixes in 2.9.6 But Not Listed Here in the Release + + * 541699 Silverlight Support + * 1222148 /framework switch does not recognize net-4.5 + * 1228979 Theories with all test cases inconclusive are not reported as failures + + +### NUnit 2.9.5 - July 30, 2010 + +#### Bug Fixes + + * 483836 Allow non-public test fixtures consistently + * 487878 Tests in generic class without proper TestFixture attribute should be invalid + * 498656 TestCase should show array values in GUI + * 513989 Is.Empty should work for directories + * 519912 Thread.CurrentPrincipal Set In TestFixtureSetUp Not Maintained Between Tests + * 532488 constraints from ConstraintExpression/ConstraintBuilder are not reusable + * 590717 categorie contains dash or trail spaces is not selectable + * 590970 static TestFixtureSetUp/TestFixtureTearDown methods in base classes are not run + * 595683 NUnit console runner fails to load assemblies + * 600627 Assertion message formatted poorly by PropertyConstraint + * 601108 Duplicate test using abstract test fixtures + * 601645 Parametered test should try to convert data type from source to parameter + * 605432 ToString not working properly for some properties + * 606548 Deprecate Directory Assert in 2.5 and remove it in 3.0 + * 608875 NUnit Equality Comparer incorrectly defines equality for Dictionary objects + +### NUnit 2.9.4 - May 4, 2010 + +#### Bug Fixes + + * 419411 Fixture With No Tests Shows as Non-Runnable + * 459219 Changes to thread princpal cause failures under .NET 4.0 + * 459224 Culture test failure under .NET 4.0 + * 462019 Line endings needs to be better controlled in source + * 462418 Assume.That() fails if I specify a message + * 483845 TestCase expected return value cannot be null + * 488002 Should not report tests in abstract class as invalid + * 490679 Category in TestCaseData clashes with Category on ParameterizedMethodSuite + * 501352 VS2010 projects have not been updated for new directory structure + * 504018 Automatic Values For Theory Test Parameters Not Provided For bool And enum + * 505899 'Description' parameter in both TestAttribute and TestCaseAttribute is not allowed + * 523335 TestFixtureTearDown in static class not executed + * 556971 Datapoint(s)Attribute should work on `IEnumerable` as well as on Arrays + * 561436 SetCulture broken with 2.5.4 + * 563532 DatapointsAttribute should be allowed on properties and methods + +###NUnit 2.9.3 - October 26, 2009 + +#### Main Features + + * Created new API for controlling framework + * New builds for .Net 3.5 and 4.0, compact framework 3.5 + * Support for old style tests has been removed + * New adhoc runner for testing the framework + +#### Bug Fixes + + * 432805 Some Framework Tests don't run on Linux + * 440109 Full Framework does not support "Contains" + +###NUnit 2.9.2 - September 19, 2009 + +####Main Features + + * NUnitLite code is now merged with NUnit + * Added NUnitLite runner to the framework code + * Added Compact framework builds + +####Bug Fixes + + * 430100 `Assert.Catch` should return T + * 432566 NUnitLite shows empty string as argument + * 432573 Mono test should be at runtime + +###NUnit 2.9.1 - August 27, 2009 + +####General + + * Created a separate project for the framework and framework tests + * Changed license to MIT / X11 + * Created Windows installer for the framework + +####Bug Fixes + + * 400502 NUnitEqualityComparer.StreamsE­qual fails for same stream + * 400508 TestCaseSource attirbute is not working when Type is given + * 400510 TestCaseData variable length ctor drops values + * 417557 Add SetUICultureAttribute from NUnit 2.5.2 + * 417559 Add Ignore to TestFixture, TestCase and TestCaseData + * 417560 Merge Assert.Throws and Assert.Catch changes from NUnit 2.5.2 + * 417564 TimeoutAttribute on Assembly diff --git a/packages/NUnit.3.11.0/LICENSE.txt b/packages/NUnit.3.11.0/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..d1fc75345e381b8b3b64096e26e8fabe4e19e0c9 --- /dev/null +++ b/packages/NUnit.3.11.0/LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2018 Charlie Poole, Rob Prouse + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/packages/NUnit.3.11.0/NOTICES.txt b/packages/NUnit.3.11.0/NOTICES.txt new file mode 100644 index 0000000000000000000000000000000000000000..02f3f84d68d15ef74f6efda8419fd99570531e58 --- /dev/null +++ b/packages/NUnit.3.11.0/NOTICES.txt @@ -0,0 +1,5 @@ +NUnit 3.0 is based on earlier versions of NUnit, with Portions + +Copyright (c) 2002-2014 Charlie Poole or +Copyright (c) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or +Copyright (c) 2000-2002 Philip A. Craig diff --git a/packages/NUnit.3.11.0/NUnit.3.11.0.nupkg b/packages/NUnit.3.11.0/NUnit.3.11.0.nupkg new file mode 100644 index 0000000000000000000000000000000000000000..7fecf4cd0bc4343e692b2312fe53ba6573ef6ee0 Binary files /dev/null and b/packages/NUnit.3.11.0/NUnit.3.11.0.nupkg differ diff --git a/packages/NUnit.3.11.0/build/NUnit.props b/packages/NUnit.3.11.0/build/NUnit.props new file mode 100644 index 0000000000000000000000000000000000000000..79c80b8214c63790bf384aeb0121c12aa82a2c3d --- /dev/null +++ b/packages/NUnit.3.11.0/build/NUnit.props @@ -0,0 +1,7 @@ + + + + + + + diff --git a/packages/NUnit.3.11.0/lib/net20/NUnit.System.Linq.dll b/packages/NUnit.3.11.0/lib/net20/NUnit.System.Linq.dll new file mode 100644 index 0000000000000000000000000000000000000000..57e58f69e1046b069e30beef5acc99f6fe97fe04 Binary files /dev/null and b/packages/NUnit.3.11.0/lib/net20/NUnit.System.Linq.dll differ diff --git a/packages/NUnit.3.11.0/lib/net20/nunit.framework.dll b/packages/NUnit.3.11.0/lib/net20/nunit.framework.dll new file mode 100644 index 0000000000000000000000000000000000000000..ae2864505c2598d3cd9e11ae2ac045b403485f30 Binary files /dev/null and b/packages/NUnit.3.11.0/lib/net20/nunit.framework.dll differ diff --git a/packages/NUnit.3.11.0/lib/net20/nunit.framework.pdb b/packages/NUnit.3.11.0/lib/net20/nunit.framework.pdb new file mode 100644 index 0000000000000000000000000000000000000000..08efc0dea068e273dec189f11ce9cb80b3670df0 Binary files /dev/null and b/packages/NUnit.3.11.0/lib/net20/nunit.framework.pdb differ diff --git a/packages/NUnit.3.11.0/lib/net20/nunit.framework.xml b/packages/NUnit.3.11.0/lib/net20/nunit.framework.xml new file mode 100644 index 0000000000000000000000000000000000000000..e0849fd20516ef4882a2302b7ad0709aac5fa56b --- /dev/null +++ b/packages/NUnit.3.11.0/lib/net20/nunit.framework.xml @@ -0,0 +1,20910 @@ + + + + nunit.framework + + + + + 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 + + + + + DefaultTestAssemblyBuilder loads a single assembly and builds a TestSuite + containing test fixtures present in the assembly. + + + + + The default suite builder used by the test assembly builder. + + + + + Initializes a new instance of the class. + + + + + Build a suite of tests from a provided assembly + + The assembly from which tests are to be built + A dictionary of options to use in building the suite + + A TestSuite containing the tests found in the assembly + + + + + Build a suite of tests given the name or the location of an assembly + + The name or the location of the assembly. + A dictionary of options to use in building the suite + + A TestSuite containing the tests found in the assembly + + + + + FrameworkController provides a facade for use in loading, browsing + and running tests without requiring a reference to the NUnit + framework. All calls are encapsulated in constructors for + this class and its nested classes, which only require the + types of the Common Type System as arguments. + + The controller supports four actions: Load, Explore, Count and Run. + They are intended to be called by a driver, which should allow for + proper sequencing of calls. Load must be called before any of the + other actions. The driver may support other actions, such as + reload on run, by combining these calls. + + + + + Construct a FrameworkController using the default builder and runner. + + The AssemblyName or path to the test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + + + + Construct a FrameworkController using the default builder and runner. + + The test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + + + + Construct a FrameworkController, specifying the types to be used + for the runner and builder. This constructor is provided for + purposes of development. + + The full AssemblyName or the path to the test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + The Type of the test runner + The Type of the test builder + + + + Construct a FrameworkController, specifying the types to be used + for the runner and builder. This constructor is provided for + purposes of development. + + The test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + The Type of the test runner + The Type of the test builder + + + + Gets the ITestAssemblyBuilder used by this controller instance. + + The builder. + + + + Gets the ITestAssemblyRunner used by this controller instance. + + The runner. + + + + Gets the AssemblyName or the path for which this FrameworkController was created + + + + + Gets the Assembly for which this + + + + + Gets a dictionary of settings for the FrameworkController + + + + + Loads the tests in the assembly + + + + + + Returns info about the tests in an assembly + + A string containing the XML representation of the filter to use + The XML result of exploring the tests + + + + Runs the tests in an assembly + + A string containing the XML representation of the filter to use + The XML result of the test run + + + + Stops the test run + + True to force the stop, false for a cooperative stop + + + + Counts the number of test cases in the loaded TestSuite + + A string containing the XML representation of the filter to use + The number of tests + + + + Inserts environment element + + Target node + The new node + + + + Inserts settings element + + Target node + Settings dictionary + The new node + + + + FrameworkControllerAction is the base class for all actions + performed against a FrameworkController. + + + + + LoadTestsAction loads a test into the FrameworkController + + + + + LoadTestsAction loads the tests in an assembly. + + The controller. + The callback handler. + + + + ExploreTestsAction returns info about the tests in an assembly + + + + + Initializes a new instance of the class. + + The controller for which this action is being performed. + Filter used to control which tests are included (NYI) + The callback handler. + + + + CountTestsAction counts the number of test cases in the loaded TestSuite + held by the FrameworkController. + + + + + Construct a CountsTestAction and perform the count of test cases. + + A FrameworkController holding the TestSuite whose cases are to be counted + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + RunTestsAction runs the loaded TestSuite held by the FrameworkController. + + + + + Construct a RunTestsAction and run all tests in the loaded TestSuite. + + A FrameworkController holding the TestSuite to run + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + RunAsyncAction initiates an asynchronous test run, returning immediately + + + + + Construct a RunAsyncAction and run all tests in the loaded TestSuite. + + A FrameworkController holding the TestSuite to run + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + StopRunAction stops an ongoing run. + + + + + Construct a StopRunAction and stop any ongoing run. If no + run is in process, no error is raised. + + The FrameworkController for which a run is to be stopped. + True the stop should be forced, false for a cooperative stop. + >A callback handler used to report results + A forced stop will cause threads and processes to be killed as needed. + + + + The ITestAssemblyBuilder interface is implemented by a class + that is able to build a suite of tests given an assembly or + an assembly filename. + + + + + Build a suite of tests from a provided assembly + + The assembly from which tests are to be built + A dictionary of options to use in building the suite + A TestSuite containing the tests found in the assembly + + + + Build a suite of tests given the filename of an assembly + + The filename of the assembly from which tests are to be built + A dictionary of options to use in building the suite + A TestSuite containing the tests found in the assembly + + + + The ITestAssemblyRunner interface is implemented by classes + that are able to execute a suite of tests loaded + from an assembly. + + + + + Gets the tree of loaded tests, or null if + no tests have been loaded. + + + + + Gets the tree of test results, if the test + run is completed, otherwise null. + + + + + Indicates whether a test has been loaded + + + + + Indicates whether a test is currently running + + + + + Indicates whether a test run is complete + + + + + Loads the tests found in an Assembly, returning an + indication of whether or not the load succeeded. + + File name of the assembly to load + Dictionary of options to use in loading the test + An ITest representing the loaded tests + + + + Loads the tests found in an Assembly, returning an + indication of whether or not the load succeeded. + + The assembly to load + Dictionary of options to use in loading the test + An ITest representing the loaded tests + + + + Count Test Cases using a filter + + The filter to apply + The number of test cases found + + + + Explore the test cases using a filter + + The filter to apply + Test Assembly with test cases that matches the filter + + + + Run selected tests and return a test result. The test is run synchronously, + and the listener interface is notified as it progresses. + + Interface to receive ITestListener notifications. + A test filter used to select tests to be run + + + + Run selected tests asynchronously, notifying the listener interface as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + + + Wait for the ongoing run to complete. + + Time to wait in milliseconds + True if the run completed, otherwise false + + + + Signal any test run that is in process to stop. Return without error if no test is running. + + If true, kill any test-running threads + + + + Implementation of ITestAssemblyRunner + + + + + Initializes a new instance of the class. + + The builder. + + + + Gets the default level of parallel execution (worker threads) + + + + + The tree of tests that was loaded by the builder + + + + + The test result, if a run has completed + + + + + Indicates whether a test is loaded + + + + + Indicates whether a test is running + + + + + Indicates whether a test run is complete + + + + + Our settings, specified when loading the assembly + + + + + The top level WorkItem created for the assembly as a whole + + + + + The TestExecutionContext for the top level WorkItem + + + + + Loads the tests found in an Assembly + + File name or path of the assembly to load + Dictionary of option settings for loading the assembly + True if the load was successful + + + + Loads the tests found in an Assembly + + The assembly to load + Dictionary of option settings for loading the assembly + True if the load was successful + + + + Count Test Cases using a filter + + The filter to apply + The number of test cases found + + + + Explore the test cases using a filter + + The filter to apply + Test Assembly with test cases that matches the filter + + + + Run selected tests and return a test result. The test is run synchronously, + and the listener interface is notified as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + + + + Run selected tests asynchronously, notifying the listener interface as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + RunAsync is a template method, calling various abstract and + virtual methods to be overridden by derived classes. + + + + + Wait for the ongoing run to complete. + + Time to wait in milliseconds + True if the run completed, otherwise false + + + + Signal any test run that is in process to stop. Return without error if no test is running. + + If true, kill any tests that are currently running + + + + Initiate the test run. + + + + + Create the initial TestExecutionContext used to run tests + + The ITestListener specified in the RunAsync call + + + + Handle the Completed event for the top level work item + + + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + + + Verifies that the first int is greater than the second + int. 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 int is greater than the second + int. 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Verifies that the first value is greater than or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Asserts that an int is zero. + + The number to be examined + + + + Asserts that an int is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is zero. + + The number to be examined + + + + Asserts that an unsigned int is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is zero. + + The number to be examined + + + + Asserts that a Long is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is zero. + + The number to be examined + + + + Asserts that an unsigned Long is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is zero. + + The number to be examined + + + + Asserts that a decimal is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is zero. + + The number to be examined + + + + Asserts that a double is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is zero. + + The number to be examined + + + + Asserts that a float is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is not zero. + + The number to be examined + + + + Asserts that an int is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is not zero. + + The number to be examined + + + + Asserts that an unsigned int is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is not zero. + + The number to be examined + + + + Asserts that a Long is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is not zero. + + The number to be examined + + + + Asserts that an unsigned Long is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is zero. + + The number to be examined + + + + Asserts that a decimal is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is zero. + + The number to be examined + + + + Asserts that a double is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is zero. + + The number to be examined + + + + Asserts that a float is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is positive. + + The number to be examined + + + + Asserts that an int is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is positive. + + The number to be examined + + + + Asserts that an unsigned int is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is positive. + + The number to be examined + + + + Asserts that a Long is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is positive. + + The number to be examined + + + + Asserts that an unsigned Long is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is positive. + + The number to be examined + + + + Asserts that a decimal is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is positive. + + The number to be examined + + + + Asserts that a double is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is positive. + + The number to be examined + + + + Asserts that a float is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is negative. + + The number to be examined + + + + Asserts that an int is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is negative. + + The number to be examined + + + + Asserts that an unsigned int is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is negative. + + The number to be examined + + + + Asserts that a Long is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is negative. + + The number to be examined + + + + Asserts that an unsigned Long is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is negative. + + The number to be examined + + + + Asserts that a decimal is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is negative. + + The number to be examined + + + + Asserts that a double is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is negative. + + The number to be examined + + + + Asserts that a float is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + DO NOT USE! Use Assert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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. + + + + + Issues a warning using the message and arguments provided. + + The message to display. + Arguments to be used in formatting the message + + + + Issues a warning using the message provided. + + The message to display. + + + + 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. + + + + + Asserts that an object is contained in a collection. + + The expected object + The collection 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 collection. + + The expected object + The collection to be examined + + + + Wraps code containing a series of assertions, which should all + be executed, even if they fail. Failed results are saved and + reported at the end of the code block. + + A TestDelegate to be executed in Multiple Assertion mode. + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + 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 TestDelegate + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + 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 TestDelegate + + + + 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 + + + + 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 + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it 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 of a certain Type + or one derived from it when called and returns it. + + A TestDelegate + + + + Verifies that a delegate does not throw an exception + + A TestDelegate + 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 TestDelegate + + + + 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 + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + 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 + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + 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 an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + 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 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. + + The actual value to test + A Constraint expression to be applied + + + + 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. + + The actual value to test + A Constraint expression to be applied + The message that will be displayed on failure + Arguments 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 + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Delegate used by tests that execute code and + capture any thrown exception. + + + + + AssertionHelper is an optional base class for user tests, + allowing the use of shorter names in making asserts. + + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to + . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to . + + The evaluated condition + + + + 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. + + 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 + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + 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 + + + + 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 + + + + Returns a ListMapper based on a collection. + + The original collection + + + + + 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 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 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 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 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 equality with zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new 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 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 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 regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression 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 a subpath of the 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. + + + + + 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. + + + + + DO NOT USE! + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + Not applicable + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + 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 + + + + 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 + + + + 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 InconclusiveException on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Marks a test as needing to be run in a particular threading apartment state. This will cause it + to run in a separate thread if necessary. + + + + + Construct an ApartmentAttribute + + The apartment state that this test must be run under. You must pass in a valid apartment state. + + + + Provides the author of a test or test fixture. + + + + + Initializes a new instance of the class. + + The name of the author. + + + + Initializes a new instance of the class. + + The name of the author. + The email address of the author. + + + + Applies 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 + + + + + Modifies a test by adding a category to it. + + The test to modify + + + + Marks a test to use a combinatorial join of any argument data provided. + Since this is the default, the attribute is optional. + + + + + Default constructor + + + + + Marks a test as using a particular CombiningStrategy to join any supplied parameter data. + Since this is the default, the attribute is optional. + + + + + Construct a CombiningStrategyAttribute incorporating an + ICombiningStrategy and an IParameterDataProvider. + + Combining strategy to be used in combining data + An IParameterDataProvider to supply data + + + + Construct a CombiningStrategyAttribute incorporating an object + that implements ICombiningStrategy and an IParameterDataProvider. + This constructor is provided for CLS compliance. + + Combining strategy to be used in combining data + An IParameterDataProvider to supply data + + + + Builds any number of tests from the specified method and context. + + The MethodInfo for which tests are to be constructed. + The suite to which the tests will be added. + + + + Modify the test by adding the name of the combining strategy + to the properties. + + The test to modify + + + + Marks an assembly, test fixture or test method as applying to a specific Culture. + + + + + Constructor with no cultures specified, for use + with named property syntax. + + + + + Constructor taking one or more cultures + + Comma-delimited list of cultures + + + + Causes a test to be skipped if this CultureAttribute is not satisfied. + + The test to modify + + + + Tests to determine if the current culture is supported + based on the properties of this attribute. + + True, if the current culture is supported + + + + Test to determine if the a particular culture or comma- + delimited set of cultures is in use. + + Name of the culture or comma-separated list of culture ids + True if the culture is in use on the system + + + + Test to determine if one of a collection of cultures + is being used currently. + + + + + + + Abstract base class for all data-providing attributes defined by NUnit. + Used to select all data sources for a method, class or parameter. + + + + + Default constructor + + + + + Marks a field for use as a datapoint when executing a theory within + the same fixture that requires an argument of the field's Type. + + + + + Marks a field, property or method as providing a set of datapoints for use + in executing any theories within the same fixture that require an argument of + the provided Type. The data source may provide an array of the required Type + or an . Synonymous with . + + + + + Marks a field, property or method as providing a set of datapoints for use + in executing any theories within the same fixture that require an argument + of the provided type. The data source may provide an array of the required + Type or an . Synonymous with . + + + + + Sets the tolerance used by default when checking the equality of floating point values + within the test assembly, fixture or method. + + + + + Construct specifying an amount + + + + + + Apply changes to the TestExecutionContext + + The TestExecutionContext + + + + Provides the descriptive text relating to the assembly, test fixture or test method. + + + + + Construct a description Attribute + + The text of the description + + + + Marks an assembly, test fixture or test method such that it will only run if explicitly + executed from the GUI, command line or included within a test 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 + + + + Modifies a test by marking it as explicit. + + The test to modify + + + + Marks an assembly, test fixture or test method as being ignored. Ignored tests result in a warning message when the tests are run. + + + + + Constructs the attribute giving a reason for ignoring the test + + The reason for ignoring the test + + + + The date in the future to stop ignoring the test as a string in UTC time. + For example for a date and time, "2014-12-25 08:10:00Z" or for just a date, + "2014-12-25". If just a date is given, the Ignore will expire at midnight UTC. + + + Once the ignore until date has passed, the test will be marked + as runnable. Tests with an ignore until date will have an IgnoreUntilDate + property set which will appear in the test results. + + The string does not contain a valid string representation of a date and time. + + + + Modifies a test by marking it as Ignored. + + The test to modify + + + + 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 items 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 + + + + + Sets the number of worker threads that may be allocated by the framework + for running tests. + + + + + Construct a LevelOfParallelismAttribute. + + The number of worker threads to be created by the framework. + + + + Specifies the maximum time (in milliseconds) for a test case to succeed. + + + + + Construct a MaxTimeAttribute, given a time in milliseconds. + + The maximum elapsed time in milliseconds + + + + Marks tests that should NOT be run in parallel. + + + + + Construct a NonParallelizableAttribute. + + + + + Used by third-party frameworks, or other software, that reference + the NUnit framework but do not contain any tests. Applying the + attribute indicates that the assembly is not a test assembly and + may prevent errors if certain runners attempt to load the assembly. + Note that recognition of the attribute depends on each individual runner. + + + + + Abstract base class for all custom attributes defined by NUnit. + + + + + Default constructor + + + + + Identifies a method that is called once to perform setup before any child tests are run. + + + + + Identifies a method to be called once after all the child tests have run. + The method is guaranteed to be called, even if an exception is thrown. + + + + + Defines the order that the test will run in + + + + + Defines the order that the test will run in + + + + + Defines the order that the test will run in + + + + + + Modifies a test as defined for the specific attribute. + + The test to modify + + + + Marks a test as using a pairwise join of any supplied argument data. Arguments will be + combined in such a way that all possible pairs of arguments are used. + + + + + Default constructor + + + + + Marks a test assembly, fixture or method that may be run in parallel. + + + + + Construct a ParallelizableAttribute using default ParallelScope.Self. + + + + + Construct a ParallelizableAttribute with a specified scope. + + The ParallelScope associated with this attribute. + + + + Defines the degree to which this test and its descendants may be run in parallel + + + + + Overridden to check for invalid combinations of settings + + + + + + Modify the context to be used for child tests + + The current TestExecutionContext + + + + Specifies the degree to which a test, and its descendants, + may be run in parallel. + + + + + No ParallelScope was specified on the test + + + + + The test may be run in parallel with others at the same level. + Valid on classes and methods but not assemblies. + + + + + Test may not be run in parallel with any others. Valid on + classes and methods but not assemblies. + + + + + Mask used to extract the flags that apply to the item on which a + ParallelizableAttribute has been placed, as opposed to descendants. + + + + + Descendants of the test may be run in parallel with one another. + Valid on assemblies and classes but not on methods. + + + + + Descendants of the test down to the level of TestFixtures may be + run in parallel with one another. Valid on assemblies and classes + but not on methods. + + + + + Mask used to extract all the flags that impact descendants of a + test and place them in the TestExecutionContext. + + + + + The test and its descendants may be run in parallel with others at + the same level. Valid on classes and methods but not assemblies. + + + + + Marks an assembly, test fixture or test method as applying to a specific platform. + + + + + Constructor with no platforms specified, for use + with named property syntax. + + + + + Constructor taking one or more platforms + + Comma-delimited list of platforms + + + + Causes a test to be skipped if this PlatformAttribute is not satisfied. + + The test to modify + + + + Attaches information to a test assembly, fixture or method 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 + + + + + Modifies a test by adding properties to it. + + The test to modify + + + + Supplies a set of random values to a single parameter of a parameterized test. + + + + + If true, no value will be repeated. + + + + + Construct a random set of values appropriate for the Type of the + parameter on which the attribute appears, specifying only the count. + + + + + + Construct a set of ints within a specified range + + + + + Construct a set of unsigned ints within a specified range + + + + + Construct a set of longs within a specified range + + + + + Construct a set of unsigned longs within a specified range + + + + + Construct a set of shorts within a specified range + + + + + Construct a set of unsigned shorts within a specified range + + + + + Construct a set of doubles within a specified range + + + + + Construct a set of floats within a specified range + + + + + Construct a set of bytes within a specified range + + + + + Construct a set of sbytes within a specified range + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + Supplies 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 unsigned ints using default step of 1 + + + + + Construct a range of unsigned ints specifying the step size + + + + + Construct a range of longs using a default step of 1 + + + + + Construct a range of longs + + + + + Construct a range of unsigned longs using default step of 1 + + + + + Construct a range of unsigned longs specifying the step size + + + + + Construct a range of doubles + + + + + Construct a range of floats + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + Returns a string that represents the current object. + + + + Specifies that a test should be run multiple times. + + + + + Construct a RepeatAttribute + + The number of times to run the test + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + The test command for the RepeatAttribute + + + + + Initializes a new instance of the class. + + The inner command. + The number of repetitions + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Marks a test that must run on a separate thread. + + + + + Construct a RequiresThreadAttribute + + + + + Construct a RequiresThreadAttribute, specifying the apartment + + + + + Specifies that a test method should be rerun on failure up to the specified + maximum number of times. + + + + + Construct a + + The maximum number of times the test should be run if it fails + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + The test command for the + + + + + Initializes a new instance of the class. + + The inner command. + The maximum number of repetitions + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Marks a test to use a sequential join of any provided argument data. + Arguments will be combined into test cases, taking the next value of + each argument until all are used. + + + + + Default constructor + + + + + Sets the current Culture on an assembly, test fixture or test method for + the duration of a test. The culture remains set until the test or fixture + completes and is then reset to its original value. + + + + + + Construct given the name of a culture + + + + + + Sets the current UI Culture on an assembly, test fixture or test method + for the duration of a test. The UI culture remains set until the test or + fixture completes and is then reset to its original value. + + + + + + Construct given the name of a culture + + + + + + Identifies a method to be called immediately before each test is run. + + + + + Identifies a class as containing or + methods for all the test fixtures + under a given namespace. + + + + + Builds a from the specified type. + + The type info of the fixture to be used. + + + + Marks a test fixture as requiring all child tests to be run on the + same thread as the OneTimeSetUp and OneTimeTearDown. A flag in the + is set forcing all child tests + to be run sequentially on the current thread. + Any setting is ignored. + + + + + Apply changes to the TestExecutionContext + + The TestExecutionContext + + + + Identifies a method to be called immediately after each test is run. + The method is guaranteed to be called, even if an exception is thrown. + + + + + Abstract attribute providing actions to execute before and after tests. + + + + + Executed before each test is run + + The test that is going to be run. + + + + Executed after each test is run + + The test that has just been run. + + + + Provides the target for the action attribute + + + + + Marks a test assembly as needing a special assembly resolution hook that will + explicitly search the test assembly's directory for dependent assemblies. + This works around a conflict between mixed-mode assembly initialization and + tests running in their own AppDomain in some cases. + + + + + Marks the method as callable from the NUnit test runner. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + public void TestDescriptionMethod() + {} + } + + + + + + Descriptive text for this test + + + + + The author of this test + + + + + The type that this test is testing + + + + + Gets or sets the expected result. Not valid if the test + method has parameters. + + The result. + + + + Modifies a test by adding a description, if not already set. + + The test to modify + + + + Builds a single test from the specified method and context. + + The method for which a test is to be constructed. + The suite to which the test will be added. + + + + Marks a method as a parameterized test suite and provides arguments for each test case. + + + + + 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 or sets the name of the test. + + The name of the test. + + + + Gets or sets the RunState of this test case. + + + + + Gets the list of arguments to a test case + + + + + Gets the properties of the test case + + + + + Gets or sets the expected result. + + The result. + + + + Returns true if the expected result has been set + + + + + Gets or sets the description. + + The description. + + + + The author of this test + + + + + The type that this test is testing + + + + + Gets or sets the reason for ignoring the test + + + + + Gets or sets a value indicating whether this is explicit. + + + true if explicit; otherwise, false. + + + + + Gets or sets the reason for not running the test. + + The reason. + + + + Gets or sets the ignore reason. When set to a non-null + non-empty value, the test is marked as ignored. + + The ignore reason. + + + + Comma-delimited list of platforms to run the test for + + + + + Comma-delimited list of platforms to not run the test for + + + + + Gets and sets the category for this test case. + May be a comma-separated list of categories. + + + + + Performs several special conversions allowed by NUnit in order to + permit arguments with types that cannot be used in the constructor + of an Attribute such as TestCaseAttribute or to simplify their use. + + The arguments to be converted + The ParameterInfo array for the method + + + + Performs several special conversions allowed by NUnit in order to + permit arguments with types that cannot be used in the constructor + of an Attribute such as TestCaseAttribute or to simplify their use. + + The argument to be converted + The target in which the should be converted + If conversion was successfully applied, the converted into + + true if was converted and should be used; + false is no conversion was applied and should be ignored + + + + + Builds a single test from the specified method and context. + + The MethodInfo for which tests are to be constructed. + The suite to which the tests will be added. + + + + Indicates the source to be used to provide test fixture instances for a test class. + + + + + Construct with the name of the method, property or field that will provide data + + The name of a static method, property or field that will provide data. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + + + + Construct with a name + + The name of a static method, property or field that will provide data. + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + Construct with a Type + + The type that will provide data + + + + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + + 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 every fixture created from + this attribute. May be a single category or a comma-separated list. + + + + + Builds any number of tests from the specified method and context. + + The IMethod for which tests are to be constructed. + The suite to which the tests will be added. + + + + Marks the class as a TestFixture. + + + + + 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. + + + + + + Gets or sets the name of the test. + + The name of the test. + + + + Gets or sets the RunState of this test fixture. + + + + + The arguments originally provided to the attribute + + + + + Properties pertaining to this fixture + + + + + Get or set the type arguments. If not set + explicitly, any leading arguments that are + Types are taken as type arguments. + + + + + Descriptive text for this fixture + + + + + The author of this fixture + + + + + The type that this fixture is testing + + + + + Gets or sets the ignore reason. May set RunState as a side effect. + + The ignore reason. + + + + Gets or sets the reason for not running the fixture. + + The reason. + + + + Gets or sets the ignore reason. When set to a non-null + non-empty value, the test is marked as ignored. + + The ignore reason. + + + + Gets or sets a value indicating whether this is explicit. + + + true if explicit; otherwise, false. + + + + + Gets and sets the category for this fixture. + May be a comma-separated list of categories. + + + + + Builds a single test fixture from the specified type. + + + + + Builds a single test fixture from the specified type. + + The type info of the fixture to be used. + Filter used to select methods as tests. + + + + Identifies the source used to provide test fixture instances for a test class. + + + + + Error message string is public so the tests can use it + + + + + Construct with the name of the method, property or field that will provide data + + The name of a static method, property or field that will provide data. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + + + + Construct with a Type + + The type 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 every fixture created from + this attribute. May be a single category or a comma-separated list. + + + + + Builds any number of test fixtures from the specified type. + + The TypeInfo for which fixtures are to be constructed. + + + + Builds any number of test fixtures from the specified type. + + The TypeInfo for which fixtures are to be constructed. + PreFilter used to select methods as tests. + + + + Returns a set of ITestFixtureData items for use as arguments + to a parameterized test fixture. + + The type for which data is needed. + + + + + Indicates the method or class the assembly, test fixture or test method is testing. + + + + + Initializes a new instance of the class. + + The type that is being tested. + + + + Initializes a new instance of the class. + + The type that is being tested. + + + + 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")] + public void TestDescriptionMethod() + {} + } + + + + + + Construct the attribute, specifying a combining strategy and source of parameter data. + + + + + Applies a timeout in milliseconds to a test. + When applied to a method, the test is cancelled if the timeout is exceeded. + When applied to a class or assembly, the default timeout is set for all contained test methods. + + + + + Construct a TimeoutAttribute given a time in milliseconds + + The timeout value in milliseconds + + + + Provides literal arguments for an individual parameter of a test. + + + + + 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 + + + + + Constructs for use with an Enum parameter. Will pass every enum + value in to the test. + + + + + Construct with one argument + + + + + + Construct with two arguments + + + + + + + Construct with three arguments + + + + + + + + Construct with an array of arguments + + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + To generate data for Values attribute, in case no data is provided. + + + + + To Check if type is nullable enum. + + + + + Indicates the source 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 a static method, property or field 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 a static 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 + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + A set of Assert methods operating on one or more collections + + + + + DO NOT USE! Use CollectionAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + 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 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 + 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 + 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 + 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 + 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 + 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 + 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 + Arguments to be used in formatting the message + + + + Asserts that the superset does not contain the subset + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + + + + Asserts that the superset does not contain the subset + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the superset contains the subset. + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + + + + Asserts that the superset contains the subset. + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the subset does not contain the superset + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that the subset does not contain the superset + + 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 the subset contains the superset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that the subset contains the superset. + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + AllItemsConstraint applies another constraint to each + item in a collection, succeeding if they all succeed. + + + + + Construct an AllItemsConstraint on top of an existing 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. + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + AndConstraint succeeds only if both members succeed. + + + + + Create an AndConstraint from two other constraints + + The first constraint + The second constraint + + + + Gets text describing a 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 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 + + + + is used to determine whether the value is equal to any of the expected values. + + + + + Construct a + + Collection of expected values + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether item is present in expected collection + + Actual item type + Actual item + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IEqualityComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + AssignableFromConstraint is used to test that an object + can be assigned from a given Type. + + + + + Construct an AssignableFromConstraint for the type provided + + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + AssignableToConstraint is used to test that an object + can be assigned to a given Type. + + + + + Construct an AssignableToConstraint for the type provided + + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + 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. + + + + + Constructs an AttributeConstraint for a specified attribute + Type and base constraint. + + + + + + + Determines whether the Type or other provider has the + expected attribute and if its value matches the + additional constraint specified. + + + + + Returns a string representation of the constraint. + + + + + AttributeExistsConstraint tests for the presence of a + specified attribute on a Type. + + + + + Constructs an AttributeExistsConstraint for a specific attribute Type + + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Tests whether the object provides the expected attribute. + + A Type, MethodInfo, or other ICustomAttributeProvider + True if the expected attribute is present, otherwise false + + + + 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 + + + + BinarySerializableConstraint tests whether + an object is serializable in binary format. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Returns the string representation + + + + + 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 + + + + + + + CollectionContainsConstraint is used to test whether a collection + contains an expected object as a member. + + + + + Construct a CollectionContainsConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Test whether the expected item is contained in the collection + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + CollectionEquivalentConstraint is used to determine whether two + collections are equivalent. + + + + The result of the from the collections + under comparison. + + + Construct a CollectionEquivalentConstraint + Expected collection. + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether two collections are equivalent + + + + + + + Test whether the collection is equivalent to the expected. + + + Actual collection type. + + + Actual collection to compare. + + + A indicating whether or not + the two collections are equivalent. + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + Provides a for the . + + + Result of a of the collections to compare for equivalence. + + + Maximum amount of elements to write to the if there are + extra/missing elements from the collection. + + + Construct a using a . + Source . + Result of the collection comparison. + Actual collection to compare. + Whether or not the succeeded. + + + Write any additional lines (following Expected: and But was:) for a failing constraint. + The to write the failure message to. + + + + CollectionItemsEqualConstraint is the abstract base class for all + collection constraints that apply some notion of item equality + as a part of their operation. + + + + + The NUnitEqualityComparer in use for this constraint + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Get a flag indicating whether the user requested us to ignore case. + + + + + Get a flag indicating whether any external comparers are in use. + + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + Compares two collection members for equality + + + + + Return a new CollectionTally for use in making tests + + The collection to be included in the tally + + + + CollectionOrderedConstraint is used to test whether a collection is ordered. + + + + + Construct a CollectionOrderedConstraint + + + + + 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. + + + + + If used performs a default ascending comparison + + + + + If used performs a reverse comparison + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use a and returns self. + + + + + Modifies the constraint to test ordering by the value of + a specified property and returns self. + + + + + Then signals a break between two ordering steps + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Test whether the collection is ordered + + + + + Returns the string representation of the constraint. + + + + + + An OrderingStep represents one stage of the sort + + + + + Constructor for success result. + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + + + + Constructor for failure result. + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + Index at which collection order breaks. + Value at which collection order breaks. + + + + 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 + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the actual collection is a subset of + the expected collection provided. + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + CollectionSupersetConstraint is used to determine whether + one collection is a superset of another + + + + + Construct a CollectionSupersetConstraint + + The collection that the actual value is expected to be a superset of + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the actual collection is a superset of + the expected collection provided. + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + counts (tallies) the number of occurrences + of each object in one or more enumerations. + + + The result of a . + + + Items that were not in the expected collection. + + + Items that were not accounted for in the expected collection. + + + Initializes a new instance of the class with the given fields. + + + The result of the comparison between the two collections. + + + Construct a CollectionTally object from a comparer and a collection. + The comparer to use for equality. + The expected collection to compare against. + + + Try to remove an object from the tally. + The object to remove. + + + Try to remove a set of objects from the tally. + The objects to remove. + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two types related by . + + + + + Interface for comparing two s. + + + + + Method for comparing two objects with a tolerance. + + The first object to compare. + The second object to compare. + The tolerance to use when comparing the objects. + Flag indicating whether or not this is the top level comparison. + + null if the objects cannot be compared using the method. + Otherwise the result of the comparison is returned. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s or s. + + + + + Comparator for two Tuples. + + + + + Base class for comparators for tuples (both regular Tuples and ValueTuples). + + + + + Comparator for two ValueTuples. + + + + + ComparisonAdapter class centralizes all comparisons of + values in NUnit, adapting to the use of any provided + , + or . + + + + + Gets the default ComparisonAdapter, which wraps an + NUnitComparer object. + + + + + Returns a ComparisonAdapter that wraps an + + + + + Returns a ComparisonAdapter that wraps an + + + + + Returns a ComparisonAdapter that wraps a + + + + + Compares two objects + + + + + Construct a default ComparisonAdapter + + + + + Construct a ComparisonAdapter for an + + + + + Compares two objects + + + + + + + + ComparerAdapter extends and + allows use of an or + to actually perform the comparison. + + + + + Construct a ComparisonAdapter for an + + + + + Compare a Type T to an object + + + + + Construct a ComparisonAdapter for a + + + + + Compare a Type T to an object + + + + + Abstract base class for constraints that compare values to + determine if one is greater than, equal to or less than + the other. + + + + + The value against which a comparison is to be made + + + + + Tolerance used in making the comparison + + + + + ComparisonAdapter to be used in making the comparison + + + + + Initializes a new instance of the class. + + The value against which to make a comparison. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + A ConstraintResult + + + + Protected function overridden by derived class to actually perform the comparison + + + + + Modifies the constraint to use an and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Modifies the constraint to use an and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Modifies the constraint to use a and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Set the tolerance for use in this comparison + + + + + Switches the .Within() modifier to interpret its tolerance as + a percentage that the actual values is allowed to deviate from + the expected value. + + Self + + + + Delegate used to delay evaluation of the actual value + to be used in evaluating a constraint + + + + + The Constraint class is the base of all built-in constraints + within NUnit. It provides the operator overloads used to combine + constraints. + + + + + Construct a constraint with optional arguments + + Arguments to be saved + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Arguments provided to this Constraint, for use in + formatting the description. + + + + + The ConstraintBuilder holding this constraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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 + A ConstraintResult + + + + Retrieves the value to be tested from an ActualValueDelegate. + The default implementation simply evaluates the delegate but derived + classes may override it to provide for delayed processing. + + An ActualValueDelegate + Delegate evaluation result + + + + 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 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. + + + + + Returns a DelayedConstraint.WithRawDelayInterval with the specified delay time. + + The delay, which defaults to milliseconds. + + + + + Returns a DelayedConstraint with the specified delay time + and polling interval. + + The delay in milliseconds. + The interval at which to test the constraint. + + + + + Resolves any pending operators and returns the resolved 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 reorganized. a ConstraintStack holds + input constraints as well as the results of each + operator applied. + + + + + OperatorStack is a type-safe stack for holding ConstraintOperators + + + + + Initializes a new instance of the class. + + The ConstraintBuilder using this stack. + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost operator without modifying the stack. + + + + + Pushes the specified operator onto the stack. + + The operator to put onto the stack. + + + + Pops the topmost operator from the stack. + + The topmost operator on the stack + + + + ConstraintStack is a type-safe stack for holding Constraints + + + + + Initializes a new instance of the class. + + The ConstraintBuilder using this stack. + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Pushes the specified constraint. As a side effect, + the constraint's Builder field is set to the + ConstraintBuilder owning this stack. + + The constraint to put onto the stack + + + + Pops this topmost constraint from the stack. + As a side effect, the constraint's Builder + field is set to null. + + The topmost constraint on the stack + + + + 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 expression 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. + + + + + 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 + reorganized. When a constraint is appended, it is returned as the + value of the operation so that modifiers may be applied. However, + any partially built expression is attached to the constraint for + later resolution. When an operator is appended, the partial + expression is returned. If it's a self-resolving operator, then + a ResolvableConstraintExpression is returned. + + + + + 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. Note that the constraint + is not reduced at this time. For example, if there + is a NotOperator on the stack we don't reduce and + return a NotConstraint. The original constraint must + be returned because it may support modifiers that + are yet to be applied. + + + + + 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 ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a , which will + apply the following constraint to a collection of length one, succeeding + only if exactly one of them succeeds. + + + + + 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 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 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. + + + + + With is currently a NOP - reserved for future use. + + + + + 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 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 if item is equal to zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new 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 new 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 new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the Dictionary key collection. + + The key to be matched in the Dictionary key collection + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the Dictionary value collection. + + The value to be matched in the Dictionary value collection + + + + 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 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 ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression 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 a subpath of the 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 + inclusively within a specified range. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + Returns a constraint that succeeds if the value + is a file or directory and it exists. + + + + + Returns a constraint that tests if an item is equal to any of parameters + + Expected values + + + + ConstraintStatus represents the status of a ConstraintResult + returned by a Constraint being applied to an actual value. + + + + + The status has not yet been set + + + + + The constraint succeeded + + + + + The constraint failed + + + + + An error occurred in applying the constraint (reserved for future use) + + + + + Contains the result of matching a against an actual value. + + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + The status of the new ConstraintResult. + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + If true, applies a status of Success to the result, otherwise Failure. + + + + The actual value that was passed to the method. + + + + + Gets and sets the ResultStatus for this result. + + + + + True if actual value meets the Constraint criteria otherwise false. + + + + + Display friendly name of the constraint. + + + + + Description of the constraint may be affected by the state the constraint had + when was performed against the actual value. + + + + + Write the failure message to the MessageWriter provided + as an argument. The default implementation simply passes + the result 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 occurred, can override this. + + The MessageWriter on which to display the message + + + + Write some additional failure message. + + The MessageWriter on which to display the message + + + + 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 + + + + 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 value contained within the string/collection. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Flag the constraint to ignore case and return self. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Applies a delay to the match so that a match can be evaluated in the future. + + + + + Allows only changing the time dimension of delay interval and setting a polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithRawDelayInterval + + Parent DelayedConstraint on which delay interval dimension is required to be set + + + + Changes delay interval dimension to minutes + + + + + Changes delay interval dimension to seconds + + + + + Changes delay interval dimension to milliseconds + + + + + Set polling interval, in milliseconds + + A time interval, in milliseconds + + + + + Allows only setting the polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithDimensionedDelayInterval + + Parent DelayedConstraint on which polling interval is required to be set + + + + Set polling interval, in milliseconds + + A time interval, in milliseconds + + + + + Allows only changing the time dimension of the polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithRawPollingInterval + + Parent DelayedConstraint on which polling dimension is required to be set + + + + Changes polling interval dimension to minutes + + + + + Changes polling interval dimension to seconds + + + + + Changes polling interval dimension to milliseconds + + + + + Delay value store as an Interval object + + + + + Polling value stored as an Interval object + + + + + Creates a new DelayedConstraint + + The inner constraint to 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 to decorate + The time interval after which the match is performed, in milliseconds + The time interval used for polling, in milliseconds + If the value of is less than 0 + + + + Gets text describing a constraint + + + + + 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 + A ConstraintResult + + + + 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 + + + + Returns the string representation of the constraint. + + + + + Adjusts a Timestamp by a given TimeSpan + + + + + + + + Returns the difference between two Timestamps as a TimeSpan + + + + + + + + DictionaryContainsKeyConstraint is used to test whether a dictionary + contains an expected object as a key. + + + + + Construct a DictionaryContainsKeyConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Flag the constraint to ignore case and return self. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + + + + Test whether the expected key is contained in the dictionary + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + DictionaryContainsValueConstraint is used to test whether a dictionary + contains an expected object as a value. + + + + + Construct a DictionaryContainsValueConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Test whether the expected value is contained in the dictionary + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + Provides a for the constraints + that are applied to each item in the collection + + + + + Constructs a for a particular + Only used for Failure + + The Constraint to which this result applies + The actual value to which the Constraint was applied + Actual item that does not match expected condition + Non matching item index + + + + Write constraint description, actual items, and non-matching item + + The MessageWriter on which to display the message + + + + EmptyCollectionConstraint tests whether a collection is empty. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Check that the collection is empty + + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + EmptyDirectoryConstraint is used to test that a directory is empty + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + EmptyStringConstraint tests whether a string is empty. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + 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. + + + + + + + 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. + + + + + NUnitEqualityComparer used to test equality. + + + + + Initializes a new instance of the class. + + The expected value. + + + + Gets the tolerance for this comparison. + + + The tolerance. + + + + + Gets a value indicating whether to compare case insensitive. + + + true if comparing case insensitive; otherwise, false. + + + + + Gets a value indicating whether or not to clip strings. + + + true if set to clip strings otherwise, false. + + + + + Gets the failure points. + + + The failure points. + + + + + 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. + + + + + Flag the constraint to use a tolerance when determining equality. + + Tolerance value to be used + Self. + + + + Flags the constraint to include + property in comparison of two values. + + + Using this modifier does not allow to use the + constraint modifier. + + + + + 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 + + + + 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 boolean-returning delegate. + + The boolean-returning delegate 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 use the supplied predicate function + + The comparison function to use. + Self. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + The EqualConstraintResult class is tailored for formatting + and displaying the result of an EqualConstraint. + + + + + Construct an EqualConstraintResult + + + + + Write a failure message. Overridden to provide custom + failure messages for EqualConstraint. + + The MessageWriter to write to + + + + Display the failure information for two collections that did not match. + + The MessageWriter on which to display + The expected collection. + The actual collection + The depth of this failure in a set of nested collections + + + + Displays a single line showing the types and sizes of the expected + and actual collections or arrays. If both are identical, the value is + only shown once. + + The MessageWriter on which to display + The expected collection or array + The actual collection or array + The indentation level for the message line + + + + Displays a single line showing the point in the expected and actual + arrays at which the comparison failed. If the arrays have different + structures or dimensions, both values are shown. + + The MessageWriter on which to display + The expected array + The actual array + Index of the failure point in the underlying collections + The indentation level for the message line + + + + 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 + + + + EqualityAdapter class handles all equality comparisons + that use an , + or a . + + + + + 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 that wraps an . + + + + + that wraps an . + + + + + Returns an that wraps an . + + + + + Returns an EqualityAdapter that uses a predicate function for items comparison. + + + + + + + + + Returns true if the two objects can be compared by this adapter. + The base adapter cannot handle IEnumerables except for strings. + + + + + Compares two objects, returning true if they are equal + + + + + Returns true if the two objects can be compared by this adapter. + Generic adapter requires objects of the specified type. + + + + + Returns an that wraps an . + + + + + Returns an that wraps an . + + + + + that wraps an . + + + + + Returns an that wraps a . + + + + + ExactCountConstraint applies another constraint to each + item in a collection, succeeding only if a specified + number of items succeed. + + + + + Construct a standalone ExactCountConstraint + + + + + + 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. + + The value to be tested + A ConstraintResult + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Contain the result of matching a against an actual value. + + + + + The maximum count of list elements that are shown on the constraint result + + + + + The count of matched items of the + + + + + A list with maximum count (+1) of items of the + (The maximum count is set in ) + + + + + Constructs a for a . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + If true, applies a status of Success to the result, otherwise Failure. + Count of matched items of the + A list with maximum count (+1) of items of the + + + + Write the actual value for a failing constraint test to a MessageWriter. + + 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. + + + + 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. + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + ExceptionTypeConstraint is a special version of ExactTypeConstraint + used to provided detailed info about the exception thrown in + an error message. + + + + + Constructs an ExceptionTypeConstraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + FalseConstraint tests that the actual value is false + + + + + Initializes a new instance of the class. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + FileExistsConstraint is used to determine if a file exists + + + + + Initializes a new instance of the class. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + FileOrDirectoryExistsConstraint is used to determine if a file or directory exists + + + + + If true, the constraint will only check if files exist, not directories + + + + + If true, the constraint will only check if directories exist, not files + + + + + Initializes a new instance of the class that + will check files and directories. + + + + + Initializes a new instance of the class that + will only check files if ignoreDirectories is true. + + if set to true [ignore directories]. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + 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. + + + + + 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 + + + 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 between 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 between 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/ + + + + + + Tests whether a value is greater than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Tests whether a value is greater than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Interface for all constraints + + + + + The display name of this Constraint for use by ToString(). + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Arguments provided to this Constraint, for use in + formatting the description. + + + + + The ConstraintBuilder holding this constraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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 + A ConstraintResult + + + + 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 + + + + 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. + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + Keeps track of an interval time which can be represented in + Minutes, Seconds or Milliseconds + + + + + Constructs a interval given an value in milliseconds + + + + + Gets Interval value represented as a TimeSpan object + + + + + Returns the interval with the current value as a number of minutes. + + + + + Returns the interval with the current value as a number of seconds. + + + + + Returns the interval with the current value as a number of milliseconds. + + + + + Is true for intervals created with a non-zero value + + + + + Returns a string that represents the current object. + + + A string that represents the current object. + + + + + IntervalUnit provides the semantics to the value stored in Interval class. + + + + + Unit representing an Interval in minutes + + + + + Unit representing an Interval in seconds + + + + + Unit representing an Interval in milliseconds + + + + + The IResolveConstraint interface is implemented by all + complete and resolvable constraints and expressions. + + + + + Return the top-level constraint for this expression + + + + + + An extension of ResolvableConstraintExpression that adds a no-op Items property for readability. + + + + + Create a new instance of ItemsConstraintExpression + + + + + Create a new instance of ResolvableConstraintExpression, + passing in a pre-populated ConstraintBuilder. + + + + + + No-op property for readability. + + + + + Tests whether a value is less than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Tests whether a value is less than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + 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 + + + + + Abstract method to get the max line length + + + + + 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 given + 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 failing constraint result + + + + 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 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 + + + + Custom value formatter function + + The value + + + + + Custom value formatter factory function + + The next formatter function + ValueFormatter + If the given formatter is unable to handle a certain format, it must call the next formatter in the chain + + + + Static methods used in creating messages + + + + + Static string used when strings are clipped + + + + + Formatting strings used for expected and actual values + + + + + Current head of chain of value formatters. Public for testing. + + + + + Add a formatter to the chain of responsibility. + + + + + + Formats text to represent a generalized value. + + The value + The formatted text + + + + Formats 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 + + + + 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 + + + + Converts any null characters in a string + to their escaped representation. + + The string to be converted + The converted string + + + + Return the a string representation for a set of indices into an array + + Array of indices for which a string is needed + + + + Get an array of indices representing the point in a collection or + array corresponding to a single int index into the collection. + + The collection to which the indices apply + Index in the collection + Array of indices + + + + Clip a string to a given length, starting at a particular offset, returning the clipped + string with ellipses representing the removed parts + + The string to be clipped + The maximum permitted length of the result string + The point at which to start clipping + The clipped string + + + + Clip the expected and actual strings in a coordinated fashion, + so that they may be displayed together. + + + + + + + + + Shows the position two strings start to differ. Comparison + starts at the start index. + + The expected string + The actual string + The index in the strings at which comparison should start + Boolean indicating whether case should be ignored + -1 if no mismatch found, or the index where mismatch found + + + + NaNConstraint tests that the actual value is a double or float NaN + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test that the actual value is an NaN + + + + + + + NoItemConstraint applies another constraint to each + item in a collection, failing if any of them succeeds. + + + + + Construct a SomeItemsConstraint on top of an existing constraint + + + + + + 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. + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + 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 + + + + NullConstraint tests that the actual value is null + + + + + Initializes a new instance of the class. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + 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. + + + + + Returns the default NUnitComparer. + + + + + Compares two objects + + + + + + + + NUnitEqualityComparer encapsulates NUnit's handling of + equality tests between objects. + + + + + If true, all string comparisons will ignore case + + + + + If true, arrays will be treated as collections, allowing + those of different dimensions to be compared + + + + + Comparison objects used in comparisons for some constraints. + + + + + List of points at which a failure occurred. + + + + + List of comparers used to compare pairs of objects. + + + + + Initializes a new instance of the class. + + + + + 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 the list of external comparers to be used to + test for equality. They are applied to members of + collections, in place of NUnit's own logic. + + + + + Gets the list of failure points for the last Match performed. + The list consists of objects to be interpreted by the caller. + This generally means that the caller may only make use of + objects it has placed on the list at a particular depth. + + + + + Flags the comparer to include + property in comparison of two values. + + + Using this modifier does not allow to use the + modifier. + + + + + Compares two objects for equality within a tolerance. + + + + + 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 + + + + + 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. + + + + + Operator that requires both its arguments to succeed + + + + + Construct an AndOperator + + + + + Apply the operator to produce an AndConstraint + + + + + 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. + + + + + 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. + + + + + + Gets the left precedence of the operator + + + + + Gets the right precedence of the operator + + + + + Abstract method that produces a constraint by applying + the operator to its left and right constraint arguments. + + + + + Abstract base for operators that indicate how to + apply a constraint to items in a collection. + + + + + Constructs a CollectionOperator + + + + + 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. + + + + + The syntax element preceding this operator + + + + + The syntax element following 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. + + + + + 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. + + + + + + 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 + + + + 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. + + + + + + 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. + + + + + Negates the test of the constraint it wraps. + + + + + Constructs a new NotOperator + + + + + Returns a NotConstraint applied to its argument. + + + + + Operator that requires at least one of its arguments to succeed + + + + + Construct an OrOperator + + + + + Apply the operator to produce an OrConstraint + + + + + PrefixOperator takes a single constraint and modifies + its 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. + + + + + + + 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. + + + + + Gets the name of the property to which the operator applies + + + + + 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. + + + + + + Abstract base class for operators that are able to reduce to a + constraint whether or not another syntactic element follows. + + + + + 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. + + + + + 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. + + + + + Represents a constraint that simply wraps the + constraint provided as an argument, without any + further functionality, but which modifies the + order of evaluation because of its precedence. + + + + + Constructor for the WithOperator + + + + + Returns a constraint that wraps its argument + + + + + OrConstraint succeeds if either member succeeds + + + + + Create an OrConstraint from two other constraints + + The first constraint + The second constraint + + + + Gets text describing a 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 + + + + PathConstraint serves as the abstract base of constraints + that operate on paths and provides several helper methods. + + + + + Construct a PathConstraint for a give expected path + + The expected path + + + + Modifies the current instance to be case-sensitive + and returns it. + + + + + Returns the string representation of this constraint + + + + + Canonicalize the provided path + + + The path in standardized form + + + + Test whether one path in canonical form is a subpath of another path + + The first path - supposed to be the parent path + The second path - supposed to be the child path + + + + + Predicate constraint wraps a Predicate in a constraint, + returning success if the predicate is true. + + + + + Construct a PredicateConstraint from a predicate + + + + + Gets text describing a constraint + + + + + Determines whether the predicate succeeds when applied + to the actual value. + + + + + Abstract base class used for prefixes + + + + + The base constraint + + + + + Prefix used in forming the constraint description + + + + + Construct given a base constraint + + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Formats a prefix constraint's description. + + + + + 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 + + + + Returns the string representation of the constraint. + + + + + Contains the result of matching a against an actual value. + + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The base result with actual value to which the Constraint was applied. + + + + Write the additional failure message for a failing constraint to a + MessageWriter. + + The writer on which the actual value is displayed + + + + 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 value + of the property. The two constraints are now separate. + + + + + Initializes a new instance of the class. + + The name of the property. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the property exists for a given object + + The object to be tested + True for success, false for failure + + + + Returns the string representation of the constraint. + + + + + + RangeConstraint tests whether two values are within a + specified range. + + + + + Initializes a new instance of the class. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use a and returns self. + + + + + 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 + + + + 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. + + + + + Appends an And Operator to the expression + + + + + Appends an Or operator to the expression. + + + + + Resolve the current expression to a Constraint + + + + + ReusableConstraint wraps a constraint expression after + resolving it so that it can be reused consistently. + + + + + Construct a ReusableConstraint from a constraint expression + + The expression to be resolved and reused + + + + Converts a constraint to a ReusableConstraint + + The constraint to be converted + A ReusableConstraint + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Return the top-level constraint for this expression + + + + + + SameAsConstraint tests whether an object is identical to + the object passed to its constructor + + + + + Initializes a new instance of the class. + + The expected object. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Summary description for SamePathConstraint. + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + SamePathOrUnderConstraint tests that one path is under another + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + 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 + + + + + + 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. + + + + + Apply the item constraint to each item in the collection, + succeeding if any item succeeds. + + + + + + + Flag the constraint to use the supplied object. + + The type of the elements in the collection. + The type of the member. + The comparison function to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + 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. + + + + + + + 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 + + + + + Description of this constraint + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Constructs a StringConstraint without an expected value + + + + + Constructs a StringConstraint given an expected value + + The expected value + + + + Modify the constraint to ignore case in matching. + + + + + 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 a given string + + The string to be tested + True for success, false for failure + + + + SubPathConstraint tests that the actual path is under the expected path + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + SubstringConstraint can test whether a string contains + the expected substring. + + + + + Initializes a new instance of the class. + + The expected. + + + + Modify the constraint to ignore case in matching. + This will call Using(StringComparison.CurrentCultureIgnoreCase). + + Thrown when a comparison type different + than was already set. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Modify the constraint to the specified comparison. + + Thrown when a comparison type different + than was already set. + + + + 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. + + + + Get the actual exception thrown - used by Assert.Throws. + + + + + Gets text describing a constraint + + + + + 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 actual value for a failing constraint test to a + MessageWriter. This override only handles the special message + used when an exception is expected but none is thrown. + + The writer on which the actual value is displayed + + + + ThrowsExceptionConstraint tests that an exception has + been thrown, without any further tests. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Executes the code and returns success if an exception is thrown. + + A delegate representing the code to be tested + True if an exception is thrown, otherwise false + + + + Applies the constraint to 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. + + + + + ThrowsNothingConstraint tests that a delegate does not + throw an exception. + + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True if no exception is thrown, otherwise false + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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. + + + + + Returns a default Tolerance object, equivalent to an exact match. + + + + + Returns an empty Tolerance object, equivalent to an exact match. + + + + + Constructs a linear tolerance of a specified amount + + + + + Constructs a tolerance given an amount and + + + + + 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 as the amount, using + the current amount as a number of days. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of hours. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of minutes. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of seconds. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of milliseconds. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of clock ticks. + + + + + Gets the for the current Tolerance + + + + + Gets the magnitude of the current Tolerance instance. + + + + + Returns true if the current tolerance has not been set or is using the . + + + + + Apply the tolerance to an expected value and return + a Tolerance.Range that represents the acceptable values. + + + + + Tests that the current Tolerance is linear with a + numeric value, throwing an exception if it is not. + + + + + Tolerance.Range represents the range of values that match + a specific tolerance, when applied to a specific value. + + + + + The lower bound of the range + + + + + The upper bound of the range + + + + + Constructs a range + + + + + 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. + + + + + TrueConstraint tests that the actual value is true + + + + + Initializes a new instance of the class. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + TypeConstraint is the abstract base for constraints + that take a Type as their expected value. + + + + + The expected Type used by the constraint + + + + + The type of the actual argument to which the constraint was applied + + + + + Construct a TypeConstraint for a given Type + + The expected type for the constraint + Prefix used in forming the constraint description + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + UniqueItemsConstraint tests whether all the items in a + collection are unique. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Check that all items are unique. + + + + + + + XmlSerializableConstraint tests whether + an object is serializable in XML format. + + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Returns the string representation of this constraint + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the dictionary. + + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the dictionary. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Asserts on Directories + + + + + DO NOT USE! Use DirectoryAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both point to the same directory. + 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 the 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 point to the same directory. + If they are not 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 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 + + + + Asserts that the directory exists. If it does not exist + an is thrown. + + 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 the directory exists. If it does not exist + an is thrown. + + A directory containing the actual value + + + + Asserts that the directory exists. If it does not exist + an is thrown. + + The path to 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 the directory exists. If it does not exist + an is thrown. + + The path to a directory containing the actual value + + + + Asserts that the directory does not exist. If it does exist + an is thrown. + + 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 the directory does not exist. If it does exist + an is thrown. + + A directory containing the actual value + + + + Asserts that the directory does not exist. If it does exist + an is thrown. + + The path to 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 the directory does not exist. If it does exist + an is thrown. + + The path to a directory containing the actual value + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a constraint that succeeds if the value + is a file or directory and it exists. + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new . 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 new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the Dictionary key collection. + + The key to be matched in the Dictionary key collection + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the Dictionary value collection. + + The value to be matched in the Dictionary value collection + + + + 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 regular expression supplied as an argument. + + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the ResultState provided by this exception + + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + Default Constructor + + + + + Construct based on the TestResult so far. This is the constructor + used normally, when exiting the multiple assert block with failures. + Not used internally but provided to facilitate debugging. + + + The current result, up to this point. The result is not used + internally by NUnit but is provided to facilitate debugging. + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the provided by this exception. + + + + + Gets the of this test at the point the exception was thrown, + + + + + Abstract base for Exceptions that terminate a test and provide a ResultState. + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the ResultState provided by this exception + + + + + Contains extension methods that do not require a special using directive. + + + + + Asserts on Files + + + + + DO NOT USE! Use FileAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Asserts that the file exists. If it does not exist + an is thrown. + + 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 the file exists. If it does not exist + an is thrown. + + A file containing the actual value + + + + Asserts that the file exists. If it does not exist + an is thrown. + + 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 the file exists. If it does not exist + an is thrown. + + The path to a file containing the actual value + + + + Asserts that the file does not exist. If it does exist + an is thrown. + + 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 the file does not exist. If it does exist + an is thrown. + + A file containing the actual value + + + + Asserts that the file does not exist. If it does exist + an is thrown. + + 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 the file does not exist. If it does exist + an is thrown. + + The path to a file containing the actual value + + + + Class used to guard against unexpected argument values + or operations by throwing an appropriate exception. + + + + + Throws an exception if an argument is null + + The value to be tested + The name of the argument + + + + Throws an exception if a string argument is null or empty + + The value to be tested + The name of the argument + + + + Throws an ArgumentOutOfRangeException if the specified condition is not met. + + The condition that must be met + The exception message to be used + The name of the argument + + + + Throws an ArgumentException if the specified condition is not met. + + The condition that must be met + The exception message to be used + The name of the argument + + + + Throws an InvalidOperationException if the specified condition is not met. + + The condition that must be met + The exception message to be used + + + + Throws an if the specified delegate is async void. + + + + + Throws an if the specified delegate is async void. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + 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 ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a which will apply + the following constraint to only one member of the collection, + and fail if none or more than one match occurs. + + + + + 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 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 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 checking for the + presence of a particular object in the collection. + + + + + The AssertionResult class represents the result of a single assertion. + + + + + Construct an AssertionResult + + + + The pass/fail status of the assertion + + + The message produced by the assertion, or null + + + The stack trace associated with the assertion, or null + + + + ToString Override + + + + + Override GetHashCode + + + + + Override Equals + + + + + + AssertionStatus enumeration represents the possible outcomes of an assertion. + The order of definition is significant, higher level values override lower + ones in determining the overall result of a test. + + + + + An assumption failed + + + + + The assertion succeeded + + + + + A warning message was issued + + + + + The assertion failed + + + + + An unexpected exception was thrown + + + + + The IApplyToContext interface is implemented by attributes + that want to make changes to the execution context before + a test is run. + + + + + Apply changes to the execution context + + The execution context + + + + The IApplyToTest interface is implemented by self-applying + attributes that modify the state of a test in some way. + + + + + Modifies a test as defined for the specific attribute. + + The test to modify + + + + CombiningStrategy is the abstract base for classes that + know how to combine values provided for individual test + parameters to create a set of test cases. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + ICommandWrapper is implemented by attributes and other + objects able to wrap a TestCommand with another command. + + + Attributes or other objects should implement one of the + derived interfaces, rather than this one, since they + indicate in which part of the command chain the wrapper + should be applied. + + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + Objects implementing this interface are used to wrap + the TestMethodCommand itself. They apply after SetUp + has been run and before TearDown. + + + + + Objects implementing this interface are used to wrap + the entire test, including SetUp and TearDown. + + + + + Objects implementing this interface are used to wrap + tests that can repeat. The implementing command is run once, + invoking the chained commands any number of times. + + + + + Any ITest that implements this interface is at a level that the implementing + class should be disposed at the end of the test run + + + + + The IFixtureBuilder interface is exposed by a class that knows how to + build test fixtures from a specified type. In general, it is exposed + by an attribute, but it may be implemented in a helper class used by the + attribute in some cases. + + + + + Builds any number of test fixtures from the specified type. + + The type info of the fixture to be used. + + + + The IFixtureBuilder2 interface extends IFixtureBuilder by allowing + use of a PreFilter, which is used to select methods as test cases. + + + + + Builds any number of test fixtures from the specified type. + + The type info of the fixture to be used. + PreFilter to be used to select methods. + + + + IImplyFixture is an empty marker interface used by attributes like + TestAttribute that cause the class where they are used to be treated + as a TestFixture even without a TestFixtureAttribute. + + Marker interfaces are not usually considered a good practice, but + we use it here to avoid cluttering the attribute hierarchy with + classes that don't contain any extra implementation. + + + + + The IMethodInfo class is used to encapsulate information + about a method in a platform-independent manner. + + + + + Gets the Type from which this method was reflected. + + + + + Gets the MethodInfo for this method. + + + + + Gets the name of the method. + + + + + Gets a value indicating whether the method is abstract. + + + + + Gets a value indicating whether the method is public. + + + + + Gets a value indicating whether the method contains unassigned generic type parameters. + + + + + Gets a value indicating whether the method is a generic method. + + + + + Gets a value indicating whether the MethodInfo represents the definition of a generic method. + + + + + Gets the return Type of the method. + + + + + Gets the parameters of the method. + + + + + + Returns the Type arguments of a generic method or the Type parameters of a generic method definition. + + + + + Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo. + + The type arguments to be used + A new IMethodInfo with the type arguments replaced + + + + Invokes the method, converting any TargetInvocationException to an NUnitException. + + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + Provides data for a single test parameter. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test. + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + Provides data for a single test parameter. + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + The IParameterInfo interface is an abstraction of a .NET parameter. + + + + + Gets a value indicating whether the parameter is optional + + + + + Gets an IMethodInfo representing the method for which this is a parameter + + + + + Gets the underlying .NET ParameterInfo + + + + + Gets the Type of the parameter + + + + + Implemented by filters for use in deciding which + Types and Methods should be used to generate tests. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + A PropertyBag represents a collection of name/value pairs + that allows duplicate entries with the same key. Methods + are provided for adding a new pair as well as for setting + a key to a single value. All keys are strings but values + may be of any type. Null values are not permitted, since + a null entry represents the absence of the key. + + The entries in a PropertyBag are of two kinds: those that + take a single value and those that take multiple values. + However, the PropertyBag has no knowledge of which entries + fall into each category and the distinction is entirely + up to the code using the PropertyBag. + + When working with multi-valued properties, client code + should use the Add method to add name/value pairs and + indexing to retrieve a list of all values for a given + key. For example: + + bag.Add("Tag", "one"); + bag.Add("Tag", "two"); + Assert.That(bag["Tag"], + Is.EqualTo(new string[] { "one", "two" })); + + When working with single-valued properties, client code + should use the Set method to set the value and Get to + retrieve the value. The GetSetting methods may also be + used to retrieve the value in a type-safe manner while + also providing default. For example: + + bag.Set("Priority", "low"); + bag.Set("Priority", "high"); // replaces value + Assert.That(bag.Get("Priority"), + Is.EqualTo("high")); + Assert.That(bag.GetSetting("Priority", "low"), + Is.EqualTo("high")); + + + + + Adds a key/value pair to the property bag + + The key + The value + + + + Sets the value for a key, removing any other + values that are already in the property set. + + + + + + + Gets a single value for a key, using the first + one if multiple values are present and returning + null if the value is not found. + + + + + Gets a flag indicating whether the specified key has + any entries in the property set. + + The key to be checked + True if their are values present, otherwise false + + + + Gets or sets the list of values for a particular key + + The key for which the values are to be retrieved or set + + + + Gets a collection containing all the keys in the property set + + + + + The IReflectionInfo interface is implemented by NUnit wrapper objects that perform reflection. + + + + + Returns an array of custom attributes of the specified type applied to this object + + + + + Returns a value indicating whether an attribute of the specified type is defined on this object. + + + + + The ISimpleTestBuilder interface is exposed by a class that knows how to + build a single tests from a specified method. In general, + it is exposed by an attribute, but it may be implemented in a helper class + used by the attribute in some cases. + + + + + Builds a single test from the specified method and context. + + The method to be used as a test + The TestSuite to which the method will be added + + + + The ISuiteBuilder interface is exposed by a class that knows how to + build a single test suite from a specified type. + + + + + Examine the type and determine if it is suitable for + this builder to use in building a TestSuite. + + Note that returning false will cause the type to be ignored + in loading the tests. If it is desired to load the suite + but label it as non-runnable, ignored, etc., then this + method must return true. + + The type of the fixture to be used + + + + Builds a single test suite from the specified type. + + The type of the fixture to be used + + + + Builds a single test suite from the specified type, subject + to a filter that decides which methods are included. + + The type of the fixture to be used + A PreFilter for selecting methods. + + + + Common interface supported by all representations + of a test. Only includes informational fields. + The Run method is specifically excluded to allow + for data-only representations of a test. + + + + + Gets the id of the test + + + + + Gets the name of the test + + + + + Gets the type of the test + + + + + Gets the fully qualified name of the test + + + + + Gets the name of the class containing this test. Returns + null if the test is not associated with a class. + + + + + Gets the name of the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + Gets the Type of the test fixture, if applicable, or + null if no fixture type is associated with this test. + + + + + Gets the method which declares the test, or + if no method is associated with this test. + + + + + Gets the RunState of the test, indicating whether it can be run. + + + + + Count of the test cases ( 1 if this is a test case ) + + + + + Gets the properties of the test + + + + + Gets the parent test, if any. + + The parent test or null if none exists. + + + + Returns true if this is a test suite + + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets this test's child tests + + A list of child tests + + + + Gets a fixture object for running this test. + + + + + The arguments to use in creating the test or empty array if none are required. + + + + + The ITestBuilder interface is exposed by a class that knows how to + build tests from a specified method. In general, it is exposed + by an attribute which has additional information available to provide + the necessary test parameters to distinguish the test cases built. + + + + + Builds any number of tests from the specified method and context. + + The method to be used as a test + The TestSuite to which the method will be added + + + + The ITestCaseBuilder interface is exposed by a class that knows how to + build a test from a specified method, possibly containing child test cases. + + + + + Examine the method and determine if it is suitable for + this builder to use in building a TestCase to be + included in the suite being populated. + + Note that returning false will cause the method to be ignored + in loading the tests. If it is desired to load the method + but label it as non-runnable, ignored, etc., then this + method must return true. + + The test method to examine + The suite being populated + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method to be used as a test case + The test suite being populated, or null + + + + The ITestCaseData interface is implemented by a class + that is able to return complete test cases for use by + a parameterized test method. + + + + + Gets the expected result of the test case + + + + + Returns true if an expected result has been set + + + + + The ITestData interface is implemented by a class that + represents a single instance of a parameterized test. + + + + + Gets the name to be used for the test + + + + + Gets the RunState for this test case. + + + + + Gets the argument list to be provided to the test + + + + + Gets the property dictionary for the test case + + + + + Interface to be implemented by filters applied to tests. + The filter applies when running the test, after it has been + loaded, since this is the only time an ITest exists. + + + + + Determine if a particular test passes the filter criteria. Pass + may examine the parents and/or descendants of a test, depending + on the semantics of the particular filter + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + The ITestCaseData interface is implemented by a class + that is able to return the data required to create an + instance of a parameterized test fixture. + + + + + Get the TypeArgs if separately set + + + + + The ITestListener interface is used internally to receive + notifications of significant events while a test is being + run. The events are propagated to clients by means of an + AsyncCallback. NUnit extensions may also monitor these events. + + + + + Called when a test has just started + + The test that is starting + + + + Called when a test has finished + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + The ITestResult interface represents the result of a test. + + + + + Gets the ResultState of the test result, which + indicates the success or failure of the test. + + + + + Gets the name of the test result + + + + + Gets the full name of the test result + + + + + Gets the elapsed time for running the test in seconds + + + + + Gets or sets the time the test started running. + + + + + Gets or sets the time the test finished running. + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + Gets the number of asserts executed + when running the test and all its children. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + Accessing HasChildren should not force creation of the + Children collection in classes implementing this interface. + + + + + Gets the collection of child results. + + + + + Gets the Test to which this result applies. + + + + + Gets any text output written to this result. + + + + + Gets a list of AssertionResults associated with the test + + + + + Gets the collection of files attached to the test + + + + + The ITypeInfo interface is an abstraction of a .NET Type + + + + + Gets the underlying Type on which this ITypeInfo is based + + + + + Gets the base type of this type as an ITypeInfo + + + + + Returns true if the Type wrapped is equal to the argument + + + + + Gets the name of the Type + + + + + Gets the full name of the Type + + + + + Gets the assembly in which the type is declared + + + + + Gets the namespace of the Type + + + + + Gets a value indicating whether the type is abstract. + + + + + Gets a value indicating whether the Type is a generic Type + + + + + Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types. + + + + + Gets a value indicating whether the Type is a generic Type definition + + + + + Gets a value indicating whether the type is sealed. + + + + + Gets a value indicating whether this type is a static class. + + + + + Get the display name for this typeInfo. + + + + + Get the display name for an object of this type, constructed with specific arguments + + + + + Returns a Type representing a generic type definition from which this Type can be constructed. + + + + + Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments + + + + + Returns a value indicating whether this type has a method with a specified public attribute + + + + + Returns an array of IMethodInfos for methods of this Type + that match the specified flags. + + + + + Gets the public constructor taking the specified argument Types + + + + + Returns a value indicating whether this Type has a public constructor taking the specified argument Types. + + + + + Construct an object of this Type, using the specified arguments. + + + + + An object implementing IXmlNodeBuilder is able to build + an XML representation of itself and any children. + + + + + Returns a TNode representing the current object. + + If true, children are included where applicable + A TNode representing the result + + + + Returns a TNode representing the current object after + adding it as a child of the supplied parent node. + + The parent node. + If true, children are included, where applicable + + + + + The ResultState class represents the outcome of running a test. + It contains two pieces of information. The Status of the test + is an enum indicating whether the test passed, failed, was + skipped or was inconclusive. The Label provides a more + detailed breakdown for use by client runners. + + + + + Initializes a new instance of the class. + + The TestStatus. + + + + Initializes a new instance of the class. + + The TestStatus. + The label. + + + + Initializes a new instance of the class. + + The TestStatus. + The stage at which the result was produced + + + + Initializes a new instance of the class. + + The TestStatus. + The label. + The stage at which the result was produced + + + + The result is inconclusive + + + + + The test has been skipped. + + + + + The test has been ignored. + + + + + The test was skipped because it is explicit + + + + + The test succeeded + + + + + The test issued a warning + + + + + The test failed + + + + + The test encountered an unexpected exception + + + + + The test was cancelled by the user + + + + + The test was not runnable. + + + + + A suite failed because one or more child tests failed or had errors + + + + + A suite failed because one or more child tests had warnings + + + + + A suite is marked ignored because one or more child tests were ignored + + + + + A suite failed in its OneTimeSetUp + + + + + A suite had an unexpected exception in its OneTimeSetUp + + + + + A suite had an unexpected exception in its OneTimeDown + + + + + Gets the TestStatus for the test. + + The status. + + + + Gets the label under which this test result is + categorized, if any. + + + + + Gets the stage of test execution in which + the failure or other result took place. + + + + + Get a new ResultState, which is the same as the current + one but with the FailureSite set to the specified value. + + The FailureSite to use + A new ResultState + + + + Test whether this ResultState has the same Status and Label + as another one. In other words, the whether two are equal + ignoring the Site. + + + + + + + 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. + + + + + Overload == operator for ResultStates + + + + + Overload != operator for ResultStates + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + The FailureSite enum indicates the stage of a test + in which an error or failure occurred. + + + + + Failure in the test itself + + + + + Failure in the SetUp method + + + + + Failure in the TearDown method + + + + + Failure of a parent test + + + + + Failure of a child test + + + + + The RunState enum indicates whether a test can be executed. + + + + + The test is not runnable. + + + + + The test is runnable. + + + + + The test can only be run explicitly + + + + + The test has been skipped. This value may + appear on a Test when certain attributes + are used to skip the test. + + + + + The test has been ignored. May appear on + a Test, when the IgnoreAttribute is used. + + + + + The TestAttachment class represents a file attached to a TestResult, + with an optional description. + + + + + Absolute file path to attachment file + + + + + User specifed description of attachment. May be null. + + + + + Creates a TestAttachment class to represent a file attached to a test result. + + Absolute file path to attachment file + User specifed description of attachment. May be null. + + + + The class holds a message sent by a test to all listeners + + + + + Construct with text, destination type and + the name of the test that produced the message. + + Destination of the message + Text to be sent + ID of the test that produced the message + + + + Converts object to string + + + + + The message to send to listeners + + + + + The Destination of the message. + + + + + The ID of the test that sent the message + + + + + Returns the XML representation of the object. + + + + + The TestOutput class holds a unit of output from + a test to a specific output stream + + + + + Construct with text, output destination type and + the name of the test that produced the output. + + Text to be output + Name of the stream or channel to which the text should be written + Id of the test that produced the output + FullName of test that produced the output + + + + Return string representation of the object for debugging + + + + + + Get the text + + + + + Get the output type + + + + + Get the name of the test that created the output + + + + + Get the id of the test that created the output + + + + + Convert the TestOutput object to an XML string + + + + + The TestStatus enum indicates the result of running a test + + + + + The test was inconclusive + + + + + The test has skipped + + + + + The test succeeded + + + + + There was a warning + + + + + The test failed + + + + + TNode represents a single node in the XML representation + of a Test or TestResult. It replaces System.Xml.XmlNode and + System.Xml.Linq.XElement, providing a minimal set of methods + for operating on the XML in a platform-independent manner. + + + + + Constructs a new instance of TNode + + The name of the node + + + + Constructs a new instance of TNode with a value + + The name of the node + The text content of the node + + + + Constructs a new instance of TNode with a value + + The name of the node + The text content of the node + Flag indicating whether to use CDATA when writing the text + + + + Gets the name of the node + + + + + Gets the value of the node + + + + + Gets a flag indicating whether the value should be output using CDATA. + + + + + Gets the dictionary of attributes + + + + + Gets a list of child nodes + + + + + Gets the first ChildNode + + + + + Gets the XML representation of this node. + + + + + Create a TNode from its XML text representation + + The XML text to be parsed + A TNode + + + + Adds a new element as a child of the current node and returns it. + + The element name. + The newly created child element + + + + Adds a new element with a value as a child of the current node and returns it. + + The element name + The text content of the new element + The newly created child element + + + + Adds a new element with a value as a child of the current node and returns it. + The value will be output using a CDATA section. + + The element name + The text content of the new element + The newly created child element + + + + Adds an attribute with a specified name and value to the XmlNode. + + The name of the attribute. + The value of the attribute. + + + + Finds a single descendant of this node matching an XPath + specification. The format of the specification is + limited to what is needed by NUnit and its tests. + + + + + + + Finds all descendants of this node matching an XPath + specification. The format of the specification is + limited to what is needed by NUnit and its tests. + + + + + Writes the XML representation of the node to an XmlWriter + + + + + + Class used to represent a list of XmlResults + + + + + Class used to represent the attributes of a node + + + + + Gets or sets the value associated with the specified key. + Overridden to return null if attribute is not found. + + The key. + Value of the attribute or null + + + + AssemblyHelper provides static methods for working + with assemblies. + + + + + Gets the path from which an assembly was loaded. + For builds where this is not possible, returns + the name of the assembly. + + The assembly. + The path. + + + + Gets the path to the directory from which an assembly was loaded. + + The assembly. + The path. + + + + Gets the AssemblyName of an assembly. + + The assembly + An AssemblyName + + + + Loads an assembly given a string, which may be the + path to the assembly or the AssemblyName + + + + + Gets the assembly path from code base. + + Public for testing purposes + The code base. + + + + + CombinatorialStrategy creates test cases by using all possible + combinations of the parameter data. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + Provides data from fields marked with the DatapointAttribute or the + DatapointsAttribute. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + Built-in SuiteBuilder for all types of test classes. + + + + + Examine the type and determine if it is suitable for + this builder to use in building a TestSuite. + + Note that returning false will cause the type to be ignored + in loading the tests. If it is desired to load the suite + but label it as non-runnable, ignored, etc., then this + method must return true. + + The fixture type to check + + + + Builds a single test suite from the specified type. + + The fixture type to build + + + + Builds a single test suite from the specified type, subject + to a filter that decides which methods are included. + + The fixture type to build + A PreFilter for selecting methods. + + + + We look for attributes implementing IFixtureBuilder at one level + of inheritance at a time. Attributes on base classes are not used + unless there are no fixture builder attributes at all on the derived + class. This is by design. + + The type being examined for attributes + + + + Class to build ether a parameterized or a normal NUnitTestMethod. + There are four cases that the builder must deal with: + 1. The method needs no params and none are provided + 2. The method needs params and they are provided + 3. The method needs no params but they are provided in error + 4. The method needs params but they are not provided + This could have been done using two different builders, but it + turned out to be simpler to have just one. The BuildFrom method + takes a different branch depending on whether any parameters are + provided, but all four cases are dealt with in lower-level methods + + + + + Determines if the method can be used to build an NUnit test + test method of some kind. The method must normally be marked + with an identifying attribute for this to be true. + + Note that this method does not check that the signature + of the method for validity. If we did that here, any + test methods with invalid signatures would be passed + over in silence in the test run. Since we want such + methods to be reported, the check for validity is made + in BuildFrom rather than here. + + An IMethodInfo for the method being used as a test method + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method for which a test is to be built + + + + Determines if the method can be used to build an NUnit test + test method of some kind. The method must normally be marked + with an identifying attribute for this to be true. + + Note that this method does not check that the signature + of the method for validity. If we did that here, any + test methods with invalid signatures would be passed + over in silence in the test run. Since we want such + methods to be reported, the check for validity is made + in BuildFrom rather than here. + + An IMethodInfo for the method being used as a test method + The test suite being built, to which the new test would be added + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method for which a test is to be built + The test fixture being populated, or null + + + + Builds a ParameterizedMethodSuite containing individual test cases. + + The method for which a test is to be built. + The list of test cases to include. + + + + Build a simple, non-parameterized TestMethod for this method. + + The MethodInfo for which a test is to be built + The test suite for which the method is being built + + + + Class that can build a tree of automatic namespace + suites from a group of fixtures. + + + + + NamespaceDictionary of all test suites we have created to represent + namespaces. Used to locate namespace parent suites for fixtures. + + + + + Point in the tree where items in the global namespace are added + + + + + Initializes a new instance of the class. + + The root suite. + + + + Gets the root entry in the tree created by the NamespaceTreeBuilder. + + The root suite. + + + + Adds the specified fixtures to the tree. + + The fixtures to be added. + + + + Adds the specified fixture to the tree. + + The fixture to be added. + + + + NUnitTestCaseBuilder is a utility class used by attributes + that build test cases. + + + + + Constructs an + + + + + Builds a single NUnitTestMethod, either as a child of the fixture + or as one of a set of test cases under a ParameterizedTestMethodSuite. + + The MethodInfo from which to construct the TestMethod + The suite or fixture to which the new test will be added + The ParameterSet to be used, or null + + + + Checks to see if we have valid combinations of attributes. + + The TestMethod to be checked. If it + is found to be non-runnable, it will be modified. + True if the method signature is valid, false if not + + + + Helper method that checks the signature of a TestMethod and + any supplied parameters to determine if the test is valid. + + Currently, NUnitTestMethods are required to be public, + non-abstract methods, either static or instance, + returning void. They may take arguments but the values must + be provided or the TestMethod is not considered runnable. + + Methods not meeting these criteria will be marked as + non-runnable and the method will return false in that case. + + The TestMethod to be checked. If it + is found to be non-runnable, it will be modified. + Parameters to be used for this test, or null + True if the method signature is valid, false if not + + The return value is no longer used internally, but is retained + for testing purposes. + + + + + NUnitTestFixtureBuilder is able to build a fixture given + a class marked with a TestFixtureAttribute or an unmarked + class containing test methods. In the first case, it is + called by the attribute and in the second directly by + NUnitSuiteBuilder. + + + + + Build a TestFixture from type provided. A non-null TestSuite + must always be returned, since the method is generally called + because the user has marked the target class as a fixture. + If something prevents the fixture from being used, it should + be returned nonetheless, labelled as non-runnable. + + An ITypeInfo for the fixture to be used. + Filter used to select methods as tests. + A TestSuite object or one derived from TestSuite. + + + + Overload of BuildFrom called by tests that have arguments. + Builds a fixture using the provided type and information + in the ITestFixtureData object. + + The TypeInfo for which to construct a fixture. + Filter used to select methods as tests. + An object implementing ITestFixtureData or null. + + + + + Method to add test cases to the newly constructed fixture. + + + + + Method to create a test case from a MethodInfo and add + it to the fixture being built. It first checks to see if + any global TestCaseBuilder addin wants to build the + test case. If not, it uses the internal builder + collection maintained by this fixture builder. + + The default implementation has no test case builders. + Derived classes should add builders to the collection + in their constructor. + + The method for which a test is to be created + The test suite being built. + A newly constructed Test + + + + PairwiseStrategy creates test cases by combining the parameter + data so that all possible pairs of data items are used. + + + + The number of test cases that cover all possible pairs of test function + parameters values is significantly less than the number of test cases + that cover all possible combination of test function parameters values. + And because different studies show that most of software failures are + caused by combination of no more than two parameters, pairwise testing + can be an effective ways to test the system when it's impossible to test + all combinations of parameters. + + + The PairwiseStrategy code is based on "jenny" tool by Bob Jenkins: + http://burtleburtle.net/bob/math/jenny.html + + + + + + FleaRand is a pseudo-random number generator developed by Bob Jenkins: + http://burtleburtle.net/bob/rand/talksmall.html#flea + + + + + Initializes a new instance of the FleaRand class. + + The seed. + + + + FeatureInfo represents coverage of a single value of test function + parameter, represented as a pair of indices, Dimension and Feature. In + terms of unit testing, Dimension is the index of the test parameter and + Feature is the index of the supplied value in that parameter's list of + sources. + + + + + Initializes a new instance of FeatureInfo class. + + Index of a dimension. + Index of a feature. + + + + A FeatureTuple represents a combination of features, one per test + parameter, which should be covered by a test case. In the + PairwiseStrategy, we are only trying to cover pairs of features, so the + tuples actually may contain only single feature or pair of features, but + the algorithm itself works with triplets, quadruples and so on. + + + + + Initializes a new instance of FeatureTuple class for a single feature. + + Single feature. + + + + Initializes a new instance of FeatureTuple class for a pair of features. + + First feature. + Second feature. + + + + TestCase represents a single test case covering a list of features. + + + + + Initializes a new instance of TestCaseInfo class. + + A number of features in the test case. + + + + PairwiseTestCaseGenerator class implements an algorithm which generates + a set of test cases which covers all pairs of possible values of test + function. + + + + The algorithm starts with creating a set of all feature tuples which we + will try to cover (see method). This set + includes every single feature and all possible pairs of features. We + store feature tuples in the 3-D collection (where axes are "dimension", + "feature", and "all combinations which includes this feature"), and for + every two feature (e.g. "A" and "B") we generate both ("A", "B") and + ("B", "A") pairs. This data structure extremely reduces the amount of + time needed to calculate coverage for a single test case (this + calculation is the most time-consuming part of the algorithm). + + + Then the algorithm picks one tuple from the uncovered tuple, creates a + test case that covers this tuple, and then removes this tuple and all + other tuples covered by this test case from the collection of uncovered + tuples. + + + Picking a tuple to cover + + + There are no any special rules defined for picking tuples to cover. We + just pick them one by one, in the order they were generated. + + + Test generation + + + Test generation starts from creating a completely random test case which + covers, nevertheless, previously selected tuple. Then the algorithm + tries to maximize number of tuples which this test covers. + + + Test generation and maximization process repeats seven times for every + selected tuple and then the algorithm picks the best test case ("seven" + is a magic number which provides good results in acceptable time). + + Maximizing test coverage + + To maximize tests coverage, the algorithm walks through the list of mutable + dimensions (mutable dimension is a dimension that are not included in + the previously selected tuple). Then for every dimension, the algorithm + walks through the list of features and checks if this feature provides + better coverage than randomly selected feature, and if yes keeps this + feature. + + + This process repeats while it shows progress. If the last iteration + doesn't improve coverage, the process ends. + + + In addition, for better results, before start every iteration, the + algorithm "scrambles" dimensions - so for every iteration dimension + probes in a different order. + + + + + + Creates a set of test cases for specified dimensions. + + + An array which contains information about dimensions. Each element of + this array represents a number of features in the specific dimension. + + + A set of test cases. + + + + + Gets the test cases generated by this strategy instance. + + A set of test cases. + + + + The ParameterDataProvider class implements IParameterDataProvider + and hosts one or more individual providers. + + + + + Construct with a collection of individual providers + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + ParameterDataSourceProvider supplies individual argument values for + single parameters using attributes implementing IParameterDataSource. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + SequentialStrategy creates test cases by using all of the + parameter data sources in parallel, substituting null + when any of them run out of data. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + TestActionAfterCommand handles the AfterTest method of a single + TestActionItem, provided the items BeforeTest has been run. + + + + + Initializes a new instance of the class. + + The inner command. + The TestActionItem to run before the inner command. + + + + AfterCommand is a DelegatingTestCommand that performs some + specific action after the inner command is run. + + + + + Construct an AfterCommand + + + + + Execute the command + + + + + Set this to perform action after the inner command. + + + + + ContextSettingsCommand applies specified changes to the + TestExecutionContext prior to running a test. No special + action is needed after the test runs, since the prior + context will be restored automatically. + + + + + TestActionCommand handles a single ITestAction applied + to a test. It runs the BeforeTest method, then runs the + test and finally runs the AfterTest method. + + + + + Initializes a new instance of the class. + + The inner command. + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Perform the before test action + + + + + Perform the after test action + + + + + TestActionBeforeCommand handles the BeforeTest method of a single + TestActionItem, relying on the item to remember it has been run. + + + + + Initializes a new instance of the class. + + The inner command. + The TestActionItem to run before the inner command. + + + + BeforeTestCommand is a DelegatingTestCommand that performs some + specific action before the inner command is run. + + + + + Construct a BeforeCommand + + + + + Execute the command + + + + + Action to perform before the inner command. + + + + + ConstructFixtureCommand constructs the user test object if necessary. + + + + + Constructs a OneTimeSetUpCommand for a suite + + The inner command to which the command applies + + + + DelegatingTestCommand wraps an inner TestCommand. + Derived classes may do what they like before or + after running the inner command. + + + + TODO: Documentation needed for field + + + + TODO: Documentation needed for constructor + + + + + + OneTimeTearDownCommand performs any teardown actions + specified for a suite and calls Dispose on the user + test object, if any. + + + + + Construct a OneTimeTearDownCommand + + The command wrapped by this command + + + + EmptyTestCommand is a TestCommand that does nothing. It simply + returns the current result from the context when executed. We + use it to avoid testing for null when executing a chain of + DelegatingTestCommands. + + + + + Construct a NullCommand for a test + + + + + Execute the command + + + + + TODO: Documentation needed for class + + + + + Initializes a new instance of the class. + + The inner command. + The max time allowed in milliseconds + + + + OneTimeSetUpCommand runs any one-time setup methods for a suite, + constructing the user test object if necessary. + + + + + Constructs a OneTimeSetUpCommand for a suite + + The inner command to which the command applies + A SetUpTearDownList for use by the command + + + + OneTimeTearDownCommand performs any teardown actions + specified for a suite and calls Dispose on the user + test object, if any. + + + + + Construct a OneTimeTearDownCommand + + The command wrapped by this command + A SetUpTearDownList for use by the command + + + + SetUpTearDownCommand runs SetUp methods for a suite, + runs the test and then runs TearDown methods. + + + + + Initializes a new instance of the class. + + The inner command. + List of setup/teardown items + + + + SetUpTearDownItem holds the setup and teardown methods + for a single level of the inheritance hierarchy. + + + + + Construct a SetUpTearDownNode + + A list of setup methods for this level + A list teardown methods for this level + + + + Returns true if this level has any methods at all. + This flag is used to discard levels that do nothing. + + + + + Run SetUp on this level. + + The execution context to use for running. + + + + Run TearDown for this level. + + + + + + TODO: Documentation needed for class + + + + + Initializes a new instance of the class. + + The test being skipped. + + + + Overridden to simply set the CurrentResult to the + appropriate Skipped state. + + The execution context for the test + A TestResult + + + + TestActionCommand handles a single ITestAction applied + to a test. It runs the BeforeTest method, then runs the + test and finally runs the AfterTest method. + + + + + Initializes a new instance of the class. + + The inner command. + The TestAction with which to wrap the inner command. + + + + TestActionItem wraps a single execution of an ITestAction. + Its primary purpose is to track whether the BeforeTest + method has been called and suppress calling the + AfterTest method if it has not. This is necessary when + ITestActions are used before and after a CompositeWorkItem, + since the OneTimeSetUpCommand and OneTimeTearDownCommand + are separate command chains. By sharing a TestActionItem + between the setup and teardown chains, the two calls can + be coordinated. + + + + + Construct a TestActionItem + + The ITestAction to be included + + + + Get flag indicating if the BeforeTest entry was already called. + + + + + Run the BeforeTest method of the action and remember that it has been run. + + The test to which the action applies + + + + Run the AfterTest action, but only if the BeforeTest + action was actually run. + + The test to which the action applies + + + + TestCommand is the abstract base class for all test commands + in the framework. A TestCommand represents a single stage in + the execution of a test, e.g.: SetUp/TearDown, checking for + Timeout, verifying the returned result from a method, etc. + + TestCommands may decorate other test commands so that the + execution of a lower-level command is nested within that + of a higher level command. All nested commands are executed + synchronously, as a single unit. Scheduling test execution + on separate threads is handled at a higher level, using the + task dispatcher. + + + + + Construct a TestCommand for a test. + + The test to be executed + + + + Gets the test associated with this command. + + + + + Runs the test in a specified context, returning a TestResult. + + The TestExecutionContext to be used for running the test. + A TestResult + + + + TestMethodCommand is the lowest level concrete command + used to run actual test cases. + + + + + Initializes a new instance of the class. + + The test. + + + + Runs the test, saving a TestResult in the execution context, as + well as returning it. If the test has an expected result, it + is asserts on that value. Since failed tests and errors throw + an exception, this command must be wrapped in an outer command, + will handle that exception and records the failure. This role + is usually played by the SetUpTearDown command. + + The execution context + + + + TheoryResultCommand adjusts the result of a Theory so that + it fails if all the results were inconclusive. + + + + + Constructs a TheoryResultCommand + + The command to be wrapped by this one + + + + TimeoutCommand creates a timer in order to cancel + a test if it exceeds a specified time and adjusts + the test result if it did time out. + + + + + Initializes a new instance of the class. + + The inner command + Timeout value + + + + Provides methods to support consistent checking in constraints. + + + + + Requires that the provided object is actually of the type required. + + The object to verify. + Name of the parameter as passed into the checking method. + + If and can be null, returns null rather than throwing when is null. + If cannot be null, this parameter is ignored. + The type to require. + + + + CultureDetector is a helper class used by NUnit to determine + whether a test should be run based on the current culture. + + + + + Default constructor uses the current culture. + + + + + Construct a CultureDetector for a particular culture for testing. + + The culture to be used + + + + Test to determine if one of a collection of cultures + is being used currently. + + + + + + + Tests to determine if the current culture is supported + based on a culture attribute. + + The attribute to examine + + + + + Test to determine if the a particular culture or comma- + delimited set of cultures is in use. + + Name of the culture or comma-separated list of culture ids + True if the culture is in use on the system + + + + Return the last failure reason. Results are not + defined if called before IsSupported( Attribute ) + is called. + + + + + ExceptionHelper provides static methods for working with exceptions + + + + + Rethrows an exception, preserving its stack trace + + The exception to rethrow + + + + Builds up a message, using the Message field of the specified exception + as well as any InnerExceptions. Optionally excludes exception names, + creating a more readable message. + + The exception. + Flag indicating whether exception names should be excluded. + A combined message string. + + + + Builds up a message, using the Message field of the specified exception + as well as any InnerExceptions. + + The exception. + A combined stack trace. + + + + Gets the stack trace of the exception. If no stack trace + is provided, returns "No stack trace available". + + The exception. + A string representation of the stack trace. + + + + A CompositeWorkItem represents a test suite and + encapsulates the execution of the suite as well + as all its child tests. + + + + + List of Child WorkItems + + + + + Indicates whether this work item should use a separate dispatcher. + + + + + Construct a CompositeWorkItem for executing a test suite + using a filter to select child tests. + + The TestSuite to be executed + A filter used to select child tests + + + + Method that actually performs the work. Overridden + in CompositeWorkItem to do one-time setup, run all child + items and then dispatch the one-time teardown work item. + + + + + + + + + + Cancel (abort or stop) a CompositeWorkItem and all of its children + + true if the CompositeWorkItem and all of its children should be aborted, false if it should allow all currently running tests to complete + + + + OneTimeTearDownWorkItem represents the cleanup + and one-time teardown phase of a CompositeWorkItem + + + + + Construct a OneTimeTearDownWOrkItem wrapping a CompositeWorkItem + + The CompositeWorkItem being wrapped + + + + The WorkItem name, overridden to indicate this is the teardown. + + + + + The ExecutionStrategy for use in running this work item + + + + + + + + + + PerformWork is not used in CompositeWorkItem + + + + + A simplified implementation of .NET 4 CountdownEvent + for use in earlier versions of .NET. Only the methods + used by NUnit are implemented. + + + + + Construct a CountdownEvent + + The initial count + + + + Gets the initial count established for the CountdownEvent + + + + + Gets the current count remaining for the CountdownEvent + + + + + Decrement the count by one + + + + + Decrement the count by the specified amount + + + + + Block the thread until the count reaches zero + + + + + EventListenerTextWriter sends text output to the currently active + ITestEventListener in the form of a TestOutput object. If no event + listener is active in the context, or if there is no context, + the output is forwarded to the supplied default writer. + + + + + Construct an EventListenerTextWriter + + The name of the stream to use for events + The default writer to use if no listener is available + + + + Get the Encoding for this TextWriter + + + + + Write formatted string + + + + + Write formatted string + + + + + Write formatted string + + + + + Write an object + + + + + Write a string + + + + + Write a decimal + + + + + Write a double + + + + + Write formatted string + + + + + Write a ulong + + + + + Write a long + + + + + Write a uint + + + + + Write an int + + + + + Write a char + + + + + Write a boolean + + + + + Write chars + + + + + Write chars + + + + + Write a float + + + + + Write a string with newline + + + + + Write an object with newline + + + + + Write formatted string with newline + + + + + Write formatted string with newline + + + + + Write formatted string with newline + + + + + Write a decimal with newline + + + + + Write a formatted string with newline + + + + + Write a double with newline + + + + + Write a uint with newline + + + + + Write a ulong with newline + + + + + Write a long with newline + + + + + Write an int with newline + + + + + Write a bool with newline + + + + + Write chars with newline + + + + + Write chars with newline + + + + + Write a char with newline + + + + + Write a float with newline + + + + + Write newline + + + + + The EventPumpState enum represents the state of an + EventPump. + + + + + The pump is stopped + + + + + The pump is pumping events with no stop requested + + + + + The pump is pumping events but a stop has been requested + + + + + EventPump pulls events out of an EventQueue and sends + them to a listener. It is used to send events back to + the client without using the CallContext of the test + runner thread. + + + + + The downstream listener to which we send events + + + + + The queue that holds our events + + + + + Thread to do the pumping + + + + + The current state of the event pump + + + + + Constructor + + The EventListener to receive events + The event queue to pull events from + + + + Gets or sets the current state of the pump + + + + + Gets or sets the name of this EventPump + (used only internally and for testing). + + + + + Dispose stops the pump + Disposes the used WaitHandle, too. + + + + + Start the pump + + + + + Tell the pump to stop after emptying the queue. + + + + + Our thread proc for removing items from the event + queue and sending them on. Note that this would + need to do more locking if any other thread were + removing events from the queue. + + + + + NUnit.Core.Event is the abstract base for all stored events. + An Event is the stored representation of a call to the + ITestListener interface and is used to record such calls + or to queue them for forwarding on another thread or at + a later time. + + + + + The Send method is implemented by derived classes to send the event to the specified listener. + + The listener. + + + + TestStartedEvent holds information needed to call the TestStarted method. + + + + + Initializes a new instance of the class. + + The test. + + + + Calls TestStarted on the specified listener. + + The listener. + + + + TestFinishedEvent holds information needed to call the TestFinished method. + + + + + Initializes a new instance of the class. + + The result. + + + + Calls TestFinished on the specified listener. + + The listener. + + + + TestOutputEvent holds information needed to call the TestOutput method. + + + + + Initializes a new instance of the class. + + The output object. + + + + Calls TestOutput on the specified listener. + + The listener. + + + + TestMessageEvent holds information needed to call the SendMessage method. + + + + + Initializes a new instance of the class. + + The test message object. + + + + Calls on the specified listener. + + The listener. + + + + Holds object for sending to all listeners + + + + + Implements a queue of work items each of which + is queued as a WaitCallback. + + + + + Gets the count of items in the queue. + + + + + Enqueues the specified event + + The event to enqueue. + + + + Removes the first element from the queue and returns it (or null). + + + If true and the queue is empty, the calling thread is blocked until + either an element is enqueued, or is called. + + + + + If the queue not empty + the first element. + + + otherwise, if ==false + or has been called + null. + + + + + + + Stop processing of the queue + + + + + An IWorkItemDispatcher handles execution of work items. + + + + + The level of parallelism supported. Zero if not supported. + + + + + Start execution, performing any initialization. Sets + the top level work item and dispatches it. + + + + + Dispatch a single work item for execution. The first + work item dispatched is saved as the top-level + work item and used when stopping the run. + + The item to dispatch + + + + Cancel the ongoing run completely. + If no run is in process, the call has no effect. + + true if the IWorkItemDispatcher should abort all currently running WorkItems, false if it should allow all currently running WorkItems to complete + + + + MainThreadWorkItemDispatcher handles execution of WorkItems by + directly executing them on the main thread. This is different + from the SimpleWorkItemDispatcher where the work item is dispatched + onto its own thread. + + + + + The level of parallelism supported + + + + + Start execution, dispatching the top level + work into the main thread. + + + + + Dispatch a single work item for execution by + executing it directly. + The item to dispatch + + + + + This method is not supported for + this dispatcher. Using it will throw a + NotSupportedException. + + Not used + If used, it will always throw this. + + + + Enumeration representing the strategy to follow in executing a work item. + The value is only relevant when running under the parallel dispatcher. + + + + + Run directly on same thread + + + + + Enqueue for parallel execution + + + + + Enqueue for non-parallel execution + + + + + ParallelWorkItemDispatcher handles execution of work items by + queuing them for worker threads to process. + + + + + Event raised whenever a shift is starting. + + + + + Event raised whenever a shift has ended. + + + + + Construct a ParallelWorkItemDispatcher + + Number of workers to use + + + + Number of parallel worker threads + + + + + Enumerates all the shifts supported by the dispatcher + + + + + Enumerates all the Queues supported by the dispatcher + + + + + Start execution, setting the top level work, + enqueuing it and starting a shift to execute it. + + + + + Dispatch a single work item for execution. The first + work item dispatched is saved as the top-level + work item and used when stopping the run. + + The item to dispatch + + + + Cancel the ongoing run completely. + If no run is in process, the call has no effect. + + + + + Save the state of the queues and create a new isolated set + + + + + Remove isolated queues and restore old ones + + + + + QueuingEventListener uses an EventQueue to store any + events received on its EventListener interface. + + + + + The EventQueue created and filled by this listener + + + + + Construct a QueuingEventListener + + + + + A test has started + + The test that is starting + + + + A test case finished + + Result of the test case + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + A SimpleWorkItem represents a single test case and is + marked as completed immediately upon execution. This + class is also used for skipped or ignored test suites. + + + + + Construct a simple work item for a test. + + The test to be executed + The filter used to select this test + + + + Method that performs actually performs the work. + + + + + Creates a test command for use in running this test. + + A TestCommand + + + + SimpleWorkItemDispatcher handles execution of WorkItems by + directly executing them. It is provided so that a dispatcher + is always available in the context, thereby simplifying the + code needed to run child tests. + + + + + The level of parallelism supported + + + + + Start execution, creating the execution thread, + setting the top level work and dispatching it. + + + + + Dispatch a single work item for execution by + executing it directly. + The item to dispatch + + + + + Cancel (abort or stop) the ongoing run. + If no run is in process, the call has no effect. + + true if the run should be aborted, false if it should allow its currently running test to complete + + + + A TestWorker pulls work items from a queue + and executes them. + + + + + Event handler for TestWorker events + + The TestWorker sending the event + The WorkItem that caused the event + + + + Event signaled immediately before executing a WorkItem + + + + + Event signaled immediately after executing a WorkItem + + + + + Construct a new TestWorker. + + The queue from which to pull work items + The name of this worker + + + + The WorkItemQueue from which this worker pulls WorkItems + + + + + The name of this worker - also used for the thread + + + + + Indicates whether the worker thread is running + + + + + Our ThreadProc, which pulls and runs tests in a loop + + + + + Create thread and start processing work items. + + + + + Stop the thread, either immediately or after finishing the current WorkItem + + true if the thread should be aborted, false if it should allow the currently running test to complete + + + + The TextCapture class intercepts console output and writes it + to the current execution context, if one is present on the thread. + If no execution context is found, the output is written to a + default destination, normally the original destination of the + intercepted output. + + + + + Construct a TextCapture object + + The default destination for non-intercepted output + + + + Gets the Encoding in use by this TextWriter + + + + + Writes a single character + + The char to write + + + + Writes a string + + The string to write + + + + Writes a string followed by a line terminator + + The string to write + + + + A WorkItem may be an individual test case, a fixture or + a higher level grouping of tests. All WorkItems inherit + from the abstract WorkItem class, which uses the template + pattern to allow derived classes to perform work in + whatever way is needed. + + A WorkItem is created with a particular TestExecutionContext + and is responsible for re-establishing that context in the + current thread before it begins or resumes execution. + + + + + Construct a WorkItem for a particular test. + + The test that the WorkItem will run + Filter used to include or exclude child items + + + + Construct a work Item that wraps another work Item. + Wrapper items are used to represent independently + dispatched tasks, which form part of the execution + of a single test, such as OneTimeTearDown. + + The WorkItem being wrapped + + + + Initialize the TestExecutionContext. This must be done + before executing the WorkItem. + + + Originally, the context was provided in the constructor + but delaying initialization of the context until the item + is about to be dispatched allows changes in the parent + context during OneTimeSetUp to be reflected in the child. + + The TestExecutionContext to use + + + + Event triggered when the item is complete + + + + + Gets the current state of the WorkItem + + + + + The test being executed by the work item + + + + + The name of the work item - defaults to the Test name. + + + + + Filter used to include or exclude child tests + + + + + The execution context + + + + + The worker executing this item. + + + + + The ParallelExecutionStrategy to use for this work item + + + + + Indicates whether this work item should use a separate dispatcher. + + + + + The test result + + + + + Gets the ParallelScope associated with the test, if any, + otherwise returning ParallelScope.Default; + + + + + Execute the current work item, including any + child work items. + + + + + Wait until the execution of this item is complete + + + + + Marks the WorkItem as NotRunnable. + + Reason for test being NotRunnable. + + + + Cancel (abort or stop) a WorkItem + + true if the WorkItem should be aborted, false if it should run to completion + + + + Standard Dispose + + + + + Method that performs actually performs the work. It should + set the State to WorkItemState.Complete when done. + + + + + Method called by the derived class when all work is complete + + + + + Builds the set up tear down list. + + Unsorted array of setup MethodInfos. + Unsorted array of teardown MethodInfos. + A list of SetUpTearDownItems + + + + Changes the result of the test, logging the old and new states + + The new ResultState + The new message + + + + Recursively walks up the test hierarchy to see if the + has been set on any of the parent tests. + + + + + WorkItemBuilder class knows how to build a tree of work items from a tree of tests + + + + + Creates a work item. + + The test for which this WorkItem is being created. + The filter to be used in selecting any child Tests. + True if child work items should be created and added. + + + + + Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. + + + A signed integer that indicates the relative values of and , as shown in the following table.Value Meaning Less than zero is less than .Zero equals .Greater than zero is greater than . + + The first object to compare.The second object to compare. + + + + WorkItemQueueState indicates the current state of a WorkItemQueue + + + + + The queue is paused + + + + + The queue is running + + + + + The queue is stopped + + + + + A WorkItemQueue holds work items that are ready to + be run, either initially or after some dependency + has been satisfied. + + + + + Initializes a new instance of the class. + + The name of the queue. + Flag indicating whether this is a parallel queue + ApartmentState to use for items on this queue + + + + Gets the name of the work item queue. + + + + + Gets a flag indicating whether this queue is used for parallel execution + + + + + Gets the target ApartmentState for work items on this queue + + + + + Gets the total number of items processed so far + + + + + Gets the current state of the queue + + + + + Get a bool indicating whether the queue is empty. + + + + + Enqueue a WorkItem to be processed + + The WorkItem to process + + + + Enqueue a WorkItem to be processed - internal for testing + + The WorkItem to process + The priority at which to process the item + + + + Dequeue a WorkItem for processing + + A WorkItem or null if the queue has stopped + + + + Start or restart processing of items from the queue + + + + + Signal the queue to stop + + + + + Pause the queue for restarting later + + + + + Save the current inner queue and create new ones for use by + a non-parallel fixture with parallel children. + + + + + Restore the inner queue that was previously saved + + + + + The current state of a work item + + + + + Ready to run or continue + + + + + Work Item is executing + + + + + Complete + + + + + Handler for ShiftChange events. + + The shift that is starting or ending. + + + + The dispatcher needs to do different things at different, + non-overlapped times. For example, non-parallel tests may + not be run at the same time as parallel tests. We model + this using the metaphor of a working shift. The WorkShift + class associates one or more WorkItemQueues with one or + more TestWorkers. + + Work in the queues is processed until all queues are empty + and all workers are idle. Both tests are needed because a + worker that is busy may end up adding more work to one of + the queues. At that point, the shift is over and another + shift may begin. This cycle continues until all the tests + have been run. + + + + + Construct a WorkShift + + + + + Event that fires when the shift has ended + + + + + The Name of this shift + + + + + Gets a flag indicating whether the shift is currently active + + + + + Gets a bool indicating whether this shift has any work to do + + + + + Gets a list of the queues associated with this shift. + + Internal for testing - immutable once initialized + + + + Gets the list of workers associated with this shift. + + Internal for testing - immutable once initialized + + + + Add a WorkItemQueue to the shift, starting it if the + shift is currently active. + + + + + Assign a worker to the shift. + + + + + + Start or restart processing for the shift + + + + + End the shift, pausing all queues and raising + the EndOfShift event. + + + + + Shut down the shift. + + + + + Cancel (abort or stop) the shift without completing all work + + true if the WorkShift should be aborted, false if it should allow its currently running tests to complete + + + + 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. + + + + + + + Gets or sets the maximum line length for this writer + + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a given + 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 result of the constraint that failed + + + + Gets the unique type name between expected and actual. + + The expected value + The actual value causing the failure + Output of the unique type name for expected + Output of the unique type name for actual + + + + 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 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 ConstraintResult for which the actual value is to be written + + + + Write the generic 'Actual' line for a given value + + The actual value causing a failure + + + + Combines multiple filters so that a test must pass all + of them in order to pass this filter. + + + + + Constructs an empty AndFilter + + + + + Constructs an AndFilter from an array of filters + + + + + + Checks whether the AndFilter is matched by a test + + The test to be matched + True if all the component filters pass, otherwise false + + + + Checks whether the AndFilter is matched by a test + + The test to be matched + True if all the component filters match, otherwise false + + + + Checks whether the AndFilter is explicit matched by a test. + + The test to be matched + True if all the component filters explicit match, otherwise false + + + + Gets the element name + + Element name + + + + CategoryFilter is able to select or exclude tests + based on their categories. + + + + + Construct a CategoryFilter using a single category name + + A category name + + + + Check whether the filter matches a test + + The test to be matched + + + + + Gets the element name + + Element name + + + + ClassName filter selects tests based on the class FullName + + + + + Construct a FullNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + A base class for multi-part filters + + + + + Constructs an empty CompositeFilter + + + + + Constructs a CompositeFilter from an array of filters + + + + + + Adds a filter to the list of filters + + The filter to be added + + + + Return a list of the composing filters. + + + + + Checks whether the CompositeFilter is matched by a test. + + The test to be matched + + + + Checks whether the CompositeFilter is matched by a test. + + The test to be matched + + + + Checks whether the CompositeFilter is explicit matched by a test. + + The test to be matched + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + FullName filter selects tests based on their FullName + + + + + Construct a FullNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + IdFilter selects tests based on their id + + + + + Construct an IdFilter for a single value + + The id the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + FullName filter selects tests based on their FullName + + + + + Construct a MethodNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + ClassName filter selects tests based on the class FullName + + + + + Construct a NamespaceFilter for a single namespace + + The namespace the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + NotFilter negates the operation of another filter + + + + + Construct a not filter on another filter + + The filter to be negated + + + + Gets the base filter + + + + + Determine if a particular test passes the filter criteria. The default + implementation checks the test itself, its parents and any descendants. + + Derived classes may override this method or any of the Match methods + to change the behavior of the filter. + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Check whether the filter matches a test + + The test to be matched + True if it matches, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Combines multiple filters so that a test must pass one + of them in order to pass this filter. + + + + + Constructs an empty OrFilter + + + + + Constructs an AndFilter from an array of filters + + + + + + Checks whether the OrFilter is matched by a test + + The test to be matched + True if any of the component filters pass, otherwise false + + + + Checks whether the OrFilter is matched by a test + + The test to be matched + True if any of the component filters match, otherwise false + + + + Checks whether the OrFilter is explicit matched by a test + + The test to be matched + True if any of the component filters explicit match, otherwise false + + + + Gets the element name + + Element name + + + + PropertyFilter is able to select or exclude tests + based on their properties. + + + + + Construct a PropertyFilter using a property name and expected value + + A property name + The expected value of the property + + + + Check whether the filter matches a test + + The test to be matched + + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + TestName filter selects tests based on their Name + + + + + Construct a TestNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + ValueMatchFilter selects tests based on some value, which + is expected to be contained in the test. + + + + + Returns the value matched by the filter - used for testing + + + + + Indicates whether the value is a regular expression + + + + + Construct a ValueMatchFilter for a single value. + + The value to be included. + + + + Match the input provided by the derived class + + The value to be matchedT + True for a match, false otherwise. + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + GenericMethodHelper is able to deduce the Type arguments for + a generic method from the actual arguments provided. + + + + + A special value, which is used to indicate that BestCommonType() method + was unable to find a common type for the specified arguments. + + + + + Construct a GenericMethodHelper for a method + + MethodInfo for the method to examine + + + + Return the type arguments for the method, deducing them + from the arguments actually provided. + + The arguments to the method + If successful, an array of type arguments. + + + + InvalidTestFixtureException is thrown when an appropriate test + fixture constructor using the provided arguments cannot be found. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + InvalidPlatformException is thrown when the platform name supplied + to a test is not recognized. + + + + + Instantiates a new instance of the class. + + + + + Instantiates a new instance of the class + + The message. + + + + Instantiates a new instance of the class + + The message. + The inner. + + + + Serialization constructor for the class + + + + + InvalidTestFixtureException is thrown when an appropriate test + fixture constructor using the provided arguments cannot be found. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + Interface for logging within the engine + + + + + Logs the specified message at the error level. + + The message. + + + + Logs the specified message at the error level. + + The message. + The arguments. + + + + Logs the specified message at the warning level. + + The message. + + + + Logs the specified message at the warning level. + + The message. + The arguments. + + + + Logs the specified message at the info level. + + The message. + + + + Logs the specified message at the info level. + + The message. + The arguments. + + + + Logs the specified message at the debug level. + + The message. + + + + Logs the specified message at the debug level. + + The message. + The arguments. + + + + InternalTrace provides facilities for tracing the execution + of the NUnit framework. Tests and classes under test may make use + of Console writes, System.Diagnostics.Trace or various loggers and + NUnit itself traps and processes each of them. For that reason, a + separate internal trace is needed. + + Note: + InternalTrace uses a global lock to allow multiple threads to write + trace messages. This can easily make it a bottleneck so it must be + used sparingly. Keep the trace Level as low as possible and only + insert InternalTrace writes where they are needed. + TODO: add some buffering and a separate writer thread as an option. + TODO: figure out a way to turn on trace in specific classes only. + + + + + Gets a flag indicating whether the InternalTrace is initialized + + + + + Initialize the internal trace facility using the name of the log + to be written to and the trace level. + + The log name + The trace level + + + + Initialize the internal trace using a provided TextWriter and level + + A TextWriter + The InternalTraceLevel + + + + Get a named Logger + + + + + + Get a logger named for a particular Type. + + + + + InternalTraceLevel is an enumeration controlling the + level of detailed presented in the internal log. + + + + + Use the default settings as specified by the user. + + + + + Do not display any trace messages + + + + + Display Error messages only + + + + + Display Warning level and higher messages + + + + + Display informational and higher messages + + + + + Display debug messages and higher - i.e. all messages + + + + + Display debug messages and higher - i.e. all messages + + + + + A trace listener that writes to a separate file per domain + and process using it. + + + + + Construct an InternalTraceWriter that writes to a file. + + Path to the file to use + + + + Construct an InternalTraceWriter that writes to a + TextWriter provided by the caller. + + + + + + Returns the character encoding in which the output is written. + + The character encoding in which the output is written. + + + + Writes a character to the text string or stream. + + The character to write to the text stream. + + + + Writes a string to the text string or stream. + + The string to write. + + + + Writes a string followed by a line terminator to the text string or stream. + + The string to write. If is null, only the line terminator is written. + + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Clears all buffers for the current writer and causes any buffered data to be written to the underlying device. + + + + + Provides internal logging to the NUnit framework + + + + + Initializes a new instance of the class. + + The name. + The log level. + The writer where logs are sent. + + + + Logs the message at error level. + + The message. + + + + Logs the message at error level. + + The message. + The message arguments. + + + + Logs the message at warm level. + + The message. + + + + Logs the message at warning level. + + The message. + The message arguments. + + + + Logs the message at info level. + + The message. + + + + Logs the message at info level. + + The message. + The message arguments. + + + + Logs the message at debug level. + + The message. + + + + Logs the message at debug level. + + The message. + The message arguments. + + + + The MethodWrapper class wraps a MethodInfo so that it may + be used in a platform-independent manner. + + + + + Construct a MethodWrapper for a Type and a MethodInfo. + + + + + Construct a MethodInfo for a given Type and method name. + + + + + Gets the Type from which this method was reflected. + + + + + Gets the MethodInfo for this method. + + + + + Gets the name of the method. + + + + + Gets a value indicating whether the method is abstract. + + + + + Gets a value indicating whether the method is public. + + + + + Gets a value indicating whether the method contains unassigned generic type parameters. + + + + + Gets a value indicating whether the method is a generic method. + + + + + Gets a value indicating whether the MethodInfo represents the definition of a generic method. + + + + + Gets the return Type of the method. + + + + + Gets the parameters of the method. + + + + + + Returns the Type arguments of a generic method or the Type parameters of a generic method definition. + + + + + Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo. + + The type arguments to be used + A new IMethodInfo with the type arguments replaced + + + + Returns an array of custom attributes of the specified type applied to this method + + + + + Gets a value indicating whether one or more attributes of the specified type are defined on the method. + + + + + Invokes the method, converting any TargetInvocationException to an NUnitException. + + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + Override ToString() so that error messages in NUnit's own tests make sense + + + + + Thrown when an assertion failed. Here to preserve the inner + exception and hence its stack trace. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The error message that explains + the reason for the exception + + + + Initializes a new instance of the class. + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Enables the syntax. + + + + + Wraps an action so that it is executed when the returned object is disposed. + This disposal is thread-safe and the action will be executed at most once. + + + + + OSPlatform represents a particular operating system platform + + + + + Platform ID for Unix as defined by Microsoft .NET 2.0 and greater + + + + + Platform ID for Unix as defined by Mono + + + + + Platform ID for XBox as defined by .NET and Mono + + + + + Platform ID for MacOSX as defined by .NET and Mono + + + + + Get the OSPlatform under which we are currently running + + + + + Gets the actual OS Version, not the incorrect value that might be + returned for Win 8.1 and Win 10 + + + If an application is not manifested as Windows 8.1 or Windows 10, + the version returned from Environment.OSVersion will not be 6.3 and 10.0 + respectively, but will be 6.2 and 6.3. The correct value can be found in + the registry. + + The original version + The correct OS version + + + + Product Type Enumeration used for Windows + + + + + Product type is unknown or unspecified + + + + + Product type is Workstation + + + + + Product type is Domain Controller + + + + + Product type is Server + + + + + Construct from a platform ID and version + + + + + Construct from a platform ID, version and product type + + + + + Get the platform ID of this instance + + + + + Implemented to use in place of Environment.OSVersion.ToString() + + A representation of the platform ID and version in an approximation of the format used by Environment.OSVersion.ToString() + + + + Get the Version of this instance + + + + + Get the Product Type of this instance + + + + + Return true if this is a windows platform + + + + + Return true if this is a Unix or Linux platform + + + + + Return true if the platform is Win32S + + + + + Return true if the platform is Win32Windows + + + + + Return true if the platform is Win32NT + + + + + Return true if the platform is Windows CE + + + + + Return true if the platform is Xbox + + + + + Return true if the platform is MacOSX + + + + + Return true if the platform is Windows 95 + + + + + Return true if the platform is Windows 98 + + + + + Return true if the platform is Windows ME + + + + + Return true if the platform is NT 3 + + + + + Return true if the platform is NT 4 + + + + + Return true if the platform is NT 5 + + + + + Return true if the platform is Windows 2000 + + + + + Return true if the platform is Windows XP + + + + + Return true if the platform is Windows 2003 Server + + + + + Return true if the platform is NT 6 + + + + + Return true if the platform is NT 6.0 + + + + + Return true if the platform is NT 6.1 + + + + + Return true if the platform is NT 6.2 + + + + + Return true if the platform is NT 6.3 + + + + + Return true if the platform is Vista + + + + + Return true if the platform is Windows 2008 Server (original or R2) + + + + + Return true if the platform is Windows 2008 Server (original) + + + + + Return true if the platform is Windows 2008 Server R2 + + + + + Return true if the platform is Windows 2012 Server (original or R2) + + + + + Return true if the platform is Windows 2012 Server (original) + + + + + Return true if the platform is Windows 2012 Server R2 + + + + + Return true if the platform is Windows 7 + + + + + Return true if the platform is Windows 8 + + + + + Return true if the platform is Windows 8.1 + + + + + Return true if the platform is Windows 10 + + + + + Return true if the platform is Windows Server. This is named Windows + Server 10 to distinguish it from previous versions of Windows Server. + + + + + + Examines an attribute argument and tries to simulate what that value would have been if the literal syntax + which might have defined the value in C# had instead been used as an argument to a given method parameter in a direct call. + + + For example, since you can’t apply attributes using arguments, we allow the C# syntax + 10 ( value) or 0.1 ( value) to be specified. + NUnit then converts it to match the method’s parameters, just as if you were actually + using the syntax TestMethod(10) or TestMethod(0.1). + + + For another example, you might have written the syntax 10 and picked up the attribute + constructor overload; however, the test method for which this value is intended only has a + signature. Again, NUnit simulates what would have happened if the inferred C# syntax was transplanted + and you were actually using the syntax TestMethod(10). + + + + + + Converts an array of objects to the , if it is supported. + + + + + Converts a single value to the , if it is supported. + + + + + Converts a single value to the , if it is supported. + + + + + The ParameterWrapper class wraps a ParameterInfo so that it may + be used in a platform-independent manner. + + + + + Construct a ParameterWrapper for a given method and parameter + + + + + + + Gets a value indicating whether the parameter is optional + + + + + Gets an IMethodInfo representing the method for which this is a parameter. + + + + + Gets the underlying ParameterInfo + + + + + Gets the Type of the parameter + + + + + Returns an array of custom attributes of the specified type applied to this method + + + + + Gets a value indicating whether one or more attributes of the specified type are defined on the parameter. + + + + + PlatformHelper class is used by the PlatformAttribute class to + determine whether a platform is supported. + + + + + Comma-delimited list of all supported OS platform constants + + + + + Comma-delimited list of all supported Runtime platform constants + + + + + Default constructor uses the operating system and + common language runtime of the system. + + + + + Construct a PlatformHelper for a particular operating + system and common language runtime. Used in testing. + + RuntimeFramework to be used + OperatingSystem to be used + + + + Test to determine if one of a collection of platforms + is being used currently. + + + + + + + Tests to determine if the current platform is supported + based on a platform attribute. + + The attribute to examine + + + + + Tests to determine if the current platform is supported + based on a platform attribute. + + The attribute to examine + + + + + Test to determine if a particular platform or comma-delimited set of platforms is in use. + + Name of the platform or comma-separated list of platform ids + True if the platform is in use on the system + + + + Return the last failure reason. Results are not + defined if called before IsSupported( Attribute ) + is called. + + + + + Implements a simplified filter for use in deciding which + Types and Methods should be used to generate tests. It is consructed with a + list of strings, each of which may end up being interpreted in various ways. + + + + + Return a new PreFilter, without elements, which is considered + empty and always matches. + + + + + Return true if the filter is empty, in which case it + always succeeds. Technically, this is just a filter and + you can add elements but it's best to use Empty when + you need an empty filter and new when you plan to add. + + + + + Add a new filter element to the filter + + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + A PropertyBag represents a collection of name value pairs + that allows duplicate entries with the same key. Methods + are provided for adding a new pair as well as for setting + a key to a single value. All keys are strings but values + may be of any type. Null values are not permitted, since + a null entry represents the absence of the key. + + + + + Adds a key/value pair to the property set + + The key + The value + + + + Sets the value for a key, removing any other + values that are already in the property set. + + + + + + + Gets a single value for a key, using the first + one if multiple values are present and returning + null if the value is not found. + + + + + + + Gets a flag indicating whether the specified key has + any entries in the property set. + + The key to be checked + + True if their are values present, otherwise false + + + + + Gets a collection containing all the keys in the property set + + + + + + Gets or sets the list of values for a particular key + + + + + Returns an XmlNode representing the current PropertyBag. + + Not used + An XmlNode representing the PropertyBag + + + + Returns an XmlNode representing the PropertyBag after + adding it as a child of the supplied parent node. + + The parent node. + Not used + + + + + The PropertyNames class provides static constants for the + standard property ids that NUnit uses on tests. + + + + + The FriendlyName of the AppDomain in which the assembly is running + + + + + The selected strategy for joining parameter data into test cases + + + + + The process ID of the executing assembly + + + + + The stack trace from any data provider that threw + an exception. + + + + + The reason a test was not run + + + + + The author of the tests + + + + + The ApartmentState required for running the test + + + + + The categories applying to a test + + + + + The Description of a test + + + + + The number of threads to be used in running tests + + + + + The maximum time in ms, above which the test is considered to have failed + + + + + The ParallelScope associated with a test + + + + + The number of times the test should be repeated + + + + + Indicates that the test should be run on a separate thread + + + + + The culture to be set for a test + + + + + The UI culture to be set for a test + + + + + The type that is under test + + + + + The timeout value for the test + + + + + The test will be ignored until the given date + + + + + The optional Order the test will run in + + + + + Randomizer returns a set of random values in a repeatable + way, to allow re-running of tests if necessary. It extends + the .NET Random class, providing random values for a much + wider range of types. + + The class is used internally by the framework to generate + test case data and is also exposed for use by users through + the TestContext.Random property. + + + For consistency with the underlying Random Type, methods + returning a single value use the prefix "Next..." Those + without an argument return a non-negative value up to + the full positive range of the Type. Overloads are provided + for specifying a maximum or a range. Methods that return + arrays or strings use the prefix "Get..." to avoid + confusion with the single-value methods. + + + + + Initial seed used to create randomizers for this run + + + + + 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. + + + + + Create a new Randomizer using the next seed + available to ensure that each randomizer gives + a unique sequence of values. + + + + + + Default constructor + + + + + Construct based on seed value + + + + + + Returns a random unsigned int. + + + + + Returns a random unsigned int less than the specified maximum. + + + + + Returns a random unsigned int within a specified range. + + + + + Returns a non-negative random short. + + + + + Returns a non-negative random short less than the specified maximum. + + + + + Returns a non-negative random short within a specified range. + + + + + Returns a random unsigned short. + + + + + Returns a random unsigned short less than the specified maximum. + + + + + Returns a random unsigned short within a specified range. + + + + + Returns a random long. + + + + + Returns a random long less than the specified maximum. + + + + + Returns a non-negative random long within a specified range. + + + + + Returns a random ulong. + + + + + Returns a random ulong less than the specified maximum. + + + + + Returns a non-negative random long within a specified range. + + + + + Returns a random Byte + + + + + Returns a random Byte less than the specified maximum. + + + + + Returns a random Byte within a specified range + + + + + Returns a random SByte + + + + + Returns a random sbyte less than the specified maximum. + + + + + Returns a random sbyte within a specified range + + + + + Returns a random bool + + + + + Returns a random bool based on the probability a true result + + + + + Returns a random double between 0.0 and the specified maximum. + + + + + Returns a random double within a specified range. + + + + + Returns a random float. + + + + + Returns a random float between 0.0 and the specified maximum. + + + + + Returns a random float within a specified range. + + + + + Returns a random enum value of the specified Type as an object. + + + + + Returns a random enum value of the specified Type. + + + + + Default characters for random functions. + + Default characters are the English alphabet (uppercase & lowercase), Arabic numerals, and underscore + + + + Generate a random string based on the characters from the input string. + + desired length of output string. + string representing the set of characters from which to construct the resulting string + A random string of arbitrary length + + + + Generate a random string based on the characters from the input string. + + desired length of output string. + A random string of arbitrary length + Uses DefaultStringChars as the input character set + + + + Generate a random string based on the characters from the input string. + + A random string of the default length + Uses DefaultStringChars as the input character set + + + + Returns a random decimal. + + + + + Returns a random decimal between positive zero and the specified maximum. + + + + + Returns a random decimal within a specified range, which is not + permitted to exceed decimal.MaxVal in the current implementation. + + + A limitation of this implementation is that the range from min + to max must not exceed decimal.MaxVal. + + + + + Generates a valid version 4 . + + + + + Helper methods for inspecting a type by reflection. + + Many of these methods take ICustomAttributeProvider as an + argument to avoid duplication, even though certain attributes can + only appear on specific types of members, like MethodInfo or Type. + + In the case where a type is being examined for the presence of + an attribute, interface or named member, the Reflect methods + operate with the full name of the member being sought. This + removes the necessity of the caller having a reference to the + assembly that defines the item being sought and allows the + NUnit core to inspect assemblies that reference an older + version of the NUnit framework. + + + + + Examine a fixture type and return an array of methods having a + particular attribute. The array is order with base methods first. + + The type to examine + The attribute Type to look for + Specifies whether to search the fixture type inheritance chain + The array of methods found + + + + Examine a fixture type and return true if it has a method with + a particular attribute. + + The type to examine + The attribute Type to look for + True if found, otherwise false + + + + Invoke the default constructor on a Type + + The Type to be constructed + An instance of the Type + + + + Invoke a constructor on a Type with arguments + + The Type to be constructed + Arguments to the constructor + An instance of the Type + + + + Returns an array of types from an array of objects. + Differs from by returning + for null elements rather than throwing . + + + + + Gets the constructors to which the specified argument types can be coerced. + + + + + Determines if the given types can be coerced to match the given parameters. + + + + + Determines whether the current type can be implicitly converted to the specified type. + + + + + Invoke a parameterless method returning void on an object. + + A MethodInfo for the method to be invoked + The object on which to invoke the method + + + + Invoke a method, converting any TargetInvocationException to an NUnitException. + + A MethodInfo for the method to be invoked + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + + Selects the ultimate shadowing property just like would, + rather than throwing + for properties that shadow properties of a different property type + which is what does. + + + If you request both public and nonpublic properties, every public property is preferred + over every nonpublic property. It would violate the principle of least surprise for a + derived class’s implementation detail to be chosen over the public API for a type. + + + See . + See . + See . + + + + Represents the result of running a single test case. + + + + + Construct a TestCaseResult based on a TestMethod + + A TestMethod to which the result applies. + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + The TestResult class represents the result of a test. + + + + + Error message for when child tests have errors + + + + + Error message for when child tests have warnings + + + + + Error message for when child tests are ignored + + + + + The minimum duration for tests + + + + + Aggregate assertion count + + + + + ReaderWriterLock + + + + + Construct a test result given a Test + + The test to be used + + + + Gets the test with which this result is associated. + + + + + Gets the ResultState of the test result, which + indicates the success or failure of the test. + + + + + Gets the name of the test result + + + + + Gets the full name of the test result + + + + + Gets or sets the elapsed time for running the test in seconds + + + + + Gets or sets the time the test started running. + + + + + Gets or sets the time the test finished running. + + + + + Adds a test attachment to the test result + + The TestAttachment object to attach + + + + Gets the collection of files attached to the test + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + + Gets or sets the count of asserts executed + when running the test. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + Gets a TextWriter, which will write output to be included in the result. + + + + + Gets any text output written to this result. + + + + + Gets a list of assertion results associated with the test. + + + + + Returns the XML representation of the result. + + If true, descendant results are included + An XmlNode representing the result + + + + Adds the XML representation of the result as a child of the + supplied parent node.. + + The parent node. + If true, descendant results are included + + + + + Gets a count of pending failures (from Multiple Assert) + + + + + Gets the worst assertion status (highest enum) in all the assertion results + + + + + Set the result of the test + + The ResultState to use in the result + + + + Set the result of the test + + The ResultState to use in the result + A message associated with the result state + + + + Set the result of the test + + The ResultState to use in the result + A message associated with the result state + Stack trace giving the location of the command + + + + Set the test result based on the type of exception thrown + + The exception that was thrown + + + + Set the test result based on the type of exception thrown + + The exception that was thrown + The FailureSite to use in the result + + + + RecordTearDownException appends the message and stack trace + from an exception arising during teardown of the test + to any previously recorded information, so that any + earlier failure information is not lost. Note that + calling Assert.Ignore, Assert.Inconclusive, etc. during + teardown is treated as an error. If the current result + represents a suite, it may show a teardown error even + though all contained tests passed. + + The Exception to be recorded + + + + Update overall test result, including legacy Message, based + on AssertionResults that have been saved to this point. + + + + + Record an assertion result + + + + + Record an assertion result + + + + + Record an assertion result + + + + + Creates a failure message incorporating failures + from a Multiple Assert block for use by runners + that don't know about AssertionResults. + + Message as a string + + + + Adds a reason element to a node and returns it. + + The target node. + The new reason element. + + + + Adds a failure element to a node and returns it. + + The target node. + The new failure element. + + + + Adds an attachments element to a node and returns it. + + The target node. + The new attachments element. + + + + Represents the result of running a test suite + + + + + Construct a TestSuiteResult base on a TestSuite + + The TestSuite to which the result applies + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + Adds a child result to this result, setting this result's + ResultState to Failure if the child result failed. + + The result to be added + + + + Enumeration identifying a common language + runtime implementation. + + + + Any supported runtime framework + + + Microsoft .NET Framework + + + Microsoft Shared Source CLI + + + Mono + + + MonoTouch + + + Microsoft .NET Core + + + + RuntimeFramework represents a particular version + of a common language runtime implementation. + + + + + DefaultVersion is an empty Version, used to indicate that + NUnit should select the CLR version to use for the test. + + + + + Construct from a runtime type and version. If the version has + two parts, it is taken as a framework version. If it has three + or more, it is taken as a CLR version. In either case, the other + version is deduced based on the runtime type and provided version. + + The runtime type of the framework + The version of the framework + + + + Static method to return a RuntimeFramework object + for the framework that is currently in use. + + + + + The type of this runtime framework + + + + + The framework version for this runtime framework + + + + + The CLR version for this runtime framework + + + + + Return true if any CLR version may be used in + matching this RuntimeFramework object. + + + + + Returns the Display name for this framework + + + + + Parses a string representing a RuntimeFramework. + The string may be just a RuntimeType name or just + a Version or a hyphenated RuntimeType-Version or + a Version prefixed by 'versionString'. + + + + + + + Overridden to return the short name of the framework + + + + + + Returns true if the current framework matches the + one supplied as an argument. Two frameworks match + if their runtime types are the same or either one + is RuntimeType.Any and all specified version components + are equal. Negative (i.e. unspecified) version + components are ignored. + + The RuntimeFramework to be matched. + True on match, otherwise false + + + + Holds thread state which is captured and restored in order to sandbox user code. + + + + + Captures a snapshot of the tracked state of the current thread to be restored later. + + + + + Restores the tracked state of the current thread to the previously captured state. + + + + + Returns a copy with the specified culture. + + + + + Returns a copy with the specified UI culture. + + + + + Returns a copy with the specified principal. + + + + + May be called from any thread. + + + + + May be called from any thread. + + + + + May be called from any thread. + + + + + May be called from any thread, but may only be called once. + + + + + StackFilter class is used to remove internal NUnit + entries from a stack trace so that the resulting + trace provides better information about the test. + + + + + Single instance of our default filter + + + + + Construct a stack filter instance + + Regex pattern used to delete lines from the top of the stack + Regex pattern used to delete lines from the bottom of the stack + + + + Construct a stack filter instance + + Regex pattern used to delete lines from the top of the stack + + + + Construct a stack filter instance + + + + + Filters a raw stack trace and returns the result. + + The original stack trace + A filtered stack trace + + + + Provides methods to support legacy string comparison methods. + + + + + Compares two strings for equality, ignoring case if requested. + + The first string. + The second string.. + if set to true, the case of the letters in the strings is ignored. + Zero if the strings are equivalent, a negative number if strA is sorted first, a positive number if + strB is sorted first + + + + Compares two strings for equality, ignoring case if requested. + + The first string. + The second string.. + if set to true, the case of the letters in the strings is ignored. + True if the strings are equivalent, false if not. + + + + The TestCaseParameters class encapsulates method arguments and + other selected parameters needed for constructing + a parameterized test case. + + + + + The expected result to be returned + + + + + Default Constructor creates an empty parameter set + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a ParameterSet from an object implementing ITestCaseData + + + + + + The expected result of the test, which + must match the method return type. + + + + + Gets a value indicating whether an expected result was specified. + + + + + TestCaseTimeoutException is thrown when a test running directly + on a TestWorker thread is cancelled due to timeout. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + Helper class used to save and restore certain static or + singleton settings in the environment that affect tests + or which might be changed by the user tests. + + + + + Link to a prior saved context + + + + + Indicates that a stop has been requested + + + + + The event listener currently receiving notifications + + + + + The number of assertions for the current test + + + + + The current test result + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + An existing instance of TestExecutionContext. + + + + Gets and sets the current context. + + + + + Gets or sets the current test + + + + + The time the current test started execution + + + + + The time the current test started in Ticks + + + + + Gets or sets the current test result + + + + + Gets a TextWriter that will send output to the current test result. + + + + + The current test object - that is the user fixture + object on which tests are being executed. + + + + + Get or set indicator that run should stop on the first error + + + + + Gets an enum indicating whether a stop has been requested. + + + + + The current test event listener + + + + + The current WorkItemDispatcher. Made public for + use by nunitlite.tests + + + + + The ParallelScope to be used by tests running in this context. + For builds with out the parallel feature, it has no effect. + + + + + Default tolerance value used for floating point equality + when no other tolerance is specified. + + + + + The worker that spawned the context. + For builds without the parallel feature, it is null. + + + + + Gets the RandomGenerator specific to this Test + + + + + Gets the assert count. + + The assert count. + + + + The current nesting level of multiple assert blocks + + + + + Gets or sets the test case timeout value + + + + + Gets a list of ITestActions set by upstream tests + + + + + Saves or restores the CurrentCulture + + + + + Saves or restores the CurrentUICulture + + + + + Gets or sets the current for the Thread. + + + + + The current head of the ValueFormatter chain, copied from MsgUtils.ValueFormatter + + + + + If true, all tests must run on the same thread. No new thread may be spawned. + + + + + The number of times the current test has been scheduled for execution. + Currently only being executed in a test using the + + + + + Record any changes in the environment made by + the test code in the execution context so it + will be passed on to lower level tests. + + + + + Set up the execution environment to match a context. + Note that we may be running on the same thread where the + context was initially created or on a different thread. + + + + + Increments the assert count by one. + + + + + Increments the assert count by a specified amount. + + + + + Adds a new ValueFormatterFactory to the chain of formatters + + The new factory + + + + Sends a message from test to listeners. This message is not kind of test output and doesn't go to test result. + + A name recognized by the intended listeners. + A message to be sent + + + + Obtain lifetime service object + + + + + + An IsolatedContext is used when running code + that may effect the current result in ways that + should not impact the final result of the test. + A new TestExecutionContext is created with an + initially clear result, which is discarded on + exiting the context. + + + using (new TestExecutionContext.IsolatedContext()) + { + // Code that should not impact the result + } + + + + + Save the original current TestExecutionContext and + make a new isolated context current. + + + + + Restore the original TestExecutionContext. + + + + + An AdhocTestExecutionContext is created whenever a context is needed + but not available in CurrentContext. This happens when tests are run + on an ad-hoc basis or Asserts are used outside of tests. + + + + + Construct an AdhocTestExecutionContext, which is used + whenever the current TestExecutionContext is found to be null. + + + + + Enumeration indicating whether the tests are + running normally or being cancelled. + + + + + Running normally with no stop requested + + + + + A graceful stop has been requested + + + + + A forced stop has been requested + + + + + Interface to be implemented by filters applied to tests. + The filter applies when running the test, after it has been + loaded, since this is the only time an ITest exists. + + + + + Unique Empty filter. + + + + + Indicates whether this is the EmptyFilter + + + + + Indicates whether this is a top-level filter, + not contained in any other filter. + + + + + Determine if a particular test passes the filter criteria. The default + implementation checks the test itself, its parents and any descendants. + + Derived classes may override this method or any of the Match methods + to change the behavior of the filter. + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + Determine whether the test itself matches the filter criteria, without + examining either parents or descendants. This is overridden by each + different type of filter to perform the necessary tests. + + The test to which the filter is applied + True if the filter matches the any parent of the test + + + + Determine whether any ancestor of the test matches the filter criteria + + The test to which the filter is applied + True if the filter matches the an ancestor of the test + + + + Determine whether any descendant of the test matches the filter criteria. + + The test to be matched + True if at least one descendant matches the filter criteria + + + + Create a TestFilter instance from an XML representation. + + + + + Create a TestFilter from its TNode representation + + + + + Nested class provides an empty filter - one that always + returns true when called. It never matches explicitly. + + + + + Adds an XML node + + True if recursive + The added XML node + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + The TestCaseParameters class encapsulates method arguments and + other selected parameters needed for constructing + a parameterized test case. + + + + + Default Constructor creates an empty parameter set + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a ParameterSet from an object implementing ITestCaseData + + + + + + Type arguments used to create a generic fixture instance + + + + + TestListener provides an implementation of ITestListener that + does nothing. It is used only through its NULL property. + + + + + Called when a test has just started + + The test that is starting + + + + Called when a test case has finished + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the message to send + + + + Construct a new TestListener - private so it may not be used. + + + + + Get a listener that does nothing + + + + + TestNameGenerator is able to create test names according to + a coded pattern. + + + + + Default pattern used to generate names + + + + + Construct a TestNameGenerator + + + + + Construct a TestNameGenerator + + The pattern used by this generator. + + + + Get the display name for a TestMethod and its arguments + + A TestMethod + The display name + + + + Get the display name for a TestMethod and its arguments + + A TestMethod + Arguments to be used + The display name + + + + TestParameters is the abstract base class for all classes + that know how to provide data for constructing a test. + + + + + Default Constructor creates an empty parameter set + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a ParameterSet from an object implementing ITestData + + + + + + The RunState for this set of parameters. + + + + + The arguments to be used in running the test, + which must match the method signature. + + + + + A name to be used for this test case in lieu + of the standard generated name containing + the argument list. + + + + + Gets the property dictionary for this test + + + + + Applies ParameterSet values to the test itself. + + A test. + + + + The original arguments provided by the user, + used for display purposes. + + + + + The list of display names to use as the parameters in the test name. + + + + + TestProgressReporter translates ITestListener events into + the async callbacks that are used to inform the client + software about the progress of a test run. + + + + + Initializes a new instance of the class. + + The callback handler to be used for reporting progress. + + + + Called when a test has just started + + The test that is starting + + + + Called when a test has finished. Sends a result summary to the callback. + to + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + Returns the parent test item for the target test item if it exists + + + parent test item + + + + Makes a string safe for use as an attribute, replacing + characters that can't be used with their + corresponding XML representations. + + The string to be used + A new string with the values replaced + + + + ParameterizedFixtureSuite serves as a container for the set of test + fixtures created from a given Type using various parameters. + + + + + Initializes a new instance of the class. + + The ITypeInfo for the type that represents the suite. + + + + Gets a string representing the type of test + + + + + ParameterizedMethodSuite holds a collection of individual + TestMethods with their arguments applied. + + + + + Initializes a new instance of the class. + + + + + Gets a string representing the type of test + + + + + SetUpFixture extends TestSuite and supports + Setup and TearDown methods. + + + + + Initializes a new instance of the class. + + + + + The Test abstract class represents a test within the framework. + + + + + Static value to seed ids. It's started at 1000 so any + uninitialized ids will stand out. + + + + + Used to cache the declaring type for this MethodInfo + + + + + Method property backing field + + + + + Constructs a test given its name + + The name of the test + + + + Constructs a test given the path through the + test hierarchy to its parent and a name. + + The parent tests full name + The name of the test + + + + Constructs a test for a specific type. + + + + + Constructs a test for a specific method. + + + + + Gets or sets the id of the test + + + + + + Gets or sets the name of the test + + + + + Gets or sets the fully qualified name of the test + + + + + + Gets the name of the class where this test was declared. + Returns null if the test is not associated with a class. + + + + + Gets the name of the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + The arguments to use in creating the test or empty array if none required. + + + + + Gets the TypeInfo of the fixture used in running this test + or null if no fixture type is associated with it. + + + + + Gets a MethodInfo for the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + Whether or not the test should be run + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Gets a string representing the type of test. Used as an attribute + value in the XML representation of a test and has no other + function in the framework. + + + + + Gets a count of test cases represented by + or contained under this test. + + + + + Gets the properties for this test + + + + + Returns true if this is a TestSuite + + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets the parent as a Test object. + Used by the core to set the parent. + + + + + Gets this test's child tests + + A list of child tests + + + + Gets or sets a fixture object for running this test. + + + + + Static prefix used for ids in this AppDomain. + Set by FrameworkController. + + + + + Gets or Sets the Int value representing the seed for the RandomGenerator + + + + + + The SetUp methods. + + + + + The teardown methods + + + + + Creates a TestResult for this test. + + A TestResult suitable for this type of test. + + + + Modify a newly constructed test by applying any of NUnit's common + attributes, based on a supplied , which is + usually the reflection element from which the test was constructed, + but may not be in some instances. The attributes retrieved are + saved for use in subsequent operations. + + + + + Mark the test as Invalid (not runnable) specifying a reason + + The reason the test is not runnable + + + + Get custom attributes applied to a test + + + + + Add standard attributes and members to a test node. + + + + + + + Returns the XML representation of the test + + If true, include child tests recursively + + + + + Returns an XmlNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Compares this test to another test for sorting purposes + + The other test + Value of -1, 0 or +1 depending on whether the current test is less than, equal to or greater than the other test + + + + TestAssembly is a TestSuite that represents the execution + of tests in a managed assembly. + + + + + Initializes a new instance of the class + specifying the Assembly and the suite name. + + The assembly this test represents. + The desired name for the test suite. + + + + Initializes a new instance of the class + specifying the suite name for an assembly that could not be loaded. + + The desired name for the test suite. + + + + Copy-constructor style to create a filtered copy of the test assemblies + test cases + + + + + + + Gets the Assembly represented by this instance. + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Get custom attributes specified on the assembly + + + + + TestFixture is a surrogate for a user test fixture class, + containing one or more tests. + + + + + Initializes a new instance of the class. + + Type of the fixture. + Arguments used to instantiate the test fixture, or null if none used + + + + The TestMethod class represents a Test implemented as a method. + + + + + The ParameterSet used to create this test method + + + + + Initializes a new instance of the class. + + The method to be used as a test. + + + + Initializes a new instance of the class. + + The method to be used as a test. + The suite or fixture to which the new test will be added + + + + The arguments to use in executing the test method, or empty array if none are provided. + + + + + Overridden to return a TestCaseResult. + + A TestResult for this test. + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Returns a TNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Gets this test's child tests + + A list of child tests + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Returns the name of the method + + + + + TestSuite represents a composite test, which contains other tests. + + + + + Our collection of child tests + + + + + Initializes a new instance of the class. + + The name of the suite. + + + + Initializes a new instance of the class. + + Name of the parent suite. + The name of the suite. + + + + Initializes a new instance of the class. + + Type of the fixture. + Arguments used to instantiate the test fixture, or null if none used. + + + + Initializes a new instance of the class. + + Type of the fixture. + + + + Copy constructor style to create a filtered copy of the given test suite + + Test Suite to copy + Filter to be applied + + + + Sorts tests under this suite. + + + + + Adds a test to the suite. + + The test. + + + + Gets this test's child tests + + The list of child tests + + + + Gets a count of test cases represented by + or contained under this test. + + + + + + The arguments to use in creating the fixture, or empty array if none are provided. + + + + + Set to true to suppress sorting this suite's contents + + + + + OneTimeSetUp methods for this suite + + + + + OneTimeTearDown methods for this suite + + + + + Overridden to return a TestSuiteResult. + + A TestResult for this test. + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Returns an XmlNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Check that setup and teardown methods marked by certain attributes + meet NUnit's requirements and mark the tests not runnable otherwise. + + A list of methodinfos to check + + + + ThreadUtility provides a set of static methods convenient + for working with threads. + + + + + Pre-Task compatibility + + + + + Abort a thread, helping to dislodging it if it is blocked in native code + + The thread to abort + The native thread id (if known), otherwise 0. + If provided, allows the thread to be killed if it's in a message pump native blocking wait. + This must have previously been captured by calling from the running thread itself. + + + + Do our best to kill a thread + + The thread to kill + The native thread id (if known), otherwise 0. + If provided, allows the thread to be killed if it's in a message pump native blocking wait. + This must have previously been captured by calling from the running thread itself. + + + + Do our best to kill a thread, passing state info + + The thread to kill + Info for the ThreadAbortException handler + The native thread id (if known), otherwise 0. + If provided, allows the thread to be killed if it's in a message pump native blocking wait. + This must have previously been captured by calling from the running thread itself. + + + + Schedule a threadpool thread to check on the aborting thread in case it's in a message pump native blocking wait + + + + + Captures the current thread's native id. If provided to later, allows the thread to be killed if it's in a message pump native blocking wait. + + + + + Sends a message to the thread to dislodge it from native code and allow a return to managed code, where a ThreadAbortException can be generated. + The message is meaningless (WM_CLOSE without a window handle) but it will end any blocking message wait. + + + + + TypeHelper provides static methods that operate on Types. + + + + + Gets the display name for a Type as used by NUnit. + + The Type for which a display name is needed. + The display name for the Type + + + + Gets the display name for a Type as used by NUnit. + + The Type for which a display name is needed. + The arglist provided. + The display name for the Type + + + + Returns the best fit for a common type to be used in + matching actual arguments to a methods Type parameters. + + + + + Determines whether the specified type is numeric. + + The type to be examined. + + true if the specified type is numeric; otherwise, false. + + + + + Convert an argument list to the required parameter types. + Currently, only widening numeric conversions are performed. + + An array of args to be converted + A ParameterInfo[] whose types will be used as targets + + + + Determines whether this instance can deduce type args for a generic type from the supplied arguments. + + The type to be examined. + The arglist. + The type args to be used. + + true if this the provided args give sufficient information to determine the type args to be used; otherwise, false. + + + + + Return the interfaces implemented by a Type. + + The Type to be examined. + An array of Types for the interfaces. + + + + Return whether or not the given type is a ValueTuple. + + Type. + Whether or not the given type is a ValueTuple. + + + + Return whether or not the given type is a Tuple. + + Type. + Whether or not the given type is a Tuple. + + + + Determines whether the cast to the given type would succeed. + If is and + can be , the cast succeeds just like the C# language feature. + + The object to cast. + + + + Casts to a value of the given type if possible. + If is and + can be , the cast succeeds just like the C# language feature. + + The object to cast. + The value of the object, if the cast succeeded. + + + + Used for resolving the type difference between objects. + + + + + Gets the shortened type name difference between and . + + The expected object. + The actual object. + Output of the unique type name for the expected object. + Output of the unique type name for actual object. + + + + Gets the shortened type name difference between and . + + The expected object . + The actual object . + Output of the unique type name for the expected object. + Output of the unique type name for actual object. + + + + Obtain the shortened generic template parameters of the given and , + if they are generic. + + The expected . + The actual . + Shortened generic parameters of the expected . + Shortened generic parameters of the actual . + + + + Obtain a shortened name of the given . + + + + + Shorten the given names by only including the relevant differing namespaces/types, if they differ. + + The expected . + The actual . + The shortened expected name. + The shortened actual name. + + + + Returns whether or not the is generic. + + + + + Returns the fully qualified generic name of a given . + + + + + Reconstruct a generic type name using the provided generic type name, and a + of the template parameters. + + The name of the generic type, including the number of template parameters expected. + A of names of the template parameters of the provided generic type. + + + + Obtain the shortened generic names of the given expected and actual s. + + The expected . + The actual . + The shortened expected generic name. + The shortened actual generic name. + + + + The TypeWrapper class wraps a Type so it may be used in + a platform-independent manner. + + + + + Construct a TypeWrapper for a specified Type. + + + + + Gets the underlying Type on which this TypeWrapper is based. + + + + + Gets the base type of this type as an ITypeInfo + + + + + Gets the Name of the Type + + + + + Gets the FullName of the Type + + + + + Gets the assembly in which the type is declared + + + + + Gets the namespace of the Type + + + + + Gets a value indicating whether the type is abstract. + + + + + Gets a value indicating whether the Type is a generic Type + + + + + Returns true if the Type wrapped is T + + + + + Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types. + + + + + Gets a value indicating whether the Type is a generic Type definition + + + + + Gets a value indicating whether the type is sealed. + + + + + Gets a value indicating whether this type represents a static class. + + + + + Get the display name for this type + + + + + Get the display name for an object of this type, constructed with the specified args. + + + + + Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments + + + + + Returns a Type representing a generic type definition from which this Type can be constructed. + + + + + Returns an array of custom attributes of the specified type applied to this type + + + + + Returns a value indicating whether the type has an attribute of the specified type. + + + + + + + + Returns a flag indicating whether this type has a method with an attribute of the specified type. + + + + + + + Returns an array of IMethodInfos for methods of this Type + that match the specified flags. + + + + + Gets the public constructor taking the specified argument Types + + + + + Returns a value indicating whether this Type has a public constructor taking the specified argument Types. + + + + + Construct an object of this Type, using the specified arguments. + + + + + Override ToString() so that error messages in NUnit's own tests make sense + + + + + Encapsulates the ability to increment a value by an amount which may be of a different type. + + + + + Creates a from the specified value if the current instance is able to + use it to increment the on values which it operates. If the creation fails, + is thrown. + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values on which it operates. A return value indicates + whether the creation succeeded. + + + + + Provides a convenient shorthand when is + and the default value of represents zero. + + + + + Initializes a new instance of the class. + + The amount by which to increment each time this step is applied. + + Must increment the given value and return the result. + If the result is outside the range representable by , + must throw . If the result does not change due to lack + of precision representable by , must throw . + + + + + Increments the given value and returns the result. + If the result is outside the range representable by , + throws . If the result does not change due to lack + of precision representable by , throws . + + + + + + + Encapsulates the ability to increment a value by an amount + which may be of a different type. + + + + + Increments the given value and returns the result. + If the result is outside the range representable by , + throws . If the result does not change due to lack + of precision representable by , throws . + + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values of type . If the creation fails, + is thrown. + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values of type . A return value indicates + whether the creation succeeded. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + 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 equality with zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 to the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable to 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + 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 a subpath of the 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 + inclusively within a specified range. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + + Returns a constraint that tests if an item is equal to any of parameters + + Expected values + + + + When implemented by an attribute, this interface implemented to provide actions to execute before and after tests. + + + + + Executed before each test is run + + The test that is going to be run. + + + + Executed after each test is run + + The test that has just been run. + + + + Provides the target for the action attribute + + The target for the action attribute + + + + 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 + + + + + Basic Asserts on strings. + + + + + DO NOT USE! Use StringAssert.AreEqualIgnoringCase(...) or Assert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 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 + + + + 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 TestCaseData class represents a set of arguments + and other parameter info to be used for a parameterized + test case. It is derived from TestCaseParameters and adds a + fluent syntax for use in initializing the 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 name of the test case + + The modified TestCaseData instance + + + + Sets the list of display names to use as the parameters in the test name. + + + + + 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 + + + + + + + + Marks the test case as explicit. + + + + + Marks the test case as explicit, specifying the reason. + + + + + Ignores this TestCase, specifying the reason. + + The reason. + + + + + Provide the context information of the current test. + This is an adapter for the internal ExecutionContext + class, hiding the internals from the user test. + + + + + Construct a TestContext for an ExecutionContext + + The ExecutionContext to adapt + + + + 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 TextWriter that will send output to the current test result. + + + + + Gets a TextWriter that will send output directly to Console.Error + + + + + Gets a TextWriter for use in displaying immediate progress messages + + + + + TestParameters object holds parameters for the test run, if any are specified + + + + + Static DefaultWorkDirectory is now used as the source + of the public instance property WorkDirectory. This is + a bit odd but necessary to avoid breaking user tests. + + + + + Get a representation of the current test. + + + + + Gets a Representation of the TestResult for the current test. + + + + + Gets the unique name of the Worker that is executing this test. + + + + + Gets the directory containing the current test assembly. + + + + + Gets the directory to be used for outputting files created + by this test run. + + + + + Gets the random generator. + + + The random generator. + + + + + Gets the number of assertions executed + up to this point in the test. + + + + + Get the number of times the current Test has been repeated. This is currently only + set when using the . + TODO: add this to the RepeatAttribute as well + + + + Write the string representation of a boolean value to the current result + + + Write a char to the current result + + + Write a char array to the current result + + + Write the string representation of a double to the current result + + + Write the string representation of an Int32 value to the current result + + + Write the string representation of an Int64 value to the current result + + + Write the string representation of a decimal value to the current result + + + Write the string representation of an object to the current result + + + Write the string representation of a Single value to the current result + + + Write a string to the current result + + + Write the string representation of a UInt32 value to the current result + + + Write the string representation of a UInt64 value to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a line terminator to the current result + + + Write the string representation of a boolean value to the current result followed by a line terminator + + + Write a char to the current result followed by a line terminator + + + Write a char array to the current result followed by a line terminator + + + Write the string representation of a double to the current result followed by a line terminator + + + Write the string representation of an Int32 value to the current result followed by a line terminator + + + Write the string representation of an Int64 value to the current result followed by a line terminator + + + Write the string representation of a decimal value to the current result followed by a line terminator + + + Write the string representation of an object to the current result followed by a line terminator + + + Write the string representation of a Single value to the current result followed by a line terminator + + + Write a string to the current result followed by a line terminator + + + Write the string representation of a UInt32 value to the current result followed by a line terminator + + + Write the string representation of a UInt64 value to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + + This method adds the a new ValueFormatterFactory to the + chain of responsibility used for formatting values in messages. + The scope of the change is the current TestContext. + + The factory delegate + + + + Attach a file to the current test result + + Relative or absolute file path to attachment + Optional description of attachment + + + + This method provides a simplified way to add a ValueFormatter + delegate to the chain of responsibility, creating the factory + delegate internally. It is useful when the Type of the object + is the only criterion for selection of the formatter, since + it can be used without getting involved with a compound function. + + The type supported by this formatter + The ValueFormatter delegate + + + + TestAdapter adapts a Test for consumption by + the user test code. + + + + + Construct a TestAdapter for a Test + + The Test to be adapted + + + + Gets the unique Id of a test + + + + + The name of the test, which may or may not be + the same as the method name. + + + + + The name of the method representing the test. + + + + + The FullName of the test + + + + + The ClassName of the test + + + + + A shallow copy of the properties of the test. + + + + + The arguments to use in creating the test or empty array if none are required. + + + + + ResultAdapter adapts a TestResult for consumption by + the user test code. + + + + + Construct a ResultAdapter for a TestResult + + The TestResult to be adapted + + + + Gets a ResultState representing the outcome of the test + up to this point in its execution. + + + + + Gets a list of the assertion results generated + up to this point in the test. + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + adapts an + for consumption by the user. + + + + + Construct a from a source + . + + + + + Get the first property with the given , if it can be found, otherwise + returns null. + + + + + Indicates whether is found in this + . + + + + + Returns a collection of properties + with the given . + + + + + Returns the count of elements with the given . + + + + + Returns a collection of the property keys. + + + + + The TestFixtureData class represents a set of arguments + and other parameter info to be used for a parameterized + fixture. It is derived from TestFixtureParameters and adds a + fluent syntax for use in initializing the fixture. + + + + + 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 name of the test fixture + + The modified TestFixtureData instance + + + + Sets the list of display names to use as the parameters in the test name. + + + + + Marks the test fixture as explicit. + + + + + Marks the test fixture as explicit, specifying the reason. + + + + + Ignores this TestFixture, specifying the reason. + + The reason. + + + + + TestParameters class holds any named parameters supplied to the test run + + + + + Gets the number of test parameters + + + + + Gets a collection of the test parameter names + + + + + Gets a flag indicating whether a parameter with the specified name exists. + + Name of the parameter + True if it exists, otherwise false + + + + Indexer provides access to the internal dictionary + + Name of the parameter + Value of the parameter or null if not present + + + + Get method is a simple alternative to the indexer + + Name of the parameter + Value of the parameter or null if not present + + + + Get the value of a parameter or a default string + + Name of the parameter + Default value of the parameter + Value of the parameter or default value if not present + + + + Get the value of a parameter or return a default + + The return Type + Name of the parameter + Default value of the parameter + Value of the parameter or default value if not present + + + + Adds a parameter to the list + + Name of the parameter + Value of the parameter + + + + Helper class with properties and methods that supply + constraints that operate on exceptions. + + + + + 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 ArgumentException + + + + + Creates a constraint specifying an expected ArgumentNullException + + + + + Creates a constraint specifying an expected InvalidOperationException + + + + + Creates a constraint specifying that no exception is thrown + + + + + 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 + + + + + Provides static methods to express conditions + that must be met for the test to succeed. If + any test fails, a warning is issued. + + + + + DO NOT USE! + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + Not applicable + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + 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 + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + 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 a warning is issued. + + 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 Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + fails and issuing a warning on success. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning on success. + + The Type being compared. + 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 + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + 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 a warning is issued. + + The evaluated condition + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning if it succeeds. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning if it succeeds. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + FrameworkPackageSettings is a static class containing constant values that + are used as keys in setting up a TestPackage. These values are used in + the framework, and set in the runner. Setting values may be a string, int or bool. + + + + + Flag (bool) indicating whether tests are being debugged. + + + + + Flag (bool) indicating whether to pause execution of tests to allow + the user to attach a debugger. + + + + + The InternalTraceLevel for this run. Values are: "Default", + "Off", "Error", "Warning", "Info", "Debug", "Verbose". + Default is "Off". "Debug" and "Verbose" are synonyms. + + + + + Full path of the directory to be used for work and result files. + This path is provided to tests by the framework TestContext. + + + + + Integer value in milliseconds for the default timeout value + for test cases. If not specified, there is no timeout except + as specified by attributes on the tests themselves. + + + + + A TextWriter to which the internal trace will be sent. + + + + + A list of tests to be loaded. + + + + + The number of test threads to run for the assembly. If set to + 1, a single queue is used. If set to 0, tests are executed + directly, without queuing. + + + + + The random seed to be used for this assembly. If specified + as the value reported from a prior run, the framework should + generate identical random values for tests as were used for + that run, provided that no change has been made to the test + assembly. Default is a random value itself. + + + + + If true, execution stops after the first error or failure. + + + + + If true, use of the event queue is suppressed and test events are synchronous. + + + + + The default naming pattern used in generating test names + + + + + Parameters to be passed on to the tests, serialized to a single string which needs parsing. Obsoleted by ; kept for backward compatibility. + + + + + Parameters to be passed on to the tests, already parsed into an IDictionary<string, string>. Replaces . + + + + + If true, the tests will run on the same thread as the NUnit runner itself + + + + + Provides a platform-independent methods for getting attributes + for use by AttributeConstraint and AttributeExistsConstraint. + + + + + Gets the custom attributes from the given object. + + The actual. + Type of the attribute. + if set to true [inherit]. + A list of the given attribute on the given object. + + + + A MarshalByRefObject that lives forever + + + + + Obtains a lifetime service object to control the lifetime policy for this instance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Provides NUnit specific extensions to aid in Reflection + across multiple frameworks + + + This version of the class supplies GetTypeInfo() on platforms + that don't support it. + + + + + GetTypeInfo gives access to most of the Type information we take for granted + on .NET Core and Windows Runtime. Rather than #ifdef different code for different + platforms, it is easiest to just code all platforms as if they worked this way, + thus the simple passthrough. + + + + + + + See . + + + + + Extensions for Assembly that are not available in pre-4.5 .NET releases + + + + + An easy way to get a single custom attribute from an assembly + + The attribute Type + The assembly + An attribute of Type T + + + + Extensions for MethodInfo that are not available in pre-4.5 .NET releases + + + + + See . + + + + + Represents a thread-safe first-in, first-out collection of objects. + + Specifies the type of elements in the queue. + + All public and protected members of are thread-safe and may be used + concurrently from multiple threads. + + + + + Initializes a new instance of the class. + + + + + Initializes the contents of the queue from an existing collection. + + A collection from which to copy elements. + + + + Initializes a new instance of the + class that contains elements copied from the specified collection + + The collection whose elements are copied to the new . + The argument is + null. + + + + Get the data array to be serialized + + + + + Construct the queue from a previously seiralized one + + + + + Copies the elements of the to an , starting at a particular + index. + + The one-dimensional Array that is the + destination of the elements copied from the + . The Array must have zero-based indexing. + The zero-based index in at which copying + begins. + is a null reference (Nothing in + Visual Basic). + is less than + zero. + + is multidimensional. -or- + does not have zero-based indexing. -or- + is equal to or greater than the length of the + -or- The number of elements in the source is + greater than the available space from to the end of the destination + . -or- The type of the source cannot be cast automatically to the type of the + destination . + + + + + Gets a value indicating whether access to the is + synchronized with the SyncRoot. + + true if access to the is synchronized + with the SyncRoot; otherwise, false. For , this property always + returns false. + + + + Gets an object that can be used to synchronize access to the . This property is not supported. + + The SyncRoot property is not supported. + + + + Returns an enumerator that iterates through a collection. + + An that can be used to iterate through the collection. + + + + Attempts to add an object to the . + + The object to add to the . The value can be a null + reference (Nothing in Visual Basic) for reference types. + + true if the object was added successfully; otherwise, false. + For , this operation will always add the object to the + end of the + and return true. + + + + Attempts to remove and return an object from the . + + + When this method returns, if the operation was successful, contains the + object removed. If no object was available to be removed, the value is unspecified. + + true if an element was removed and returned succesfully; otherwise, false. + For , this operation will attempt to remove the object + from the beginning of the . + + + + + Gets a value that indicates whether the is empty. + + true if the is empty; otherwise, false. + + For determining whether the collection contains any items, use of this property is recommended + rather than retrieving the number of items from the property and comparing it + to 0. However, as this collection is intended to be accessed concurrently, it may be the case + that another thread will modify the collection after returns, thus invalidating + the result. + + + + + Copies the elements stored in the to a new array. + + A new array containing a snapshot of elements copied from the . + + + + Copies the elements to a new . + + A new containing a snapshot of + elements copied from the . + + + + Store the position of the current head and tail positions. + + return the head segment + return the tail segment + return the head offset, value range [0, SEGMENT_SIZE] + return the tail offset, value range [-1, SEGMENT_SIZE-1] + + + + Gets the number of elements contained in the . + + The number of elements contained in the . + + For determining whether the collection contains any items, use of the + property is recommended rather than retrieving the number of items from the + property and comparing it to 0. + + + + + Copies the elements to an existing one-dimensional Array, starting at the specified array index. + + The one-dimensional Array that is the + destination of the elements copied from the + . The Array must have zero-based + indexing. + The zero-based index in at which copying + begins. + is a null reference (Nothing in + Visual Basic). + is less than + zero. + is equal to or greater than the + length of the + -or- The number of elements in the source is greater than the + available space from to the end of the destination . + + + + + Returns an enumerator that iterates through the . + + An enumerator for the contents of the . + + The enumeration represents a moment-in-time snapshot of the contents + of the queue. It does not reflect any updates to the collection after + GetEnumerator was called. The enumerator is safe to use + concurrently with reads from and writes to the queue. + + + + + Helper method of GetEnumerator to seperate out yield return statement, and prevent lazy evaluation. + + + + + Adds an object to the end of the . + + The object to add to the end of the . The value can be a null reference + (Nothing in Visual Basic) for reference types. + + + + + Attempts to remove and return the object at the beginning of the . + + + When this method returns, if the operation was successful, contains the + object removed. If no object was available to be removed, the value is unspecified. + + true if an element was removed and returned from the beggining of the + succesfully; otherwise, false. + + + + Attempts to return an object from the beginning of the + without removing it. + + When this method returns, contains an object from + the beginning of the or an + unspecified value if the operation failed. + true if and object was returned successfully; otherwise, false. + + + + private class for ConcurrentQueue. + a queue is a linked list of small arrays, each node is called a segment. + A segment contains an array, a pointer to the next segment, and m_low, m_high indices recording + the first and last valid elements of the array. + + + + + Create and initialize a segment with the specified index. + + + + + return the next segment + + + + + return true if the current segment is empty (doesn't have any element available to dequeue, + false otherwise + + + + + Add an element to the tail of the current segment + exclusively called by ConcurrentQueue.InitializedFromCollection + InitializeFromCollection is responsible to guaratee that there is no index overflow, + and there is no contention + + + + + + Create a new segment and append to the current one + Does not update the m_tail pointer + exclusively called by ConcurrentQueue.InitializedFromCollection + InitializeFromCollection is responsible to guaratee that there is no index overflow, + and there is no contention + + the reference to the new Segment + + + + Create a new segment and append to the current one + Update the m_tail pointer + This method is called when there is no contention + + + + + Try to append an element at the end of this segment. + + the element to append + true if the element is appended, false if the current segment is full + if appending the specified element succeeds, and after which the segment is full, + then grow the segment + + + + try to remove an element from the head of current segment + + The result. + return false only if the current segment is empty + + + + try to peek the current segment + + holds the return value of the element at the head position, + value set to default(T) if there is no such an element + true if there are elements in the current segment, false otherwise + + + + Adds part or all of the current segment into a List. + + the list to which to add + the start position + the end position + + + + return the position of the head of the current segment + Value range [0, SEGMENT_SIZE], if it's SEGMENT_SIZE, it means this segment is exhausted and thus empty + + + + + return the logical position of the tail of the current segment + Value range [-1, SEGMENT_SIZE-1]. When it's -1, it means this is a new segment and has no elemnet yet + + + + + A wrapper struct for volatile bool, please note the copy of the struct it self will not be volatile + for example this statement will not include in volatilness operation volatileBool1 = volatileBool2 the jit will copy the struct and will ignore the volatile + + + + + Defines methods to manipulate thread-safe collections intended for producer/consumer usage. + + Specifies the type of elements in the collection. + + All implementations of this interface must enable all members of this interface + to be used concurrently from multiple threads. + + + + + Copies the elements of the to + an + , starting at a specified index. + + The one-dimensional that is the destination of + the elements copied from the . + The array must have zero-based indexing. + The zero-based index in at which copying + begins. + is a null reference (Nothing in + Visual Basic). + is less than + zero. + is equal to or greater than the + length of the + -or- The number of elements in the source is greater than the + available space from to the end of the destination . + + + + + Attempts to add an object to the . + + The object to add to the . + true if the object was added successfully; otherwise, false. + The was invalid for this collection. + + + + Attempts to remove and return an object from the . + + + When this method returns, if the object was removed and returned successfully, contains the removed object. If no object was available to be removed, the value is + unspecified. + + true if an object was removed and returned successfully; otherwise, false. + + + + Copies the elements contained in the to a new array. + + A new array containing the elements copied from the . + + + + A debugger view of the IProducerConsumerCollection that makes it simple to browse the + collection's contents at a point in time. + + The type of elements stored within. + + + + Constructs a new debugger view object for the provided collection object. + + A collection to browse in the debugger. + + + + Returns a snapshot of the underlying collection's elements. + + + + + + + + + + + + + + + + + + + + + + + + + Compatibility polyfill based on . + + + + + Provides support for spin-based waiting. + + + + encapsulates common spinning logic. On single-processor machines, yields are + always used instead of busy waits, and on computers with Intel� processors employing Hyper-Threading� + technology, it helps to prevent hardware thread starvation. SpinWait encapsulates a good mixture of + spinning and true yielding. + + + is a value type, which means that low-level code can utilize SpinWait without + fear of unnecessary allocation overheads. SpinWait is not generally useful for ordinary applications. + In most cases, you should use the synchronization classes provided by the .NET Framework, such as + . For most purposes where spin waiting is required, however, + the type should be preferred over the method. + + + While SpinWait is designed to be used in concurrent applications, it is not designed to be + used from multiple threads concurrently. SpinWait's members are not thread-safe. If multiple + threads must spin, each should use its own instance of SpinWait. + + + + + + Gets the number of times has been called on this instance. + + + + + Gets whether the next call to will yield the processor, triggering a + forced context switch. + + Whether the next call to will yield the processor, triggering a + forced context switch. + + On a single-CPU machine, always yields the processor. On machines with + multiple CPUs, may yield after an unspecified number of calls. + + + + + Performs a single spin. + + + This is typically called in a loop, and may change in behavior based on the number of times a + has been called thus far on this instance. + + + + + Resets the spin counter. + + + This makes and behave as though no calls + to had been issued on this instance. If a instance + is reused many times, it may be useful to reset it to avoid yielding too soon. + + + + + Spins until the specified condition is satisfied. + + A delegate to be executed over and over until it returns true. + The argument is null. + + + + Spins until the specified condition is satisfied or until the specified timeout is expired. + + A delegate to be executed over and over until it returns true. + + A that represents the number of milliseconds to wait, + or a TimeSpan that represents -1 milliseconds to wait indefinitely. + True if the condition is satisfied within the timeout; otherwise, false + The argument is null. + is a negative number + other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater than + . + + + + Spins until the specified condition is satisfied or until the specified timeout is expired. + + A delegate to be executed over and over until it returns true. + The number of milliseconds to wait, or (-1) to wait indefinitely. + True if the condition is satisfied within the timeout; otherwise, false + The argument is null. + is a + negative number other than -1, which represents an infinite time-out. + + + + A helper class to get the number of processors, it updates the numbers of processors every sampling interval. + + + + + Gets the number of available processors + + + + + Gets whether the current machine has only a single processor. + + + + + A helper class to capture a start time using Environment.TickCout as a time in milliseconds, also updates a given timeout bu subtracting the current time from + the start time + + + + + Returns the Environment.TickCount as a start time in milliseconds as a uint, TickCount tools over from postive to negative every ~ 25 days + then ~25 days to back to positive again, uint is sued to ignore the sign and double the range to 50 days + + + + + + Helper function to measure and update the elapsed time + + The first time (in milliseconds) observed when the wait started + The orginal wait timeoutout in milliseconds + The new wait time in milliseconds, -1 if the time expired + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/NUnit.3.11.0/lib/net35/nunit.framework.dll b/packages/NUnit.3.11.0/lib/net35/nunit.framework.dll new file mode 100644 index 0000000000000000000000000000000000000000..5d31b081bf1b0c61ba72fd5fabe6d152ba8ce18b Binary files /dev/null and b/packages/NUnit.3.11.0/lib/net35/nunit.framework.dll differ diff --git a/packages/NUnit.3.11.0/lib/net35/nunit.framework.pdb b/packages/NUnit.3.11.0/lib/net35/nunit.framework.pdb new file mode 100644 index 0000000000000000000000000000000000000000..0022e1be2d4ce0b8de9bd3f4053b67e10cbe7f0c Binary files /dev/null and b/packages/NUnit.3.11.0/lib/net35/nunit.framework.pdb differ diff --git a/packages/NUnit.3.11.0/lib/net35/nunit.framework.xml b/packages/NUnit.3.11.0/lib/net35/nunit.framework.xml new file mode 100644 index 0000000000000000000000000000000000000000..c8919a46199d4e1a8569ca7722f145b8d0a7476f --- /dev/null +++ b/packages/NUnit.3.11.0/lib/net35/nunit.framework.xml @@ -0,0 +1,21109 @@ + + + + nunit.framework + + + + + 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 + + + + + DefaultTestAssemblyBuilder loads a single assembly and builds a TestSuite + containing test fixtures present in the assembly. + + + + + The default suite builder used by the test assembly builder. + + + + + Initializes a new instance of the class. + + + + + Build a suite of tests from a provided assembly + + The assembly from which tests are to be built + A dictionary of options to use in building the suite + + A TestSuite containing the tests found in the assembly + + + + + Build a suite of tests given the name or the location of an assembly + + The name or the location of the assembly. + A dictionary of options to use in building the suite + + A TestSuite containing the tests found in the assembly + + + + + FrameworkController provides a facade for use in loading, browsing + and running tests without requiring a reference to the NUnit + framework. All calls are encapsulated in constructors for + this class and its nested classes, which only require the + types of the Common Type System as arguments. + + The controller supports four actions: Load, Explore, Count and Run. + They are intended to be called by a driver, which should allow for + proper sequencing of calls. Load must be called before any of the + other actions. The driver may support other actions, such as + reload on run, by combining these calls. + + + + + Construct a FrameworkController using the default builder and runner. + + The AssemblyName or path to the test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + + + + Construct a FrameworkController using the default builder and runner. + + The test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + + + + Construct a FrameworkController, specifying the types to be used + for the runner and builder. This constructor is provided for + purposes of development. + + The full AssemblyName or the path to the test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + The Type of the test runner + The Type of the test builder + + + + Construct a FrameworkController, specifying the types to be used + for the runner and builder. This constructor is provided for + purposes of development. + + The test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + The Type of the test runner + The Type of the test builder + + + + Gets the ITestAssemblyBuilder used by this controller instance. + + The builder. + + + + Gets the ITestAssemblyRunner used by this controller instance. + + The runner. + + + + Gets the AssemblyName or the path for which this FrameworkController was created + + + + + Gets the Assembly for which this + + + + + Gets a dictionary of settings for the FrameworkController + + + + + Loads the tests in the assembly + + + + + + Returns info about the tests in an assembly + + A string containing the XML representation of the filter to use + The XML result of exploring the tests + + + + Runs the tests in an assembly + + A string containing the XML representation of the filter to use + The XML result of the test run + + + + Runs the tests in an assembly synchronously reporting back the test results through the callback + or through the return value + + The callback that receives the test results + A string containing the XML representation of the filter to use + The XML result of the test run + + + + Runs the tests in an assembly asynchronously reporting back the test results through the callback + + The callback that receives the test results + A string containing the XML representation of the filter to use + + + + Stops the test run + + True to force the stop, false for a cooperative stop + + + + Counts the number of test cases in the loaded TestSuite + + A string containing the XML representation of the filter to use + The number of tests + + + + Inserts environment element + + Target node + The new node + + + + Inserts settings element + + Target node + Settings dictionary + The new node + + + + FrameworkControllerAction is the base class for all actions + performed against a FrameworkController. + + + + + LoadTestsAction loads a test into the FrameworkController + + + + + LoadTestsAction loads the tests in an assembly. + + The controller. + The callback handler. + + + + ExploreTestsAction returns info about the tests in an assembly + + + + + Initializes a new instance of the class. + + The controller for which this action is being performed. + Filter used to control which tests are included (NYI) + The callback handler. + + + + CountTestsAction counts the number of test cases in the loaded TestSuite + held by the FrameworkController. + + + + + Construct a CountsTestAction and perform the count of test cases. + + A FrameworkController holding the TestSuite whose cases are to be counted + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + RunTestsAction runs the loaded TestSuite held by the FrameworkController. + + + + + Construct a RunTestsAction and run all tests in the loaded TestSuite. + + A FrameworkController holding the TestSuite to run + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + RunAsyncAction initiates an asynchronous test run, returning immediately + + + + + Construct a RunAsyncAction and run all tests in the loaded TestSuite. + + A FrameworkController holding the TestSuite to run + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + StopRunAction stops an ongoing run. + + + + + Construct a StopRunAction and stop any ongoing run. If no + run is in process, no error is raised. + + The FrameworkController for which a run is to be stopped. + True the stop should be forced, false for a cooperative stop. + >A callback handler used to report results + A forced stop will cause threads and processes to be killed as needed. + + + + The ITestAssemblyBuilder interface is implemented by a class + that is able to build a suite of tests given an assembly or + an assembly filename. + + + + + Build a suite of tests from a provided assembly + + The assembly from which tests are to be built + A dictionary of options to use in building the suite + A TestSuite containing the tests found in the assembly + + + + Build a suite of tests given the filename of an assembly + + The filename of the assembly from which tests are to be built + A dictionary of options to use in building the suite + A TestSuite containing the tests found in the assembly + + + + The ITestAssemblyRunner interface is implemented by classes + that are able to execute a suite of tests loaded + from an assembly. + + + + + Gets the tree of loaded tests, or null if + no tests have been loaded. + + + + + Gets the tree of test results, if the test + run is completed, otherwise null. + + + + + Indicates whether a test has been loaded + + + + + Indicates whether a test is currently running + + + + + Indicates whether a test run is complete + + + + + Loads the tests found in an Assembly, returning an + indication of whether or not the load succeeded. + + File name of the assembly to load + Dictionary of options to use in loading the test + An ITest representing the loaded tests + + + + Loads the tests found in an Assembly, returning an + indication of whether or not the load succeeded. + + The assembly to load + Dictionary of options to use in loading the test + An ITest representing the loaded tests + + + + Count Test Cases using a filter + + The filter to apply + The number of test cases found + + + + Explore the test cases using a filter + + The filter to apply + Test Assembly with test cases that matches the filter + + + + Run selected tests and return a test result. The test is run synchronously, + and the listener interface is notified as it progresses. + + Interface to receive ITestListener notifications. + A test filter used to select tests to be run + + + + Run selected tests asynchronously, notifying the listener interface as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + + + Wait for the ongoing run to complete. + + Time to wait in milliseconds + True if the run completed, otherwise false + + + + Signal any test run that is in process to stop. Return without error if no test is running. + + If true, kill any test-running threads + + + + Implementation of ITestAssemblyRunner + + + + + Initializes a new instance of the class. + + The builder. + + + + Gets the default level of parallel execution (worker threads) + + + + + The tree of tests that was loaded by the builder + + + + + The test result, if a run has completed + + + + + Indicates whether a test is loaded + + + + + Indicates whether a test is running + + + + + Indicates whether a test run is complete + + + + + Our settings, specified when loading the assembly + + + + + The top level WorkItem created for the assembly as a whole + + + + + The TestExecutionContext for the top level WorkItem + + + + + Loads the tests found in an Assembly + + File name or path of the assembly to load + Dictionary of option settings for loading the assembly + True if the load was successful + + + + Loads the tests found in an Assembly + + The assembly to load + Dictionary of option settings for loading the assembly + True if the load was successful + + + + Count Test Cases using a filter + + The filter to apply + The number of test cases found + + + + Explore the test cases using a filter + + The filter to apply + Test Assembly with test cases that matches the filter + + + + Run selected tests and return a test result. The test is run synchronously, + and the listener interface is notified as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + + + + Run selected tests asynchronously, notifying the listener interface as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + RunAsync is a template method, calling various abstract and + virtual methods to be overridden by derived classes. + + + + + Wait for the ongoing run to complete. + + Time to wait in milliseconds + True if the run completed, otherwise false + + + + Signal any test run that is in process to stop. Return without error if no test is running. + + If true, kill any tests that are currently running + + + + Initiate the test run. + + + + + Create the initial TestExecutionContext used to run tests + + The ITestListener specified in the RunAsync call + + + + Handle the Completed event for the top level work item + + + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + + + Verifies that the first int is greater than the second + int. 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 int is greater than the second + int. 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Verifies that the first value is greater than or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Asserts that an int is zero. + + The number to be examined + + + + Asserts that an int is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is zero. + + The number to be examined + + + + Asserts that an unsigned int is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is zero. + + The number to be examined + + + + Asserts that a Long is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is zero. + + The number to be examined + + + + Asserts that an unsigned Long is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is zero. + + The number to be examined + + + + Asserts that a decimal is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is zero. + + The number to be examined + + + + Asserts that a double is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is zero. + + The number to be examined + + + + Asserts that a float is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is not zero. + + The number to be examined + + + + Asserts that an int is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is not zero. + + The number to be examined + + + + Asserts that an unsigned int is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is not zero. + + The number to be examined + + + + Asserts that a Long is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is not zero. + + The number to be examined + + + + Asserts that an unsigned Long is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is zero. + + The number to be examined + + + + Asserts that a decimal is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is zero. + + The number to be examined + + + + Asserts that a double is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is zero. + + The number to be examined + + + + Asserts that a float is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is positive. + + The number to be examined + + + + Asserts that an int is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is positive. + + The number to be examined + + + + Asserts that an unsigned int is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is positive. + + The number to be examined + + + + Asserts that a Long is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is positive. + + The number to be examined + + + + Asserts that an unsigned Long is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is positive. + + The number to be examined + + + + Asserts that a decimal is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is positive. + + The number to be examined + + + + Asserts that a double is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is positive. + + The number to be examined + + + + Asserts that a float is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is negative. + + The number to be examined + + + + Asserts that an int is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is negative. + + The number to be examined + + + + Asserts that an unsigned int is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is negative. + + The number to be examined + + + + Asserts that a Long is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is negative. + + The number to be examined + + + + Asserts that an unsigned Long is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is negative. + + The number to be examined + + + + Asserts that a decimal is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is negative. + + The number to be examined + + + + Asserts that a double is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is negative. + + The number to be examined + + + + Asserts that a float is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + DO NOT USE! Use Assert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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. + + + + + Issues a warning using the message and arguments provided. + + The message to display. + Arguments to be used in formatting the message + + + + Issues a warning using the message provided. + + The message to display. + + + + 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. + + + + + Asserts that an object is contained in a collection. + + The expected object + The collection 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 collection. + + The expected object + The collection to be examined + + + + Wraps code containing a series of assertions, which should all + be executed, even if they fail. Failed results are saved and + reported at the end of the code block. + + A TestDelegate to be executed in Multiple Assertion mode. + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + 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 TestDelegate + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + 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 TestDelegate + + + + 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 + + + + 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 + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it 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 of a certain Type + or one derived from it when called and returns it. + + A TestDelegate + + + + Verifies that a delegate does not throw an exception + + A TestDelegate + 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 TestDelegate + + + + 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 + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + 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. + + The actual value to test + A Constraint expression to be applied + + + + 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. + + The actual value to test + A Constraint expression to be applied + The message that will be displayed on failure + Arguments 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 + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Delegate used by tests that execute code and + capture any thrown exception. + + + + + AssertionHelper is an optional base class for user tests, + allowing the use of shorter names in making asserts. + + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to + . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to . + + The evaluated condition + + + + 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. + + 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 + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + 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 + + + + 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 + + + + Returns a ListMapper based on a collection. + + The original collection + + + + + 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 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 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 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 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 equality with zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new 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 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 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 regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression 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 a subpath of the 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. + + + + + 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. + + + + + DO NOT USE! + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + Not applicable + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + 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 + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + 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 InconclusiveException on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Marks a test as needing to be run in a particular threading apartment state. This will cause it + to run in a separate thread if necessary. + + + + + Construct an ApartmentAttribute + + The apartment state that this test must be run under. You must pass in a valid apartment state. + + + + Provides the author of a test or test fixture. + + + + + Initializes a new instance of the class. + + The name of the author. + + + + Initializes a new instance of the class. + + The name of the author. + The email address of the author. + + + + Applies 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 + + + + + Modifies a test by adding a category to it. + + The test to modify + + + + Marks a test to use a combinatorial join of any argument data provided. + Since this is the default, the attribute is optional. + + + + + Default constructor + + + + + Marks a test as using a particular CombiningStrategy to join any supplied parameter data. + Since this is the default, the attribute is optional. + + + + + Construct a CombiningStrategyAttribute incorporating an + ICombiningStrategy and an IParameterDataProvider. + + Combining strategy to be used in combining data + An IParameterDataProvider to supply data + + + + Construct a CombiningStrategyAttribute incorporating an object + that implements ICombiningStrategy and an IParameterDataProvider. + This constructor is provided for CLS compliance. + + Combining strategy to be used in combining data + An IParameterDataProvider to supply data + + + + Builds any number of tests from the specified method and context. + + The MethodInfo for which tests are to be constructed. + The suite to which the tests will be added. + + + + Modify the test by adding the name of the combining strategy + to the properties. + + The test to modify + + + + Marks an assembly, test fixture or test method as applying to a specific Culture. + + + + + Constructor with no cultures specified, for use + with named property syntax. + + + + + Constructor taking one or more cultures + + Comma-delimited list of cultures + + + + Causes a test to be skipped if this CultureAttribute is not satisfied. + + The test to modify + + + + Tests to determine if the current culture is supported + based on the properties of this attribute. + + True, if the current culture is supported + + + + Test to determine if the a particular culture or comma- + delimited set of cultures is in use. + + Name of the culture or comma-separated list of culture ids + True if the culture is in use on the system + + + + Test to determine if one of a collection of cultures + is being used currently. + + + + + + + Abstract base class for all data-providing attributes defined by NUnit. + Used to select all data sources for a method, class or parameter. + + + + + Default constructor + + + + + Marks a field for use as a datapoint when executing a theory within + the same fixture that requires an argument of the field's Type. + + + + + Marks a field, property or method as providing a set of datapoints for use + in executing any theories within the same fixture that require an argument of + the provided Type. The data source may provide an array of the required Type + or an . Synonymous with . + + + + + Marks a field, property or method as providing a set of datapoints for use + in executing any theories within the same fixture that require an argument + of the provided type. The data source may provide an array of the required + Type or an . Synonymous with . + + + + + Sets the tolerance used by default when checking the equality of floating point values + within the test assembly, fixture or method. + + + + + Construct specifying an amount + + + + + + Apply changes to the TestExecutionContext + + The TestExecutionContext + + + + Provides the descriptive text relating to the assembly, test fixture or test method. + + + + + Construct a description Attribute + + The text of the description + + + + Marks an assembly, test fixture or test method such that it will only run if explicitly + executed from the GUI, command line or included within a test 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 + + + + Modifies a test by marking it as explicit. + + The test to modify + + + + Marks an assembly, test fixture or test method as being ignored. Ignored tests result in a warning message when the tests are run. + + + + + Constructs the attribute giving a reason for ignoring the test + + The reason for ignoring the test + + + + The date in the future to stop ignoring the test as a string in UTC time. + For example for a date and time, "2014-12-25 08:10:00Z" or for just a date, + "2014-12-25". If just a date is given, the Ignore will expire at midnight UTC. + + + Once the ignore until date has passed, the test will be marked + as runnable. Tests with an ignore until date will have an IgnoreUntilDate + property set which will appear in the test results. + + The string does not contain a valid string representation of a date and time. + + + + Modifies a test by marking it as Ignored. + + The test to modify + + + + 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 items 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 + + + + + Sets the number of worker threads that may be allocated by the framework + for running tests. + + + + + Construct a LevelOfParallelismAttribute. + + The number of worker threads to be created by the framework. + + + + Specifies the maximum time (in milliseconds) for a test case to succeed. + + + + + Construct a MaxTimeAttribute, given a time in milliseconds. + + The maximum elapsed time in milliseconds + + + + Marks tests that should NOT be run in parallel. + + + + + Construct a NonParallelizableAttribute. + + + + + Used by third-party frameworks, or other software, that reference + the NUnit framework but do not contain any tests. Applying the + attribute indicates that the assembly is not a test assembly and + may prevent errors if certain runners attempt to load the assembly. + Note that recognition of the attribute depends on each individual runner. + + + + + Abstract base class for all custom attributes defined by NUnit. + + + + + Default constructor + + + + + Identifies a method that is called once to perform setup before any child tests are run. + + + + + Identifies a method to be called once after all the child tests have run. + The method is guaranteed to be called, even if an exception is thrown. + + + + + Defines the order that the test will run in + + + + + Defines the order that the test will run in + + + + + Defines the order that the test will run in + + + + + + Modifies a test as defined for the specific attribute. + + The test to modify + + + + Marks a test as using a pairwise join of any supplied argument data. Arguments will be + combined in such a way that all possible pairs of arguments are used. + + + + + Default constructor + + + + + Marks a test assembly, fixture or method that may be run in parallel. + + + + + Construct a ParallelizableAttribute using default ParallelScope.Self. + + + + + Construct a ParallelizableAttribute with a specified scope. + + The ParallelScope associated with this attribute. + + + + Defines the degree to which this test and its descendants may be run in parallel + + + + + Overridden to check for invalid combinations of settings + + + + + + Modify the context to be used for child tests + + The current TestExecutionContext + + + + Specifies the degree to which a test, and its descendants, + may be run in parallel. + + + + + No ParallelScope was specified on the test + + + + + The test may be run in parallel with others at the same level. + Valid on classes and methods but not assemblies. + + + + + Test may not be run in parallel with any others. Valid on + classes and methods but not assemblies. + + + + + Mask used to extract the flags that apply to the item on which a + ParallelizableAttribute has been placed, as opposed to descendants. + + + + + Descendants of the test may be run in parallel with one another. + Valid on assemblies and classes but not on methods. + + + + + Descendants of the test down to the level of TestFixtures may be + run in parallel with one another. Valid on assemblies and classes + but not on methods. + + + + + Mask used to extract all the flags that impact descendants of a + test and place them in the TestExecutionContext. + + + + + The test and its descendants may be run in parallel with others at + the same level. Valid on classes and methods but not assemblies. + + + + + Marks an assembly, test fixture or test method as applying to a specific platform. + + + + + Constructor with no platforms specified, for use + with named property syntax. + + + + + Constructor taking one or more platforms + + Comma-delimited list of platforms + + + + Causes a test to be skipped if this PlatformAttribute is not satisfied. + + The test to modify + + + + Attaches information to a test assembly, fixture or method 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 + + + + + Modifies a test by adding properties to it. + + The test to modify + + + + Supplies a set of random values to a single parameter of a parameterized test. + + + + + If true, no value will be repeated. + + + + + Construct a random set of values appropriate for the Type of the + parameter on which the attribute appears, specifying only the count. + + + + + + Construct a set of ints within a specified range + + + + + Construct a set of unsigned ints within a specified range + + + + + Construct a set of longs within a specified range + + + + + Construct a set of unsigned longs within a specified range + + + + + Construct a set of shorts within a specified range + + + + + Construct a set of unsigned shorts within a specified range + + + + + Construct a set of doubles within a specified range + + + + + Construct a set of floats within a specified range + + + + + Construct a set of bytes within a specified range + + + + + Construct a set of sbytes within a specified range + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + Supplies 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 unsigned ints using default step of 1 + + + + + Construct a range of unsigned ints specifying the step size + + + + + Construct a range of longs using a default step of 1 + + + + + Construct a range of longs + + + + + Construct a range of unsigned longs using default step of 1 + + + + + Construct a range of unsigned longs specifying the step size + + + + + Construct a range of doubles + + + + + Construct a range of floats + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + Returns a string that represents the current object. + + + + Specifies that a test should be run multiple times. + + + + + Construct a RepeatAttribute + + The number of times to run the test + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + The test command for the RepeatAttribute + + + + + Initializes a new instance of the class. + + The inner command. + The number of repetitions + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Marks a test that must run on a separate thread. + + + + + Construct a RequiresThreadAttribute + + + + + Construct a RequiresThreadAttribute, specifying the apartment + + + + + Specifies that a test method should be rerun on failure up to the specified + maximum number of times. + + + + + Construct a + + The maximum number of times the test should be run if it fails + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + The test command for the + + + + + Initializes a new instance of the class. + + The inner command. + The maximum number of repetitions + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Marks a test to use a sequential join of any provided argument data. + Arguments will be combined into test cases, taking the next value of + each argument until all are used. + + + + + Default constructor + + + + + Sets the current Culture on an assembly, test fixture or test method for + the duration of a test. The culture remains set until the test or fixture + completes and is then reset to its original value. + + + + + + Construct given the name of a culture + + + + + + Sets the current UI Culture on an assembly, test fixture or test method + for the duration of a test. The UI culture remains set until the test or + fixture completes and is then reset to its original value. + + + + + + Construct given the name of a culture + + + + + + Identifies a method to be called immediately before each test is run. + + + + + Identifies a class as containing or + methods for all the test fixtures + under a given namespace. + + + + + Builds a from the specified type. + + The type info of the fixture to be used. + + + + Marks a test fixture as requiring all child tests to be run on the + same thread as the OneTimeSetUp and OneTimeTearDown. A flag in the + is set forcing all child tests + to be run sequentially on the current thread. + Any setting is ignored. + + + + + Apply changes to the TestExecutionContext + + The TestExecutionContext + + + + Identifies a method to be called immediately after each test is run. + The method is guaranteed to be called, even if an exception is thrown. + + + + + Abstract attribute providing actions to execute before and after tests. + + + + + Executed before each test is run + + The test that is going to be run. + + + + Executed after each test is run + + The test that has just been run. + + + + Provides the target for the action attribute + + + + + Marks a test assembly as needing a special assembly resolution hook that will + explicitly search the test assembly's directory for dependent assemblies. + This works around a conflict between mixed-mode assembly initialization and + tests running in their own AppDomain in some cases. + + + + + Marks the method as callable from the NUnit test runner. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + public void TestDescriptionMethod() + {} + } + + + + + + Descriptive text for this test + + + + + The author of this test + + + + + The type that this test is testing + + + + + Gets or sets the expected result. Not valid if the test + method has parameters. + + The result. + + + + Modifies a test by adding a description, if not already set. + + The test to modify + + + + Builds a single test from the specified method and context. + + The method for which a test is to be constructed. + The suite to which the test will be added. + + + + Marks a method as a parameterized test suite and provides arguments for each test case. + + + + + 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 or sets the name of the test. + + The name of the test. + + + + Gets or sets the RunState of this test case. + + + + + Gets the list of arguments to a test case + + + + + Gets the properties of the test case + + + + + Gets or sets the expected result. + + The result. + + + + Returns true if the expected result has been set + + + + + Gets or sets the description. + + The description. + + + + The author of this test + + + + + The type that this test is testing + + + + + Gets or sets the reason for ignoring the test + + + + + Gets or sets a value indicating whether this is explicit. + + + true if explicit; otherwise, false. + + + + + Gets or sets the reason for not running the test. + + The reason. + + + + Gets or sets the ignore reason. When set to a non-null + non-empty value, the test is marked as ignored. + + The ignore reason. + + + + Comma-delimited list of platforms to run the test for + + + + + Comma-delimited list of platforms to not run the test for + + + + + Gets and sets the category for this test case. + May be a comma-separated list of categories. + + + + + Performs several special conversions allowed by NUnit in order to + permit arguments with types that cannot be used in the constructor + of an Attribute such as TestCaseAttribute or to simplify their use. + + The arguments to be converted + The ParameterInfo array for the method + + + + Performs several special conversions allowed by NUnit in order to + permit arguments with types that cannot be used in the constructor + of an Attribute such as TestCaseAttribute or to simplify their use. + + The argument to be converted + The target in which the should be converted + If conversion was successfully applied, the converted into + + true if was converted and should be used; + false is no conversion was applied and should be ignored + + + + + Builds a single test from the specified method and context. + + The MethodInfo for which tests are to be constructed. + The suite to which the tests will be added. + + + + Indicates the source to be used to provide test fixture instances for a test class. + + + + + Construct with the name of the method, property or field that will provide data + + The name of a static method, property or field that will provide data. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + + + + Construct with a name + + The name of a static method, property or field that will provide data. + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + Construct with a Type + + The type that will provide data + + + + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + + 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 every fixture created from + this attribute. May be a single category or a comma-separated list. + + + + + Builds any number of tests from the specified method and context. + + The IMethod for which tests are to be constructed. + The suite to which the tests will be added. + + + + Marks the class as a TestFixture. + + + + + 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. + + + + + + Gets or sets the name of the test. + + The name of the test. + + + + Gets or sets the RunState of this test fixture. + + + + + The arguments originally provided to the attribute + + + + + Properties pertaining to this fixture + + + + + Get or set the type arguments. If not set + explicitly, any leading arguments that are + Types are taken as type arguments. + + + + + Descriptive text for this fixture + + + + + The author of this fixture + + + + + The type that this fixture is testing + + + + + Gets or sets the ignore reason. May set RunState as a side effect. + + The ignore reason. + + + + Gets or sets the reason for not running the fixture. + + The reason. + + + + Gets or sets the ignore reason. When set to a non-null + non-empty value, the test is marked as ignored. + + The ignore reason. + + + + Gets or sets a value indicating whether this is explicit. + + + true if explicit; otherwise, false. + + + + + Gets and sets the category for this fixture. + May be a comma-separated list of categories. + + + + + Builds a single test fixture from the specified type. + + + + + Builds a single test fixture from the specified type. + + The type info of the fixture to be used. + Filter used to select methods as tests. + + + + Identifies the source used to provide test fixture instances for a test class. + + + + + Error message string is public so the tests can use it + + + + + Construct with the name of the method, property or field that will provide data + + The name of a static method, property or field that will provide data. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + + + + Construct with a Type + + The type 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 every fixture created from + this attribute. May be a single category or a comma-separated list. + + + + + Builds any number of test fixtures from the specified type. + + The TypeInfo for which fixtures are to be constructed. + + + + Builds any number of test fixtures from the specified type. + + The TypeInfo for which fixtures are to be constructed. + PreFilter used to select methods as tests. + + + + Returns a set of ITestFixtureData items for use as arguments + to a parameterized test fixture. + + The type for which data is needed. + + + + + Indicates the method or class the assembly, test fixture or test method is testing. + + + + + Initializes a new instance of the class. + + The type that is being tested. + + + + Initializes a new instance of the class. + + The type that is being tested. + + + + 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")] + public void TestDescriptionMethod() + {} + } + + + + + + Construct the attribute, specifying a combining strategy and source of parameter data. + + + + + Applies a timeout in milliseconds to a test. + When applied to a method, the test is cancelled if the timeout is exceeded. + When applied to a class or assembly, the default timeout is set for all contained test methods. + + + + + Construct a TimeoutAttribute given a time in milliseconds + + The timeout value in milliseconds + + + + Provides literal arguments for an individual parameter of a test. + + + + + 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 + + + + + Constructs for use with an Enum parameter. Will pass every enum + value in to the test. + + + + + Construct with one argument + + + + + + Construct with two arguments + + + + + + + Construct with three arguments + + + + + + + + Construct with an array of arguments + + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + To generate data for Values attribute, in case no data is provided. + + + + + To Check if type is nullable enum. + + + + + Indicates the source 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 a static method, property or field 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 a static 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 + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + A set of Assert methods operating on one or more collections + + + + + DO NOT USE! Use CollectionAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + 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 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 + 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 + 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 + 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 + 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 + 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 + 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 + Arguments to be used in formatting the message + + + + Asserts that the superset does not contain the subset + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + + + + Asserts that the superset does not contain the subset + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the superset contains the subset. + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + + + + Asserts that the superset contains the subset. + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the subset does not contain the superset + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that the subset does not contain the superset + + 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 the subset contains the superset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that the subset contains the superset. + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + AllItemsConstraint applies another constraint to each + item in a collection, succeeding if they all succeed. + + + + + Construct an AllItemsConstraint on top of an existing 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. + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + AndConstraint succeeds only if both members succeed. + + + + + Create an AndConstraint from two other constraints + + The first constraint + The second constraint + + + + Gets text describing a 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 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 + + + + is used to determine whether the value is equal to any of the expected values. + + + + + Construct a + + Collection of expected values + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether item is present in expected collection + + Actual item type + Actual item + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IEqualityComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + AssignableFromConstraint is used to test that an object + can be assigned from a given Type. + + + + + Construct an AssignableFromConstraint for the type provided + + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + AssignableToConstraint is used to test that an object + can be assigned to a given Type. + + + + + Construct an AssignableToConstraint for the type provided + + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + 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. + + + + + Constructs an AttributeConstraint for a specified attribute + Type and base constraint. + + + + + + + Determines whether the Type or other provider has the + expected attribute and if its value matches the + additional constraint specified. + + + + + Returns a string representation of the constraint. + + + + + AttributeExistsConstraint tests for the presence of a + specified attribute on a Type. + + + + + Constructs an AttributeExistsConstraint for a specific attribute Type + + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Tests whether the object provides the expected attribute. + + A Type, MethodInfo, or other ICustomAttributeProvider + True if the expected attribute is present, otherwise false + + + + 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 + + + + BinarySerializableConstraint tests whether + an object is serializable in binary format. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Returns the string representation + + + + + 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 + + + + + + + CollectionContainsConstraint is used to test whether a collection + contains an expected object as a member. + + + + + Construct a CollectionContainsConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Test whether the expected item is contained in the collection + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + CollectionEquivalentConstraint is used to determine whether two + collections are equivalent. + + + + The result of the from the collections + under comparison. + + + Construct a CollectionEquivalentConstraint + Expected collection. + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether two collections are equivalent + + + + + + + Test whether the collection is equivalent to the expected. + + + Actual collection type. + + + Actual collection to compare. + + + A indicating whether or not + the two collections are equivalent. + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + Provides a for the . + + + Result of a of the collections to compare for equivalence. + + + Maximum amount of elements to write to the if there are + extra/missing elements from the collection. + + + Construct a using a . + Source . + Result of the collection comparison. + Actual collection to compare. + Whether or not the succeeded. + + + Write any additional lines (following Expected: and But was:) for a failing constraint. + The to write the failure message to. + + + + CollectionItemsEqualConstraint is the abstract base class for all + collection constraints that apply some notion of item equality + as a part of their operation. + + + + + The NUnitEqualityComparer in use for this constraint + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Get a flag indicating whether the user requested us to ignore case. + + + + + Get a flag indicating whether any external comparers are in use. + + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + Compares two collection members for equality + + + + + Return a new CollectionTally for use in making tests + + The collection to be included in the tally + + + + CollectionOrderedConstraint is used to test whether a collection is ordered. + + + + + Construct a CollectionOrderedConstraint + + + + + 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. + + + + + If used performs a default ascending comparison + + + + + If used performs a reverse comparison + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use a and returns self. + + + + + Modifies the constraint to test ordering by the value of + a specified property and returns self. + + + + + Then signals a break between two ordering steps + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Test whether the collection is ordered + + + + + Returns the string representation of the constraint. + + + + + + An OrderingStep represents one stage of the sort + + + + + Constructor for success result. + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + + + + Constructor for failure result. + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + Index at which collection order breaks. + Value at which collection order breaks. + + + + 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 + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the actual collection is a subset of + the expected collection provided. + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + CollectionSupersetConstraint is used to determine whether + one collection is a superset of another + + + + + Construct a CollectionSupersetConstraint + + The collection that the actual value is expected to be a superset of + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the actual collection is a superset of + the expected collection provided. + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + counts (tallies) the number of occurrences + of each object in one or more enumerations. + + + The result of a . + + + Items that were not in the expected collection. + + + Items that were not accounted for in the expected collection. + + + Initializes a new instance of the class with the given fields. + + + The result of the comparison between the two collections. + + + Construct a CollectionTally object from a comparer and a collection. + The comparer to use for equality. + The expected collection to compare against. + + + Try to remove an object from the tally. + The object to remove. + + + Try to remove a set of objects from the tally. + The objects to remove. + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two types related by . + + + + + Interface for comparing two s. + + + + + Method for comparing two objects with a tolerance. + + The first object to compare. + The second object to compare. + The tolerance to use when comparing the objects. + Flag indicating whether or not this is the top level comparison. + + null if the objects cannot be compared using the method. + Otherwise the result of the comparison is returned. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s or s. + + + + + Comparator for two Tuples. + + + + + Base class for comparators for tuples (both regular Tuples and ValueTuples). + + + + + Comparator for two ValueTuples. + + + + + ComparisonAdapter class centralizes all comparisons of + values in NUnit, adapting to the use of any provided + , + or . + + + + + Gets the default ComparisonAdapter, which wraps an + NUnitComparer object. + + + + + Returns a ComparisonAdapter that wraps an + + + + + Returns a ComparisonAdapter that wraps an + + + + + Returns a ComparisonAdapter that wraps a + + + + + Compares two objects + + + + + Construct a default ComparisonAdapter + + + + + Construct a ComparisonAdapter for an + + + + + Compares two objects + + + + + + + + ComparerAdapter extends and + allows use of an or + to actually perform the comparison. + + + + + Construct a ComparisonAdapter for an + + + + + Compare a Type T to an object + + + + + Construct a ComparisonAdapter for a + + + + + Compare a Type T to an object + + + + + Abstract base class for constraints that compare values to + determine if one is greater than, equal to or less than + the other. + + + + + The value against which a comparison is to be made + + + + + Tolerance used in making the comparison + + + + + ComparisonAdapter to be used in making the comparison + + + + + Initializes a new instance of the class. + + The value against which to make a comparison. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + A ConstraintResult + + + + Protected function overridden by derived class to actually perform the comparison + + + + + Modifies the constraint to use an and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Modifies the constraint to use an and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Modifies the constraint to use a and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Set the tolerance for use in this comparison + + + + + Switches the .Within() modifier to interpret its tolerance as + a percentage that the actual values is allowed to deviate from + the expected value. + + Self + + + + Delegate used to delay evaluation of the actual value + to be used in evaluating a constraint + + + + + The Constraint class is the base of all built-in constraints + within NUnit. It provides the operator overloads used to combine + constraints. + + + + + Construct a constraint with optional arguments + + Arguments to be saved + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Arguments provided to this Constraint, for use in + formatting the description. + + + + + The ConstraintBuilder holding this constraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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 + A ConstraintResult + + + + Retrieves the value to be tested from an ActualValueDelegate. + The default implementation simply evaluates the delegate but derived + classes may override it to provide for delayed processing. + + An ActualValueDelegate + Delegate evaluation result + + + + 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 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. + + + + + Returns a DelayedConstraint.WithRawDelayInterval with the specified delay time. + + The delay, which defaults to milliseconds. + + + + + Returns a DelayedConstraint with the specified delay time + and polling interval. + + The delay in milliseconds. + The interval at which to test the constraint. + + + + + Resolves any pending operators and returns the resolved 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 reorganized. a ConstraintStack holds + input constraints as well as the results of each + operator applied. + + + + + OperatorStack is a type-safe stack for holding ConstraintOperators + + + + + Initializes a new instance of the class. + + The ConstraintBuilder using this stack. + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost operator without modifying the stack. + + + + + Pushes the specified operator onto the stack. + + The operator to put onto the stack. + + + + Pops the topmost operator from the stack. + + The topmost operator on the stack + + + + ConstraintStack is a type-safe stack for holding Constraints + + + + + Initializes a new instance of the class. + + The ConstraintBuilder using this stack. + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Pushes the specified constraint. As a side effect, + the constraint's Builder field is set to the + ConstraintBuilder owning this stack. + + The constraint to put onto the stack + + + + Pops this topmost constraint from the stack. + As a side effect, the constraint's Builder + field is set to null. + + The topmost constraint on the stack + + + + 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 expression 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. + + + + + 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 + reorganized. When a constraint is appended, it is returned as the + value of the operation so that modifiers may be applied. However, + any partially built expression is attached to the constraint for + later resolution. When an operator is appended, the partial + expression is returned. If it's a self-resolving operator, then + a ResolvableConstraintExpression is returned. + + + + + 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. Note that the constraint + is not reduced at this time. For example, if there + is a NotOperator on the stack we don't reduce and + return a NotConstraint. The original constraint must + be returned because it may support modifiers that + are yet to be applied. + + + + + 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 ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a , which will + apply the following constraint to a collection of length one, succeeding + only if exactly one of them succeeds. + + + + + 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 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 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. + + + + + With is currently a NOP - reserved for future use. + + + + + 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 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 if item is equal to zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new 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 new 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 new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the Dictionary key collection. + + The key to be matched in the Dictionary key collection + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the Dictionary value collection. + + The value to be matched in the Dictionary value collection + + + + 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 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 ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression 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 a subpath of the 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 + inclusively within a specified range. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + Returns a constraint that succeeds if the value + is a file or directory and it exists. + + + + + Returns a constraint that tests if an item is equal to any of parameters + + Expected values + + + + ConstraintStatus represents the status of a ConstraintResult + returned by a Constraint being applied to an actual value. + + + + + The status has not yet been set + + + + + The constraint succeeded + + + + + The constraint failed + + + + + An error occurred in applying the constraint (reserved for future use) + + + + + Contains the result of matching a against an actual value. + + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + The status of the new ConstraintResult. + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + If true, applies a status of Success to the result, otherwise Failure. + + + + The actual value that was passed to the method. + + + + + Gets and sets the ResultStatus for this result. + + + + + True if actual value meets the Constraint criteria otherwise false. + + + + + Display friendly name of the constraint. + + + + + Description of the constraint may be affected by the state the constraint had + when was performed against the actual value. + + + + + Write the failure message to the MessageWriter provided + as an argument. The default implementation simply passes + the result 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 occurred, can override this. + + The MessageWriter on which to display the message + + + + Write some additional failure message. + + The MessageWriter on which to display the message + + + + 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 + + + + 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 value contained within the string/collection. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Flag the constraint to ignore case and return self. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Applies a delay to the match so that a match can be evaluated in the future. + + + + + Allows only changing the time dimension of delay interval and setting a polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithRawDelayInterval + + Parent DelayedConstraint on which delay interval dimension is required to be set + + + + Changes delay interval dimension to minutes + + + + + Changes delay interval dimension to seconds + + + + + Changes delay interval dimension to milliseconds + + + + + Set polling interval, in milliseconds + + A time interval, in milliseconds + + + + + Allows only setting the polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithDimensionedDelayInterval + + Parent DelayedConstraint on which polling interval is required to be set + + + + Set polling interval, in milliseconds + + A time interval, in milliseconds + + + + + Allows only changing the time dimension of the polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithRawPollingInterval + + Parent DelayedConstraint on which polling dimension is required to be set + + + + Changes polling interval dimension to minutes + + + + + Changes polling interval dimension to seconds + + + + + Changes polling interval dimension to milliseconds + + + + + Delay value store as an Interval object + + + + + Polling value stored as an Interval object + + + + + Creates a new DelayedConstraint + + The inner constraint to 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 to decorate + The time interval after which the match is performed, in milliseconds + The time interval used for polling, in milliseconds + If the value of is less than 0 + + + + Gets text describing a constraint + + + + + 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 + A ConstraintResult + + + + 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 + + + + Returns the string representation of the constraint. + + + + + Adjusts a Timestamp by a given TimeSpan + + + + + + + + Returns the difference between two Timestamps as a TimeSpan + + + + + + + + DictionaryContainsKeyConstraint is used to test whether a dictionary + contains an expected object as a key. + + + + + Construct a DictionaryContainsKeyConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Flag the constraint to ignore case and return self. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + + + + Test whether the expected key is contained in the dictionary + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + DictionaryContainsValueConstraint is used to test whether a dictionary + contains an expected object as a value. + + + + + Construct a DictionaryContainsValueConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Test whether the expected value is contained in the dictionary + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + Provides a for the constraints + that are applied to each item in the collection + + + + + Constructs a for a particular + Only used for Failure + + The Constraint to which this result applies + The actual value to which the Constraint was applied + Actual item that does not match expected condition + Non matching item index + + + + Write constraint description, actual items, and non-matching item + + The MessageWriter on which to display the message + + + + EmptyCollectionConstraint tests whether a collection is empty. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Check that the collection is empty + + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + EmptyDirectoryConstraint is used to test that a directory is empty + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + EmptyStringConstraint tests whether a string is empty. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + 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. + + + + + + + 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. + + + + + NUnitEqualityComparer used to test equality. + + + + + Initializes a new instance of the class. + + The expected value. + + + + Gets the tolerance for this comparison. + + + The tolerance. + + + + + Gets a value indicating whether to compare case insensitive. + + + true if comparing case insensitive; otherwise, false. + + + + + Gets a value indicating whether or not to clip strings. + + + true if set to clip strings otherwise, false. + + + + + Gets the failure points. + + + The failure points. + + + + + 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. + + + + + Flag the constraint to use a tolerance when determining equality. + + Tolerance value to be used + Self. + + + + Flags the constraint to include + property in comparison of two values. + + + Using this modifier does not allow to use the + constraint modifier. + + + + + 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 + + + + 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 boolean-returning delegate. + + The boolean-returning delegate 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 use the supplied predicate function + + The comparison function to use. + Self. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + The EqualConstraintResult class is tailored for formatting + and displaying the result of an EqualConstraint. + + + + + Construct an EqualConstraintResult + + + + + Write a failure message. Overridden to provide custom + failure messages for EqualConstraint. + + The MessageWriter to write to + + + + Display the failure information for two collections that did not match. + + The MessageWriter on which to display + The expected collection. + The actual collection + The depth of this failure in a set of nested collections + + + + Displays a single line showing the types and sizes of the expected + and actual collections or arrays. If both are identical, the value is + only shown once. + + The MessageWriter on which to display + The expected collection or array + The actual collection or array + The indentation level for the message line + + + + Displays a single line showing the point in the expected and actual + arrays at which the comparison failed. If the arrays have different + structures or dimensions, both values are shown. + + The MessageWriter on which to display + The expected array + The actual array + Index of the failure point in the underlying collections + The indentation level for the message line + + + + 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 + + + + EqualityAdapter class handles all equality comparisons + that use an , + or a . + + + + + 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 that wraps an . + + + + + that wraps an . + + + + + Returns an that wraps an . + + + + + Returns an EqualityAdapter that uses a predicate function for items comparison. + + + + + + + + + Returns true if the two objects can be compared by this adapter. + The base adapter cannot handle IEnumerables except for strings. + + + + + Compares two objects, returning true if they are equal + + + + + Returns true if the two objects can be compared by this adapter. + Generic adapter requires objects of the specified type. + + + + + Returns an that wraps an . + + + + + Returns an that wraps an . + + + + + that wraps an . + + + + + Returns an that wraps a . + + + + + ExactCountConstraint applies another constraint to each + item in a collection, succeeding only if a specified + number of items succeed. + + + + + Construct a standalone ExactCountConstraint + + + + + + 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. + + The value to be tested + A ConstraintResult + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Contain the result of matching a against an actual value. + + + + + The maximum count of list elements that are shown on the constraint result + + + + + The count of matched items of the + + + + + A list with maximum count (+1) of items of the + (The maximum count is set in ) + + + + + Constructs a for a . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + If true, applies a status of Success to the result, otherwise Failure. + Count of matched items of the + A list with maximum count (+1) of items of the + + + + Write the actual value for a failing constraint test to a MessageWriter. + + 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. + + + + 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. + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + ExceptionTypeConstraint is a special version of ExactTypeConstraint + used to provided detailed info about the exception thrown in + an error message. + + + + + Constructs an ExceptionTypeConstraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + FalseConstraint tests that the actual value is false + + + + + Initializes a new instance of the class. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + FileExistsConstraint is used to determine if a file exists + + + + + Initializes a new instance of the class. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + FileOrDirectoryExistsConstraint is used to determine if a file or directory exists + + + + + If true, the constraint will only check if files exist, not directories + + + + + If true, the constraint will only check if directories exist, not files + + + + + Initializes a new instance of the class that + will check files and directories. + + + + + Initializes a new instance of the class that + will only check files if ignoreDirectories is true. + + if set to true [ignore directories]. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + 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. + + + + + 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 + + + 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 between 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 between 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/ + + + + + + Tests whether a value is greater than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Tests whether a value is greater than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Interface for all constraints + + + + + The display name of this Constraint for use by ToString(). + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Arguments provided to this Constraint, for use in + formatting the description. + + + + + The ConstraintBuilder holding this constraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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 + A ConstraintResult + + + + 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 + + + + 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. + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + Keeps track of an interval time which can be represented in + Minutes, Seconds or Milliseconds + + + + + Constructs a interval given an value in milliseconds + + + + + Gets Interval value represented as a TimeSpan object + + + + + Returns the interval with the current value as a number of minutes. + + + + + Returns the interval with the current value as a number of seconds. + + + + + Returns the interval with the current value as a number of milliseconds. + + + + + Is true for intervals created with a non-zero value + + + + + Returns a string that represents the current object. + + + A string that represents the current object. + + + + + IntervalUnit provides the semantics to the value stored in Interval class. + + + + + Unit representing an Interval in minutes + + + + + Unit representing an Interval in seconds + + + + + Unit representing an Interval in milliseconds + + + + + The IResolveConstraint interface is implemented by all + complete and resolvable constraints and expressions. + + + + + Return the top-level constraint for this expression + + + + + + An extension of ResolvableConstraintExpression that adds a no-op Items property for readability. + + + + + Create a new instance of ItemsConstraintExpression + + + + + Create a new instance of ResolvableConstraintExpression, + passing in a pre-populated ConstraintBuilder. + + + + + + No-op property for readability. + + + + + Tests whether a value is less than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Tests whether a value is less than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + 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 + + + + + Abstract method to get the max line length + + + + + 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 given + 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 failing constraint result + + + + 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 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 + + + + Custom value formatter function + + The value + + + + + Custom value formatter factory function + + The next formatter function + ValueFormatter + If the given formatter is unable to handle a certain format, it must call the next formatter in the chain + + + + Static methods used in creating messages + + + + + Static string used when strings are clipped + + + + + Formatting strings used for expected and actual values + + + + + Current head of chain of value formatters. Public for testing. + + + + + Add a formatter to the chain of responsibility. + + + + + + Formats text to represent a generalized value. + + The value + The formatted text + + + + Formats 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 + + + + 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 + + + + Converts any null characters in a string + to their escaped representation. + + The string to be converted + The converted string + + + + Return the a string representation for a set of indices into an array + + Array of indices for which a string is needed + + + + Get an array of indices representing the point in a collection or + array corresponding to a single int index into the collection. + + The collection to which the indices apply + Index in the collection + Array of indices + + + + Clip a string to a given length, starting at a particular offset, returning the clipped + string with ellipses representing the removed parts + + The string to be clipped + The maximum permitted length of the result string + The point at which to start clipping + The clipped string + + + + Clip the expected and actual strings in a coordinated fashion, + so that they may be displayed together. + + + + + + + + + Shows the position two strings start to differ. Comparison + starts at the start index. + + The expected string + The actual string + The index in the strings at which comparison should start + Boolean indicating whether case should be ignored + -1 if no mismatch found, or the index where mismatch found + + + + NaNConstraint tests that the actual value is a double or float NaN + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test that the actual value is an NaN + + + + + + + NoItemConstraint applies another constraint to each + item in a collection, failing if any of them succeeds. + + + + + Construct a SomeItemsConstraint on top of an existing constraint + + + + + + 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. + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + 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 + + + + NullConstraint tests that the actual value is null + + + + + Initializes a new instance of the class. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + 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. + + + + + Returns the default NUnitComparer. + + + + + Compares two objects + + + + + + + + NUnitEqualityComparer encapsulates NUnit's handling of + equality tests between objects. + + + + + If true, all string comparisons will ignore case + + + + + If true, arrays will be treated as collections, allowing + those of different dimensions to be compared + + + + + Comparison objects used in comparisons for some constraints. + + + + + List of points at which a failure occurred. + + + + + List of comparers used to compare pairs of objects. + + + + + Initializes a new instance of the class. + + + + + 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 the list of external comparers to be used to + test for equality. They are applied to members of + collections, in place of NUnit's own logic. + + + + + Gets the list of failure points for the last Match performed. + The list consists of objects to be interpreted by the caller. + This generally means that the caller may only make use of + objects it has placed on the list at a particular depth. + + + + + Flags the comparer to include + property in comparison of two values. + + + Using this modifier does not allow to use the + modifier. + + + + + Compares two objects for equality within a tolerance. + + + + + 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 + + + + + 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. + + + + + Operator that requires both its arguments to succeed + + + + + Construct an AndOperator + + + + + Apply the operator to produce an AndConstraint + + + + + 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. + + + + + 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. + + + + + + Gets the left precedence of the operator + + + + + Gets the right precedence of the operator + + + + + Abstract method that produces a constraint by applying + the operator to its left and right constraint arguments. + + + + + Abstract base for operators that indicate how to + apply a constraint to items in a collection. + + + + + Constructs a CollectionOperator + + + + + 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. + + + + + The syntax element preceding this operator + + + + + The syntax element following 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. + + + + + 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. + + + + + + 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 + + + + 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. + + + + + + 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. + + + + + Negates the test of the constraint it wraps. + + + + + Constructs a new NotOperator + + + + + Returns a NotConstraint applied to its argument. + + + + + Operator that requires at least one of its arguments to succeed + + + + + Construct an OrOperator + + + + + Apply the operator to produce an OrConstraint + + + + + PrefixOperator takes a single constraint and modifies + its 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. + + + + + + + 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. + + + + + Gets the name of the property to which the operator applies + + + + + 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. + + + + + + Abstract base class for operators that are able to reduce to a + constraint whether or not another syntactic element follows. + + + + + 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. + + + + + 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. + + + + + Represents a constraint that simply wraps the + constraint provided as an argument, without any + further functionality, but which modifies the + order of evaluation because of its precedence. + + + + + Constructor for the WithOperator + + + + + Returns a constraint that wraps its argument + + + + + OrConstraint succeeds if either member succeeds + + + + + Create an OrConstraint from two other constraints + + The first constraint + The second constraint + + + + Gets text describing a 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 + + + + PathConstraint serves as the abstract base of constraints + that operate on paths and provides several helper methods. + + + + + Construct a PathConstraint for a give expected path + + The expected path + + + + Modifies the current instance to be case-sensitive + and returns it. + + + + + Returns the string representation of this constraint + + + + + Canonicalize the provided path + + + The path in standardized form + + + + Test whether one path in canonical form is a subpath of another path + + The first path - supposed to be the parent path + The second path - supposed to be the child path + + + + + Predicate constraint wraps a Predicate in a constraint, + returning success if the predicate is true. + + + + + Construct a PredicateConstraint from a predicate + + + + + Gets text describing a constraint + + + + + Determines whether the predicate succeeds when applied + to the actual value. + + + + + Abstract base class used for prefixes + + + + + The base constraint + + + + + Prefix used in forming the constraint description + + + + + Construct given a base constraint + + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Formats a prefix constraint's description. + + + + + 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 + + + + Returns the string representation of the constraint. + + + + + Contains the result of matching a against an actual value. + + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The base result with actual value to which the Constraint was applied. + + + + Write the additional failure message for a failing constraint to a + MessageWriter. + + The writer on which the actual value is displayed + + + + 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 value + of the property. The two constraints are now separate. + + + + + Initializes a new instance of the class. + + The name of the property. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the property exists for a given object + + The object to be tested + True for success, false for failure + + + + Returns the string representation of the constraint. + + + + + + RangeConstraint tests whether two values are within a + specified range. + + + + + Initializes a new instance of the class. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use a and returns self. + + + + + 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 + + + + 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. + + + + + Appends an And Operator to the expression + + + + + Appends an Or operator to the expression. + + + + + Resolve the current expression to a Constraint + + + + + ReusableConstraint wraps a constraint expression after + resolving it so that it can be reused consistently. + + + + + Construct a ReusableConstraint from a constraint expression + + The expression to be resolved and reused + + + + Converts a constraint to a ReusableConstraint + + The constraint to be converted + A ReusableConstraint + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Return the top-level constraint for this expression + + + + + + SameAsConstraint tests whether an object is identical to + the object passed to its constructor + + + + + Initializes a new instance of the class. + + The expected object. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Summary description for SamePathConstraint. + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + SamePathOrUnderConstraint tests that one path is under another + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + 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 + + + + + + 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. + + + + + Apply the item constraint to each item in the collection, + succeeding if any item succeeds. + + + + + + + Flag the constraint to use the supplied object. + + The type of the elements in the collection. + The type of the member. + The comparison function to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + 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. + + + + + + + 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 + + + + + Description of this constraint + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Constructs a StringConstraint without an expected value + + + + + Constructs a StringConstraint given an expected value + + The expected value + + + + Modify the constraint to ignore case in matching. + + + + + 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 a given string + + The string to be tested + True for success, false for failure + + + + SubPathConstraint tests that the actual path is under the expected path + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + SubstringConstraint can test whether a string contains + the expected substring. + + + + + Initializes a new instance of the class. + + The expected. + + + + Modify the constraint to ignore case in matching. + This will call Using(StringComparison.CurrentCultureIgnoreCase). + + Thrown when a comparison type different + than was already set. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Modify the constraint to the specified comparison. + + Thrown when a comparison type different + than was already set. + + + + 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. + + + + Get the actual exception thrown - used by Assert.Throws. + + + + + Gets text describing a constraint + + + + + 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 actual value for a failing constraint test to a + MessageWriter. This override only handles the special message + used when an exception is expected but none is thrown. + + The writer on which the actual value is displayed + + + + ThrowsExceptionConstraint tests that an exception has + been thrown, without any further tests. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Executes the code and returns success if an exception is thrown. + + A delegate representing the code to be tested + True if an exception is thrown, otherwise false + + + + Applies the constraint to 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. + + + + + ThrowsNothingConstraint tests that a delegate does not + throw an exception. + + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True if no exception is thrown, otherwise false + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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. + + + + + Returns a default Tolerance object, equivalent to an exact match. + + + + + Returns an empty Tolerance object, equivalent to an exact match. + + + + + Constructs a linear tolerance of a specified amount + + + + + Constructs a tolerance given an amount and + + + + + 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 as the amount, using + the current amount as a number of days. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of hours. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of minutes. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of seconds. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of milliseconds. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of clock ticks. + + + + + Gets the for the current Tolerance + + + + + Gets the magnitude of the current Tolerance instance. + + + + + Returns true if the current tolerance has not been set or is using the . + + + + + Apply the tolerance to an expected value and return + a Tolerance.Range that represents the acceptable values. + + + + + Tests that the current Tolerance is linear with a + numeric value, throwing an exception if it is not. + + + + + Tolerance.Range represents the range of values that match + a specific tolerance, when applied to a specific value. + + + + + The lower bound of the range + + + + + The upper bound of the range + + + + + Constructs a range + + + + + 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. + + + + + TrueConstraint tests that the actual value is true + + + + + Initializes a new instance of the class. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + TypeConstraint is the abstract base for constraints + that take a Type as their expected value. + + + + + The expected Type used by the constraint + + + + + The type of the actual argument to which the constraint was applied + + + + + Construct a TypeConstraint for a given Type + + The expected type for the constraint + Prefix used in forming the constraint description + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + UniqueItemsConstraint tests whether all the items in a + collection are unique. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Check that all items are unique. + + + + + + + XmlSerializableConstraint tests whether + an object is serializable in XML format. + + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Returns the string representation of this constraint + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the dictionary. + + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the dictionary. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Asserts on Directories + + + + + DO NOT USE! Use DirectoryAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both point to the same directory. + 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 the 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 point to the same directory. + If they are not 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 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 + + + + Asserts that the directory exists. If it does not exist + an is thrown. + + 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 the directory exists. If it does not exist + an is thrown. + + A directory containing the actual value + + + + Asserts that the directory exists. If it does not exist + an is thrown. + + The path to 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 the directory exists. If it does not exist + an is thrown. + + The path to a directory containing the actual value + + + + Asserts that the directory does not exist. If it does exist + an is thrown. + + 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 the directory does not exist. If it does exist + an is thrown. + + A directory containing the actual value + + + + Asserts that the directory does not exist. If it does exist + an is thrown. + + The path to 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 the directory does not exist. If it does exist + an is thrown. + + The path to a directory containing the actual value + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a constraint that succeeds if the value + is a file or directory and it exists. + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new . 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 new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the Dictionary key collection. + + The key to be matched in the Dictionary key collection + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the Dictionary value collection. + + The value to be matched in the Dictionary value collection + + + + 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 regular expression supplied as an argument. + + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the ResultState provided by this exception + + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + Default Constructor + + + + + Construct based on the TestResult so far. This is the constructor + used normally, when exiting the multiple assert block with failures. + Not used internally but provided to facilitate debugging. + + + The current result, up to this point. The result is not used + internally by NUnit but is provided to facilitate debugging. + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the provided by this exception. + + + + + Gets the of this test at the point the exception was thrown, + + + + + Abstract base for Exceptions that terminate a test and provide a ResultState. + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the ResultState provided by this exception + + + + + Contains extension methods that do not require a special using directive. + + + + + Asserts on Files + + + + + DO NOT USE! Use FileAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Asserts that the file exists. If it does not exist + an is thrown. + + 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 the file exists. If it does not exist + an is thrown. + + A file containing the actual value + + + + Asserts that the file exists. If it does not exist + an is thrown. + + 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 the file exists. If it does not exist + an is thrown. + + The path to a file containing the actual value + + + + Asserts that the file does not exist. If it does exist + an is thrown. + + 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 the file does not exist. If it does exist + an is thrown. + + A file containing the actual value + + + + Asserts that the file does not exist. If it does exist + an is thrown. + + 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 the file does not exist. If it does exist + an is thrown. + + The path to a file containing the actual value + + + + Class used to guard against unexpected argument values + or operations by throwing an appropriate exception. + + + + + Throws an exception if an argument is null + + The value to be tested + The name of the argument + + + + Throws an exception if a string argument is null or empty + + The value to be tested + The name of the argument + + + + Throws an ArgumentOutOfRangeException if the specified condition is not met. + + The condition that must be met + The exception message to be used + The name of the argument + + + + Throws an ArgumentException if the specified condition is not met. + + The condition that must be met + The exception message to be used + The name of the argument + + + + Throws an InvalidOperationException if the specified condition is not met. + + The condition that must be met + The exception message to be used + + + + Throws an if the specified delegate is async void. + + + + + Throws an if the specified delegate is async void. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + 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 ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a which will apply + the following constraint to only one member of the collection, + and fail if none or more than one match occurs. + + + + + 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 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 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 checking for the + presence of a particular object in the collection. + + + + + The AssertionResult class represents the result of a single assertion. + + + + + Construct an AssertionResult + + + + The pass/fail status of the assertion + + + The message produced by the assertion, or null + + + The stack trace associated with the assertion, or null + + + + ToString Override + + + + + Override GetHashCode + + + + + Override Equals + + + + + + AssertionStatus enumeration represents the possible outcomes of an assertion. + The order of definition is significant, higher level values override lower + ones in determining the overall result of a test. + + + + + An assumption failed + + + + + The assertion succeeded + + + + + A warning message was issued + + + + + The assertion failed + + + + + An unexpected exception was thrown + + + + + The IApplyToContext interface is implemented by attributes + that want to make changes to the execution context before + a test is run. + + + + + Apply changes to the execution context + + The execution context + + + + The IApplyToTest interface is implemented by self-applying + attributes that modify the state of a test in some way. + + + + + Modifies a test as defined for the specific attribute. + + The test to modify + + + + CombiningStrategy is the abstract base for classes that + know how to combine values provided for individual test + parameters to create a set of test cases. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + ICommandWrapper is implemented by attributes and other + objects able to wrap a TestCommand with another command. + + + Attributes or other objects should implement one of the + derived interfaces, rather than this one, since they + indicate in which part of the command chain the wrapper + should be applied. + + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + Objects implementing this interface are used to wrap + the TestMethodCommand itself. They apply after SetUp + has been run and before TearDown. + + + + + Objects implementing this interface are used to wrap + the entire test, including SetUp and TearDown. + + + + + Objects implementing this interface are used to wrap + tests that can repeat. The implementing command is run once, + invoking the chained commands any number of times. + + + + + Any ITest that implements this interface is at a level that the implementing + class should be disposed at the end of the test run + + + + + The IFixtureBuilder interface is exposed by a class that knows how to + build test fixtures from a specified type. In general, it is exposed + by an attribute, but it may be implemented in a helper class used by the + attribute in some cases. + + + + + Builds any number of test fixtures from the specified type. + + The type info of the fixture to be used. + + + + The IFixtureBuilder2 interface extends IFixtureBuilder by allowing + use of a PreFilter, which is used to select methods as test cases. + + + + + Builds any number of test fixtures from the specified type. + + The type info of the fixture to be used. + PreFilter to be used to select methods. + + + + IImplyFixture is an empty marker interface used by attributes like + TestAttribute that cause the class where they are used to be treated + as a TestFixture even without a TestFixtureAttribute. + + Marker interfaces are not usually considered a good practice, but + we use it here to avoid cluttering the attribute hierarchy with + classes that don't contain any extra implementation. + + + + + The IMethodInfo class is used to encapsulate information + about a method in a platform-independent manner. + + + + + Gets the Type from which this method was reflected. + + + + + Gets the MethodInfo for this method. + + + + + Gets the name of the method. + + + + + Gets a value indicating whether the method is abstract. + + + + + Gets a value indicating whether the method is public. + + + + + Gets a value indicating whether the method contains unassigned generic type parameters. + + + + + Gets a value indicating whether the method is a generic method. + + + + + Gets a value indicating whether the MethodInfo represents the definition of a generic method. + + + + + Gets the return Type of the method. + + + + + Gets the parameters of the method. + + + + + + Returns the Type arguments of a generic method or the Type parameters of a generic method definition. + + + + + Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo. + + The type arguments to be used + A new IMethodInfo with the type arguments replaced + + + + Invokes the method, converting any TargetInvocationException to an NUnitException. + + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + Provides data for a single test parameter. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test. + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + Provides data for a single test parameter. + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + The IParameterInfo interface is an abstraction of a .NET parameter. + + + + + Gets a value indicating whether the parameter is optional + + + + + Gets an IMethodInfo representing the method for which this is a parameter + + + + + Gets the underlying .NET ParameterInfo + + + + + Gets the Type of the parameter + + + + + Implemented by filters for use in deciding which + Types and Methods should be used to generate tests. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + A PropertyBag represents a collection of name/value pairs + that allows duplicate entries with the same key. Methods + are provided for adding a new pair as well as for setting + a key to a single value. All keys are strings but values + may be of any type. Null values are not permitted, since + a null entry represents the absence of the key. + + The entries in a PropertyBag are of two kinds: those that + take a single value and those that take multiple values. + However, the PropertyBag has no knowledge of which entries + fall into each category and the distinction is entirely + up to the code using the PropertyBag. + + When working with multi-valued properties, client code + should use the Add method to add name/value pairs and + indexing to retrieve a list of all values for a given + key. For example: + + bag.Add("Tag", "one"); + bag.Add("Tag", "two"); + Assert.That(bag["Tag"], + Is.EqualTo(new string[] { "one", "two" })); + + When working with single-valued properties, client code + should use the Set method to set the value and Get to + retrieve the value. The GetSetting methods may also be + used to retrieve the value in a type-safe manner while + also providing default. For example: + + bag.Set("Priority", "low"); + bag.Set("Priority", "high"); // replaces value + Assert.That(bag.Get("Priority"), + Is.EqualTo("high")); + Assert.That(bag.GetSetting("Priority", "low"), + Is.EqualTo("high")); + + + + + Adds a key/value pair to the property bag + + The key + The value + + + + Sets the value for a key, removing any other + values that are already in the property set. + + + + + + + Gets a single value for a key, using the first + one if multiple values are present and returning + null if the value is not found. + + + + + Gets a flag indicating whether the specified key has + any entries in the property set. + + The key to be checked + True if their are values present, otherwise false + + + + Gets or sets the list of values for a particular key + + The key for which the values are to be retrieved or set + + + + Gets a collection containing all the keys in the property set + + + + + The IReflectionInfo interface is implemented by NUnit wrapper objects that perform reflection. + + + + + Returns an array of custom attributes of the specified type applied to this object + + + + + Returns a value indicating whether an attribute of the specified type is defined on this object. + + + + + The ISimpleTestBuilder interface is exposed by a class that knows how to + build a single tests from a specified method. In general, + it is exposed by an attribute, but it may be implemented in a helper class + used by the attribute in some cases. + + + + + Builds a single test from the specified method and context. + + The method to be used as a test + The TestSuite to which the method will be added + + + + The ISuiteBuilder interface is exposed by a class that knows how to + build a single test suite from a specified type. + + + + + Examine the type and determine if it is suitable for + this builder to use in building a TestSuite. + + Note that returning false will cause the type to be ignored + in loading the tests. If it is desired to load the suite + but label it as non-runnable, ignored, etc., then this + method must return true. + + The type of the fixture to be used + + + + Builds a single test suite from the specified type. + + The type of the fixture to be used + + + + Builds a single test suite from the specified type, subject + to a filter that decides which methods are included. + + The type of the fixture to be used + A PreFilter for selecting methods. + + + + Common interface supported by all representations + of a test. Only includes informational fields. + The Run method is specifically excluded to allow + for data-only representations of a test. + + + + + Gets the id of the test + + + + + Gets the name of the test + + + + + Gets the type of the test + + + + + Gets the fully qualified name of the test + + + + + Gets the name of the class containing this test. Returns + null if the test is not associated with a class. + + + + + Gets the name of the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + Gets the Type of the test fixture, if applicable, or + null if no fixture type is associated with this test. + + + + + Gets the method which declares the test, or + if no method is associated with this test. + + + + + Gets the RunState of the test, indicating whether it can be run. + + + + + Count of the test cases ( 1 if this is a test case ) + + + + + Gets the properties of the test + + + + + Gets the parent test, if any. + + The parent test or null if none exists. + + + + Returns true if this is a test suite + + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets this test's child tests + + A list of child tests + + + + Gets a fixture object for running this test. + + + + + The arguments to use in creating the test or empty array if none are required. + + + + + The ITestBuilder interface is exposed by a class that knows how to + build tests from a specified method. In general, it is exposed + by an attribute which has additional information available to provide + the necessary test parameters to distinguish the test cases built. + + + + + Builds any number of tests from the specified method and context. + + The method to be used as a test + The TestSuite to which the method will be added + + + + The ITestCaseBuilder interface is exposed by a class that knows how to + build a test from a specified method, possibly containing child test cases. + + + + + Examine the method and determine if it is suitable for + this builder to use in building a TestCase to be + included in the suite being populated. + + Note that returning false will cause the method to be ignored + in loading the tests. If it is desired to load the method + but label it as non-runnable, ignored, etc., then this + method must return true. + + The test method to examine + The suite being populated + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method to be used as a test case + The test suite being populated, or null + + + + The ITestCaseData interface is implemented by a class + that is able to return complete test cases for use by + a parameterized test method. + + + + + Gets the expected result of the test case + + + + + Returns true if an expected result has been set + + + + + The ITestData interface is implemented by a class that + represents a single instance of a parameterized test. + + + + + Gets the name to be used for the test + + + + + Gets the RunState for this test case. + + + + + Gets the argument list to be provided to the test + + + + + Gets the property dictionary for the test case + + + + + Interface to be implemented by filters applied to tests. + The filter applies when running the test, after it has been + loaded, since this is the only time an ITest exists. + + + + + Determine if a particular test passes the filter criteria. Pass + may examine the parents and/or descendants of a test, depending + on the semantics of the particular filter + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + The ITestCaseData interface is implemented by a class + that is able to return the data required to create an + instance of a parameterized test fixture. + + + + + Get the TypeArgs if separately set + + + + + The ITestListener interface is used internally to receive + notifications of significant events while a test is being + run. The events are propagated to clients by means of an + AsyncCallback. NUnit extensions may also monitor these events. + + + + + Called when a test has just started + + The test that is starting + + + + Called when a test has finished + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + The ITestResult interface represents the result of a test. + + + + + Gets the ResultState of the test result, which + indicates the success or failure of the test. + + + + + Gets the name of the test result + + + + + Gets the full name of the test result + + + + + Gets the elapsed time for running the test in seconds + + + + + Gets or sets the time the test started running. + + + + + Gets or sets the time the test finished running. + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + Gets the number of asserts executed + when running the test and all its children. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + Accessing HasChildren should not force creation of the + Children collection in classes implementing this interface. + + + + + Gets the collection of child results. + + + + + Gets the Test to which this result applies. + + + + + Gets any text output written to this result. + + + + + Gets a list of AssertionResults associated with the test + + + + + Gets the collection of files attached to the test + + + + + The ITypeInfo interface is an abstraction of a .NET Type + + + + + Gets the underlying Type on which this ITypeInfo is based + + + + + Gets the base type of this type as an ITypeInfo + + + + + Returns true if the Type wrapped is equal to the argument + + + + + Gets the name of the Type + + + + + Gets the full name of the Type + + + + + Gets the assembly in which the type is declared + + + + + Gets the namespace of the Type + + + + + Gets a value indicating whether the type is abstract. + + + + + Gets a value indicating whether the Type is a generic Type + + + + + Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types. + + + + + Gets a value indicating whether the Type is a generic Type definition + + + + + Gets a value indicating whether the type is sealed. + + + + + Gets a value indicating whether this type is a static class. + + + + + Get the display name for this typeInfo. + + + + + Get the display name for an object of this type, constructed with specific arguments + + + + + Returns a Type representing a generic type definition from which this Type can be constructed. + + + + + Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments + + + + + Returns a value indicating whether this type has a method with a specified public attribute + + + + + Returns an array of IMethodInfos for methods of this Type + that match the specified flags. + + + + + Gets the public constructor taking the specified argument Types + + + + + Returns a value indicating whether this Type has a public constructor taking the specified argument Types. + + + + + Construct an object of this Type, using the specified arguments. + + + + + An object implementing IXmlNodeBuilder is able to build + an XML representation of itself and any children. + + + + + Returns a TNode representing the current object. + + If true, children are included where applicable + A TNode representing the result + + + + Returns a TNode representing the current object after + adding it as a child of the supplied parent node. + + The parent node. + If true, children are included, where applicable + + + + + The ResultState class represents the outcome of running a test. + It contains two pieces of information. The Status of the test + is an enum indicating whether the test passed, failed, was + skipped or was inconclusive. The Label provides a more + detailed breakdown for use by client runners. + + + + + Initializes a new instance of the class. + + The TestStatus. + + + + Initializes a new instance of the class. + + The TestStatus. + The label. + + + + Initializes a new instance of the class. + + The TestStatus. + The stage at which the result was produced + + + + Initializes a new instance of the class. + + The TestStatus. + The label. + The stage at which the result was produced + + + + The result is inconclusive + + + + + The test has been skipped. + + + + + The test has been ignored. + + + + + The test was skipped because it is explicit + + + + + The test succeeded + + + + + The test issued a warning + + + + + The test failed + + + + + The test encountered an unexpected exception + + + + + The test was cancelled by the user + + + + + The test was not runnable. + + + + + A suite failed because one or more child tests failed or had errors + + + + + A suite failed because one or more child tests had warnings + + + + + A suite is marked ignored because one or more child tests were ignored + + + + + A suite failed in its OneTimeSetUp + + + + + A suite had an unexpected exception in its OneTimeSetUp + + + + + A suite had an unexpected exception in its OneTimeDown + + + + + Gets the TestStatus for the test. + + The status. + + + + Gets the label under which this test result is + categorized, if any. + + + + + Gets the stage of test execution in which + the failure or other result took place. + + + + + Get a new ResultState, which is the same as the current + one but with the FailureSite set to the specified value. + + The FailureSite to use + A new ResultState + + + + Test whether this ResultState has the same Status and Label + as another one. In other words, the whether two are equal + ignoring the Site. + + + + + + + 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. + + + + + Overload == operator for ResultStates + + + + + Overload != operator for ResultStates + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + The FailureSite enum indicates the stage of a test + in which an error or failure occurred. + + + + + Failure in the test itself + + + + + Failure in the SetUp method + + + + + Failure in the TearDown method + + + + + Failure of a parent test + + + + + Failure of a child test + + + + + The RunState enum indicates whether a test can be executed. + + + + + The test is not runnable. + + + + + The test is runnable. + + + + + The test can only be run explicitly + + + + + The test has been skipped. This value may + appear on a Test when certain attributes + are used to skip the test. + + + + + The test has been ignored. May appear on + a Test, when the IgnoreAttribute is used. + + + + + The TestAttachment class represents a file attached to a TestResult, + with an optional description. + + + + + Absolute file path to attachment file + + + + + User specifed description of attachment. May be null. + + + + + Creates a TestAttachment class to represent a file attached to a test result. + + Absolute file path to attachment file + User specifed description of attachment. May be null. + + + + The class holds a message sent by a test to all listeners + + + + + Construct with text, destination type and + the name of the test that produced the message. + + Destination of the message + Text to be sent + ID of the test that produced the message + + + + Converts object to string + + + + + The message to send to listeners + + + + + The Destination of the message. + + + + + The ID of the test that sent the message + + + + + Returns the XML representation of the object. + + + + + The TestOutput class holds a unit of output from + a test to a specific output stream + + + + + Construct with text, output destination type and + the name of the test that produced the output. + + Text to be output + Name of the stream or channel to which the text should be written + Id of the test that produced the output + FullName of test that produced the output + + + + Return string representation of the object for debugging + + + + + + Get the text + + + + + Get the output type + + + + + Get the name of the test that created the output + + + + + Get the id of the test that created the output + + + + + Convert the TestOutput object to an XML string + + + + + The TestStatus enum indicates the result of running a test + + + + + The test was inconclusive + + + + + The test has skipped + + + + + The test succeeded + + + + + There was a warning + + + + + The test failed + + + + + TNode represents a single node in the XML representation + of a Test or TestResult. It replaces System.Xml.XmlNode and + System.Xml.Linq.XElement, providing a minimal set of methods + for operating on the XML in a platform-independent manner. + + + + + Constructs a new instance of TNode + + The name of the node + + + + Constructs a new instance of TNode with a value + + The name of the node + The text content of the node + + + + Constructs a new instance of TNode with a value + + The name of the node + The text content of the node + Flag indicating whether to use CDATA when writing the text + + + + Gets the name of the node + + + + + Gets the value of the node + + + + + Gets a flag indicating whether the value should be output using CDATA. + + + + + Gets the dictionary of attributes + + + + + Gets a list of child nodes + + + + + Gets the first ChildNode + + + + + Gets the XML representation of this node. + + + + + Create a TNode from its XML text representation + + The XML text to be parsed + A TNode + + + + Adds a new element as a child of the current node and returns it. + + The element name. + The newly created child element + + + + Adds a new element with a value as a child of the current node and returns it. + + The element name + The text content of the new element + The newly created child element + + + + Adds a new element with a value as a child of the current node and returns it. + The value will be output using a CDATA section. + + The element name + The text content of the new element + The newly created child element + + + + Adds an attribute with a specified name and value to the XmlNode. + + The name of the attribute. + The value of the attribute. + + + + Finds a single descendant of this node matching an XPath + specification. The format of the specification is + limited to what is needed by NUnit and its tests. + + + + + + + Finds all descendants of this node matching an XPath + specification. The format of the specification is + limited to what is needed by NUnit and its tests. + + + + + Writes the XML representation of the node to an XmlWriter + + + + + + Class used to represent a list of XmlResults + + + + + Class used to represent the attributes of a node + + + + + Gets or sets the value associated with the specified key. + Overridden to return null if attribute is not found. + + The key. + Value of the attribute or null + + + + AssemblyHelper provides static methods for working + with assemblies. + + + + + Gets the path from which an assembly was loaded. + For builds where this is not possible, returns + the name of the assembly. + + The assembly. + The path. + + + + Gets the path to the directory from which an assembly was loaded. + + The assembly. + The path. + + + + Gets the AssemblyName of an assembly. + + The assembly + An AssemblyName + + + + Loads an assembly given a string, which may be the + path to the assembly or the AssemblyName + + + + + Gets the assembly path from code base. + + Public for testing purposes + The code base. + + + + + CombinatorialStrategy creates test cases by using all possible + combinations of the parameter data. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + Provides data from fields marked with the DatapointAttribute or the + DatapointsAttribute. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + Built-in SuiteBuilder for all types of test classes. + + + + + Examine the type and determine if it is suitable for + this builder to use in building a TestSuite. + + Note that returning false will cause the type to be ignored + in loading the tests. If it is desired to load the suite + but label it as non-runnable, ignored, etc., then this + method must return true. + + The fixture type to check + + + + Builds a single test suite from the specified type. + + The fixture type to build + + + + Builds a single test suite from the specified type, subject + to a filter that decides which methods are included. + + The fixture type to build + A PreFilter for selecting methods. + + + + We look for attributes implementing IFixtureBuilder at one level + of inheritance at a time. Attributes on base classes are not used + unless there are no fixture builder attributes at all on the derived + class. This is by design. + + The type being examined for attributes + + + + Class to build ether a parameterized or a normal NUnitTestMethod. + There are four cases that the builder must deal with: + 1. The method needs no params and none are provided + 2. The method needs params and they are provided + 3. The method needs no params but they are provided in error + 4. The method needs params but they are not provided + This could have been done using two different builders, but it + turned out to be simpler to have just one. The BuildFrom method + takes a different branch depending on whether any parameters are + provided, but all four cases are dealt with in lower-level methods + + + + + Determines if the method can be used to build an NUnit test + test method of some kind. The method must normally be marked + with an identifying attribute for this to be true. + + Note that this method does not check that the signature + of the method for validity. If we did that here, any + test methods with invalid signatures would be passed + over in silence in the test run. Since we want such + methods to be reported, the check for validity is made + in BuildFrom rather than here. + + An IMethodInfo for the method being used as a test method + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method for which a test is to be built + + + + Determines if the method can be used to build an NUnit test + test method of some kind. The method must normally be marked + with an identifying attribute for this to be true. + + Note that this method does not check that the signature + of the method for validity. If we did that here, any + test methods with invalid signatures would be passed + over in silence in the test run. Since we want such + methods to be reported, the check for validity is made + in BuildFrom rather than here. + + An IMethodInfo for the method being used as a test method + The test suite being built, to which the new test would be added + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method for which a test is to be built + The test fixture being populated, or null + + + + Builds a ParameterizedMethodSuite containing individual test cases. + + The method for which a test is to be built. + The list of test cases to include. + + + + Build a simple, non-parameterized TestMethod for this method. + + The MethodInfo for which a test is to be built + The test suite for which the method is being built + + + + Class that can build a tree of automatic namespace + suites from a group of fixtures. + + + + + NamespaceDictionary of all test suites we have created to represent + namespaces. Used to locate namespace parent suites for fixtures. + + + + + Point in the tree where items in the global namespace are added + + + + + Initializes a new instance of the class. + + The root suite. + + + + Gets the root entry in the tree created by the NamespaceTreeBuilder. + + The root suite. + + + + Adds the specified fixtures to the tree. + + The fixtures to be added. + + + + Adds the specified fixture to the tree. + + The fixture to be added. + + + + NUnitTestCaseBuilder is a utility class used by attributes + that build test cases. + + + + + Constructs an + + + + + Builds a single NUnitTestMethod, either as a child of the fixture + or as one of a set of test cases under a ParameterizedTestMethodSuite. + + The MethodInfo from which to construct the TestMethod + The suite or fixture to which the new test will be added + The ParameterSet to be used, or null + + + + Checks to see if we have valid combinations of attributes. + + The TestMethod to be checked. If it + is found to be non-runnable, it will be modified. + True if the method signature is valid, false if not + + + + Helper method that checks the signature of a TestMethod and + any supplied parameters to determine if the test is valid. + + Currently, NUnitTestMethods are required to be public, + non-abstract methods, either static or instance, + returning void. They may take arguments but the values must + be provided or the TestMethod is not considered runnable. + + Methods not meeting these criteria will be marked as + non-runnable and the method will return false in that case. + + The TestMethod to be checked. If it + is found to be non-runnable, it will be modified. + Parameters to be used for this test, or null + True if the method signature is valid, false if not + + The return value is no longer used internally, but is retained + for testing purposes. + + + + + NUnitTestFixtureBuilder is able to build a fixture given + a class marked with a TestFixtureAttribute or an unmarked + class containing test methods. In the first case, it is + called by the attribute and in the second directly by + NUnitSuiteBuilder. + + + + + Build a TestFixture from type provided. A non-null TestSuite + must always be returned, since the method is generally called + because the user has marked the target class as a fixture. + If something prevents the fixture from being used, it should + be returned nonetheless, labelled as non-runnable. + + An ITypeInfo for the fixture to be used. + Filter used to select methods as tests. + A TestSuite object or one derived from TestSuite. + + + + Overload of BuildFrom called by tests that have arguments. + Builds a fixture using the provided type and information + in the ITestFixtureData object. + + The TypeInfo for which to construct a fixture. + Filter used to select methods as tests. + An object implementing ITestFixtureData or null. + + + + + Method to add test cases to the newly constructed fixture. + + + + + Method to create a test case from a MethodInfo and add + it to the fixture being built. It first checks to see if + any global TestCaseBuilder addin wants to build the + test case. If not, it uses the internal builder + collection maintained by this fixture builder. + + The default implementation has no test case builders. + Derived classes should add builders to the collection + in their constructor. + + The method for which a test is to be created + The test suite being built. + A newly constructed Test + + + + PairwiseStrategy creates test cases by combining the parameter + data so that all possible pairs of data items are used. + + + + The number of test cases that cover all possible pairs of test function + parameters values is significantly less than the number of test cases + that cover all possible combination of test function parameters values. + And because different studies show that most of software failures are + caused by combination of no more than two parameters, pairwise testing + can be an effective ways to test the system when it's impossible to test + all combinations of parameters. + + + The PairwiseStrategy code is based on "jenny" tool by Bob Jenkins: + http://burtleburtle.net/bob/math/jenny.html + + + + + + FleaRand is a pseudo-random number generator developed by Bob Jenkins: + http://burtleburtle.net/bob/rand/talksmall.html#flea + + + + + Initializes a new instance of the FleaRand class. + + The seed. + + + + FeatureInfo represents coverage of a single value of test function + parameter, represented as a pair of indices, Dimension and Feature. In + terms of unit testing, Dimension is the index of the test parameter and + Feature is the index of the supplied value in that parameter's list of + sources. + + + + + Initializes a new instance of FeatureInfo class. + + Index of a dimension. + Index of a feature. + + + + A FeatureTuple represents a combination of features, one per test + parameter, which should be covered by a test case. In the + PairwiseStrategy, we are only trying to cover pairs of features, so the + tuples actually may contain only single feature or pair of features, but + the algorithm itself works with triplets, quadruples and so on. + + + + + Initializes a new instance of FeatureTuple class for a single feature. + + Single feature. + + + + Initializes a new instance of FeatureTuple class for a pair of features. + + First feature. + Second feature. + + + + TestCase represents a single test case covering a list of features. + + + + + Initializes a new instance of TestCaseInfo class. + + A number of features in the test case. + + + + PairwiseTestCaseGenerator class implements an algorithm which generates + a set of test cases which covers all pairs of possible values of test + function. + + + + The algorithm starts with creating a set of all feature tuples which we + will try to cover (see method). This set + includes every single feature and all possible pairs of features. We + store feature tuples in the 3-D collection (where axes are "dimension", + "feature", and "all combinations which includes this feature"), and for + every two feature (e.g. "A" and "B") we generate both ("A", "B") and + ("B", "A") pairs. This data structure extremely reduces the amount of + time needed to calculate coverage for a single test case (this + calculation is the most time-consuming part of the algorithm). + + + Then the algorithm picks one tuple from the uncovered tuple, creates a + test case that covers this tuple, and then removes this tuple and all + other tuples covered by this test case from the collection of uncovered + tuples. + + + Picking a tuple to cover + + + There are no any special rules defined for picking tuples to cover. We + just pick them one by one, in the order they were generated. + + + Test generation + + + Test generation starts from creating a completely random test case which + covers, nevertheless, previously selected tuple. Then the algorithm + tries to maximize number of tuples which this test covers. + + + Test generation and maximization process repeats seven times for every + selected tuple and then the algorithm picks the best test case ("seven" + is a magic number which provides good results in acceptable time). + + Maximizing test coverage + + To maximize tests coverage, the algorithm walks through the list of mutable + dimensions (mutable dimension is a dimension that are not included in + the previously selected tuple). Then for every dimension, the algorithm + walks through the list of features and checks if this feature provides + better coverage than randomly selected feature, and if yes keeps this + feature. + + + This process repeats while it shows progress. If the last iteration + doesn't improve coverage, the process ends. + + + In addition, for better results, before start every iteration, the + algorithm "scrambles" dimensions - so for every iteration dimension + probes in a different order. + + + + + + Creates a set of test cases for specified dimensions. + + + An array which contains information about dimensions. Each element of + this array represents a number of features in the specific dimension. + + + A set of test cases. + + + + + Gets the test cases generated by this strategy instance. + + A set of test cases. + + + + The ParameterDataProvider class implements IParameterDataProvider + and hosts one or more individual providers. + + + + + Construct with a collection of individual providers + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + ParameterDataSourceProvider supplies individual argument values for + single parameters using attributes implementing IParameterDataSource. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + SequentialStrategy creates test cases by using all of the + parameter data sources in parallel, substituting null + when any of them run out of data. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + TestActionAfterCommand handles the AfterTest method of a single + TestActionItem, provided the items BeforeTest has been run. + + + + + Initializes a new instance of the class. + + The inner command. + The TestActionItem to run before the inner command. + + + + AfterCommand is a DelegatingTestCommand that performs some + specific action after the inner command is run. + + + + + Construct an AfterCommand + + + + + Execute the command + + + + + Set this to perform action after the inner command. + + + + + ContextSettingsCommand applies specified changes to the + TestExecutionContext prior to running a test. No special + action is needed after the test runs, since the prior + context will be restored automatically. + + + + + TestActionCommand handles a single ITestAction applied + to a test. It runs the BeforeTest method, then runs the + test and finally runs the AfterTest method. + + + + + Initializes a new instance of the class. + + The inner command. + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Perform the before test action + + + + + Perform the after test action + + + + + TestActionBeforeCommand handles the BeforeTest method of a single + TestActionItem, relying on the item to remember it has been run. + + + + + Initializes a new instance of the class. + + The inner command. + The TestActionItem to run before the inner command. + + + + BeforeTestCommand is a DelegatingTestCommand that performs some + specific action before the inner command is run. + + + + + Construct a BeforeCommand + + + + + Execute the command + + + + + Action to perform before the inner command. + + + + + ConstructFixtureCommand constructs the user test object if necessary. + + + + + Constructs a OneTimeSetUpCommand for a suite + + The inner command to which the command applies + + + + DelegatingTestCommand wraps an inner TestCommand. + Derived classes may do what they like before or + after running the inner command. + + + + TODO: Documentation needed for field + + + + TODO: Documentation needed for constructor + + + + + + OneTimeTearDownCommand performs any teardown actions + specified for a suite and calls Dispose on the user + test object, if any. + + + + + Construct a OneTimeTearDownCommand + + The command wrapped by this command + + + + EmptyTestCommand is a TestCommand that does nothing. It simply + returns the current result from the context when executed. We + use it to avoid testing for null when executing a chain of + DelegatingTestCommands. + + + + + Construct a NullCommand for a test + + + + + Execute the command + + + + + TODO: Documentation needed for class + + + + + Initializes a new instance of the class. + + The inner command. + The max time allowed in milliseconds + + + + OneTimeSetUpCommand runs any one-time setup methods for a suite, + constructing the user test object if necessary. + + + + + Constructs a OneTimeSetUpCommand for a suite + + The inner command to which the command applies + A SetUpTearDownList for use by the command + + + + OneTimeTearDownCommand performs any teardown actions + specified for a suite and calls Dispose on the user + test object, if any. + + + + + Construct a OneTimeTearDownCommand + + The command wrapped by this command + A SetUpTearDownList for use by the command + + + + SetUpTearDownCommand runs SetUp methods for a suite, + runs the test and then runs TearDown methods. + + + + + Initializes a new instance of the class. + + The inner command. + List of setup/teardown items + + + + SetUpTearDownItem holds the setup and teardown methods + for a single level of the inheritance hierarchy. + + + + + Construct a SetUpTearDownNode + + A list of setup methods for this level + A list teardown methods for this level + + + + Returns true if this level has any methods at all. + This flag is used to discard levels that do nothing. + + + + + Run SetUp on this level. + + The execution context to use for running. + + + + Run TearDown for this level. + + + + + + TODO: Documentation needed for class + + + + + Initializes a new instance of the class. + + The test being skipped. + + + + Overridden to simply set the CurrentResult to the + appropriate Skipped state. + + The execution context for the test + A TestResult + + + + TestActionCommand handles a single ITestAction applied + to a test. It runs the BeforeTest method, then runs the + test and finally runs the AfterTest method. + + + + + Initializes a new instance of the class. + + The inner command. + The TestAction with which to wrap the inner command. + + + + TestActionItem wraps a single execution of an ITestAction. + Its primary purpose is to track whether the BeforeTest + method has been called and suppress calling the + AfterTest method if it has not. This is necessary when + ITestActions are used before and after a CompositeWorkItem, + since the OneTimeSetUpCommand and OneTimeTearDownCommand + are separate command chains. By sharing a TestActionItem + between the setup and teardown chains, the two calls can + be coordinated. + + + + + Construct a TestActionItem + + The ITestAction to be included + + + + Get flag indicating if the BeforeTest entry was already called. + + + + + Run the BeforeTest method of the action and remember that it has been run. + + The test to which the action applies + + + + Run the AfterTest action, but only if the BeforeTest + action was actually run. + + The test to which the action applies + + + + TestCommand is the abstract base class for all test commands + in the framework. A TestCommand represents a single stage in + the execution of a test, e.g.: SetUp/TearDown, checking for + Timeout, verifying the returned result from a method, etc. + + TestCommands may decorate other test commands so that the + execution of a lower-level command is nested within that + of a higher level command. All nested commands are executed + synchronously, as a single unit. Scheduling test execution + on separate threads is handled at a higher level, using the + task dispatcher. + + + + + Construct a TestCommand for a test. + + The test to be executed + + + + Gets the test associated with this command. + + + + + Runs the test in a specified context, returning a TestResult. + + The TestExecutionContext to be used for running the test. + A TestResult + + + + TestMethodCommand is the lowest level concrete command + used to run actual test cases. + + + + + Initializes a new instance of the class. + + The test. + + + + Runs the test, saving a TestResult in the execution context, as + well as returning it. If the test has an expected result, it + is asserts on that value. Since failed tests and errors throw + an exception, this command must be wrapped in an outer command, + will handle that exception and records the failure. This role + is usually played by the SetUpTearDown command. + + The execution context + + + + TheoryResultCommand adjusts the result of a Theory so that + it fails if all the results were inconclusive. + + + + + Constructs a TheoryResultCommand + + The command to be wrapped by this one + + + + TimeoutCommand creates a timer in order to cancel + a test if it exceeds a specified time and adjusts + the test result if it did time out. + + + + + Initializes a new instance of the class. + + The inner command + Timeout value + + + + Provides methods to support consistent checking in constraints. + + + + + Requires that the provided object is actually of the type required. + + The object to verify. + Name of the parameter as passed into the checking method. + + If and can be null, returns null rather than throwing when is null. + If cannot be null, this parameter is ignored. + The type to require. + + + + CultureDetector is a helper class used by NUnit to determine + whether a test should be run based on the current culture. + + + + + Default constructor uses the current culture. + + + + + Construct a CultureDetector for a particular culture for testing. + + The culture to be used + + + + Test to determine if one of a collection of cultures + is being used currently. + + + + + + + Tests to determine if the current culture is supported + based on a culture attribute. + + The attribute to examine + + + + + Test to determine if the a particular culture or comma- + delimited set of cultures is in use. + + Name of the culture or comma-separated list of culture ids + True if the culture is in use on the system + + + + Return the last failure reason. Results are not + defined if called before IsSupported( Attribute ) + is called. + + + + + ExceptionHelper provides static methods for working with exceptions + + + + + Rethrows an exception, preserving its stack trace + + The exception to rethrow + + + + Builds up a message, using the Message field of the specified exception + as well as any InnerExceptions. Optionally excludes exception names, + creating a more readable message. + + The exception. + Flag indicating whether exception names should be excluded. + A combined message string. + + + + Builds up a message, using the Message field of the specified exception + as well as any InnerExceptions. + + The exception. + A combined stack trace. + + + + Gets the stack trace of the exception. If no stack trace + is provided, returns "No stack trace available". + + The exception. + A string representation of the stack trace. + + + + A CompositeWorkItem represents a test suite and + encapsulates the execution of the suite as well + as all its child tests. + + + + + List of Child WorkItems + + + + + Indicates whether this work item should use a separate dispatcher. + + + + + Construct a CompositeWorkItem for executing a test suite + using a filter to select child tests. + + The TestSuite to be executed + A filter used to select child tests + + + + Method that actually performs the work. Overridden + in CompositeWorkItem to do one-time setup, run all child + items and then dispatch the one-time teardown work item. + + + + + + + + + + Cancel (abort or stop) a CompositeWorkItem and all of its children + + true if the CompositeWorkItem and all of its children should be aborted, false if it should allow all currently running tests to complete + + + + OneTimeTearDownWorkItem represents the cleanup + and one-time teardown phase of a CompositeWorkItem + + + + + Construct a OneTimeTearDownWOrkItem wrapping a CompositeWorkItem + + The CompositeWorkItem being wrapped + + + + The WorkItem name, overridden to indicate this is the teardown. + + + + + The ExecutionStrategy for use in running this work item + + + + + + + + + + PerformWork is not used in CompositeWorkItem + + + + + A simplified implementation of .NET 4 CountdownEvent + for use in earlier versions of .NET. Only the methods + used by NUnit are implemented. + + + + + Construct a CountdownEvent + + The initial count + + + + Gets the initial count established for the CountdownEvent + + + + + Gets the current count remaining for the CountdownEvent + + + + + Decrement the count by one + + + + + Decrement the count by the specified amount + + + + + Block the thread until the count reaches zero + + + + + EventListenerTextWriter sends text output to the currently active + ITestEventListener in the form of a TestOutput object. If no event + listener is active in the context, or if there is no context, + the output is forwarded to the supplied default writer. + + + + + Construct an EventListenerTextWriter + + The name of the stream to use for events + The default writer to use if no listener is available + + + + Get the Encoding for this TextWriter + + + + + Write formatted string + + + + + Write formatted string + + + + + Write formatted string + + + + + Write an object + + + + + Write a string + + + + + Write a decimal + + + + + Write a double + + + + + Write formatted string + + + + + Write a ulong + + + + + Write a long + + + + + Write a uint + + + + + Write an int + + + + + Write a char + + + + + Write a boolean + + + + + Write chars + + + + + Write chars + + + + + Write a float + + + + + Write a string with newline + + + + + Write an object with newline + + + + + Write formatted string with newline + + + + + Write formatted string with newline + + + + + Write formatted string with newline + + + + + Write a decimal with newline + + + + + Write a formatted string with newline + + + + + Write a double with newline + + + + + Write a uint with newline + + + + + Write a ulong with newline + + + + + Write a long with newline + + + + + Write an int with newline + + + + + Write a bool with newline + + + + + Write chars with newline + + + + + Write chars with newline + + + + + Write a char with newline + + + + + Write a float with newline + + + + + Write newline + + + + + The EventPumpState enum represents the state of an + EventPump. + + + + + The pump is stopped + + + + + The pump is pumping events with no stop requested + + + + + The pump is pumping events but a stop has been requested + + + + + EventPump pulls events out of an EventQueue and sends + them to a listener. It is used to send events back to + the client without using the CallContext of the test + runner thread. + + + + + The downstream listener to which we send events + + + + + The queue that holds our events + + + + + Thread to do the pumping + + + + + The current state of the event pump + + + + + Constructor + + The EventListener to receive events + The event queue to pull events from + + + + Gets or sets the current state of the pump + + + + + Gets or sets the name of this EventPump + (used only internally and for testing). + + + + + Dispose stops the pump + Disposes the used WaitHandle, too. + + + + + Start the pump + + + + + Tell the pump to stop after emptying the queue. + + + + + Our thread proc for removing items from the event + queue and sending them on. Note that this would + need to do more locking if any other thread were + removing events from the queue. + + + + + NUnit.Core.Event is the abstract base for all stored events. + An Event is the stored representation of a call to the + ITestListener interface and is used to record such calls + or to queue them for forwarding on another thread or at + a later time. + + + + + The Send method is implemented by derived classes to send the event to the specified listener. + + The listener. + + + + TestStartedEvent holds information needed to call the TestStarted method. + + + + + Initializes a new instance of the class. + + The test. + + + + Calls TestStarted on the specified listener. + + The listener. + + + + TestFinishedEvent holds information needed to call the TestFinished method. + + + + + Initializes a new instance of the class. + + The result. + + + + Calls TestFinished on the specified listener. + + The listener. + + + + TestOutputEvent holds information needed to call the TestOutput method. + + + + + Initializes a new instance of the class. + + The output object. + + + + Calls TestOutput on the specified listener. + + The listener. + + + + TestMessageEvent holds information needed to call the SendMessage method. + + + + + Initializes a new instance of the class. + + The test message object. + + + + Calls on the specified listener. + + The listener. + + + + Holds object for sending to all listeners + + + + + Implements a queue of work items each of which + is queued as a WaitCallback. + + + + + Gets the count of items in the queue. + + + + + Enqueues the specified event + + The event to enqueue. + + + + Removes the first element from the queue and returns it (or null). + + + If true and the queue is empty, the calling thread is blocked until + either an element is enqueued, or is called. + + + + + If the queue not empty + the first element. + + + otherwise, if ==false + or has been called + null. + + + + + + + Stop processing of the queue + + + + + An IWorkItemDispatcher handles execution of work items. + + + + + The level of parallelism supported. Zero if not supported. + + + + + Start execution, performing any initialization. Sets + the top level work item and dispatches it. + + + + + Dispatch a single work item for execution. The first + work item dispatched is saved as the top-level + work item and used when stopping the run. + + The item to dispatch + + + + Cancel the ongoing run completely. + If no run is in process, the call has no effect. + + true if the IWorkItemDispatcher should abort all currently running WorkItems, false if it should allow all currently running WorkItems to complete + + + + MainThreadWorkItemDispatcher handles execution of WorkItems by + directly executing them on the main thread. This is different + from the SimpleWorkItemDispatcher where the work item is dispatched + onto its own thread. + + + + + The level of parallelism supported + + + + + Start execution, dispatching the top level + work into the main thread. + + + + + Dispatch a single work item for execution by + executing it directly. + The item to dispatch + + + + + This method is not supported for + this dispatcher. Using it will throw a + NotSupportedException. + + Not used + If used, it will always throw this. + + + + Enumeration representing the strategy to follow in executing a work item. + The value is only relevant when running under the parallel dispatcher. + + + + + Run directly on same thread + + + + + Enqueue for parallel execution + + + + + Enqueue for non-parallel execution + + + + + ParallelWorkItemDispatcher handles execution of work items by + queuing them for worker threads to process. + + + + + Event raised whenever a shift is starting. + + + + + Event raised whenever a shift has ended. + + + + + Construct a ParallelWorkItemDispatcher + + Number of workers to use + + + + Number of parallel worker threads + + + + + Enumerates all the shifts supported by the dispatcher + + + + + Enumerates all the Queues supported by the dispatcher + + + + + Start execution, setting the top level work, + enqueuing it and starting a shift to execute it. + + + + + Dispatch a single work item for execution. The first + work item dispatched is saved as the top-level + work item and used when stopping the run. + + The item to dispatch + + + + Cancel the ongoing run completely. + If no run is in process, the call has no effect. + + + + + Save the state of the queues and create a new isolated set + + + + + Remove isolated queues and restore old ones + + + + + QueuingEventListener uses an EventQueue to store any + events received on its EventListener interface. + + + + + The EventQueue created and filled by this listener + + + + + Construct a QueuingEventListener + + + + + A test has started + + The test that is starting + + + + A test case finished + + Result of the test case + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + A SimpleWorkItem represents a single test case and is + marked as completed immediately upon execution. This + class is also used for skipped or ignored test suites. + + + + + Construct a simple work item for a test. + + The test to be executed + The filter used to select this test + + + + Method that performs actually performs the work. + + + + + Creates a test command for use in running this test. + + A TestCommand + + + + SimpleWorkItemDispatcher handles execution of WorkItems by + directly executing them. It is provided so that a dispatcher + is always available in the context, thereby simplifying the + code needed to run child tests. + + + + + The level of parallelism supported + + + + + Start execution, creating the execution thread, + setting the top level work and dispatching it. + + + + + Dispatch a single work item for execution by + executing it directly. + The item to dispatch + + + + + Cancel (abort or stop) the ongoing run. + If no run is in process, the call has no effect. + + true if the run should be aborted, false if it should allow its currently running test to complete + + + + A TestWorker pulls work items from a queue + and executes them. + + + + + Event handler for TestWorker events + + The TestWorker sending the event + The WorkItem that caused the event + + + + Event signaled immediately before executing a WorkItem + + + + + Event signaled immediately after executing a WorkItem + + + + + Construct a new TestWorker. + + The queue from which to pull work items + The name of this worker + + + + The WorkItemQueue from which this worker pulls WorkItems + + + + + The name of this worker - also used for the thread + + + + + Indicates whether the worker thread is running + + + + + Our ThreadProc, which pulls and runs tests in a loop + + + + + Create thread and start processing work items. + + + + + Stop the thread, either immediately or after finishing the current WorkItem + + true if the thread should be aborted, false if it should allow the currently running test to complete + + + + The TextCapture class intercepts console output and writes it + to the current execution context, if one is present on the thread. + If no execution context is found, the output is written to a + default destination, normally the original destination of the + intercepted output. + + + + + Construct a TextCapture object + + The default destination for non-intercepted output + + + + Gets the Encoding in use by this TextWriter + + + + + Writes a single character + + The char to write + + + + Writes a string + + The string to write + + + + Writes a string followed by a line terminator + + The string to write + + + + A WorkItem may be an individual test case, a fixture or + a higher level grouping of tests. All WorkItems inherit + from the abstract WorkItem class, which uses the template + pattern to allow derived classes to perform work in + whatever way is needed. + + A WorkItem is created with a particular TestExecutionContext + and is responsible for re-establishing that context in the + current thread before it begins or resumes execution. + + + + + Construct a WorkItem for a particular test. + + The test that the WorkItem will run + Filter used to include or exclude child items + + + + Construct a work Item that wraps another work Item. + Wrapper items are used to represent independently + dispatched tasks, which form part of the execution + of a single test, such as OneTimeTearDown. + + The WorkItem being wrapped + + + + Initialize the TestExecutionContext. This must be done + before executing the WorkItem. + + + Originally, the context was provided in the constructor + but delaying initialization of the context until the item + is about to be dispatched allows changes in the parent + context during OneTimeSetUp to be reflected in the child. + + The TestExecutionContext to use + + + + Event triggered when the item is complete + + + + + Gets the current state of the WorkItem + + + + + The test being executed by the work item + + + + + The name of the work item - defaults to the Test name. + + + + + Filter used to include or exclude child tests + + + + + The execution context + + + + + The worker executing this item. + + + + + The ParallelExecutionStrategy to use for this work item + + + + + Indicates whether this work item should use a separate dispatcher. + + + + + The test result + + + + + Gets the ParallelScope associated with the test, if any, + otherwise returning ParallelScope.Default; + + + + + Execute the current work item, including any + child work items. + + + + + Wait until the execution of this item is complete + + + + + Marks the WorkItem as NotRunnable. + + Reason for test being NotRunnable. + + + + Cancel (abort or stop) a WorkItem + + true if the WorkItem should be aborted, false if it should run to completion + + + + Standard Dispose + + + + + Method that performs actually performs the work. It should + set the State to WorkItemState.Complete when done. + + + + + Method called by the derived class when all work is complete + + + + + Builds the set up tear down list. + + Unsorted array of setup MethodInfos. + Unsorted array of teardown MethodInfos. + A list of SetUpTearDownItems + + + + Changes the result of the test, logging the old and new states + + The new ResultState + The new message + + + + Recursively walks up the test hierarchy to see if the + has been set on any of the parent tests. + + + + + WorkItemBuilder class knows how to build a tree of work items from a tree of tests + + + + + Creates a work item. + + The test for which this WorkItem is being created. + The filter to be used in selecting any child Tests. + True if child work items should be created and added. + + + + + Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. + + + A signed integer that indicates the relative values of and , as shown in the following table.Value Meaning Less than zero is less than .Zero equals .Greater than zero is greater than . + + The first object to compare.The second object to compare. + + + + WorkItemQueueState indicates the current state of a WorkItemQueue + + + + + The queue is paused + + + + + The queue is running + + + + + The queue is stopped + + + + + A WorkItemQueue holds work items that are ready to + be run, either initially or after some dependency + has been satisfied. + + + + + Initializes a new instance of the class. + + The name of the queue. + Flag indicating whether this is a parallel queue + ApartmentState to use for items on this queue + + + + Gets the name of the work item queue. + + + + + Gets a flag indicating whether this queue is used for parallel execution + + + + + Gets the target ApartmentState for work items on this queue + + + + + Gets the total number of items processed so far + + + + + Gets the current state of the queue + + + + + Get a bool indicating whether the queue is empty. + + + + + Enqueue a WorkItem to be processed + + The WorkItem to process + + + + Enqueue a WorkItem to be processed - internal for testing + + The WorkItem to process + The priority at which to process the item + + + + Dequeue a WorkItem for processing + + A WorkItem or null if the queue has stopped + + + + Start or restart processing of items from the queue + + + + + Signal the queue to stop + + + + + Pause the queue for restarting later + + + + + Save the current inner queue and create new ones for use by + a non-parallel fixture with parallel children. + + + + + Restore the inner queue that was previously saved + + + + + The current state of a work item + + + + + Ready to run or continue + + + + + Work Item is executing + + + + + Complete + + + + + Handler for ShiftChange events. + + The shift that is starting or ending. + + + + The dispatcher needs to do different things at different, + non-overlapped times. For example, non-parallel tests may + not be run at the same time as parallel tests. We model + this using the metaphor of a working shift. The WorkShift + class associates one or more WorkItemQueues with one or + more TestWorkers. + + Work in the queues is processed until all queues are empty + and all workers are idle. Both tests are needed because a + worker that is busy may end up adding more work to one of + the queues. At that point, the shift is over and another + shift may begin. This cycle continues until all the tests + have been run. + + + + + Construct a WorkShift + + + + + Event that fires when the shift has ended + + + + + The Name of this shift + + + + + Gets a flag indicating whether the shift is currently active + + + + + Gets a bool indicating whether this shift has any work to do + + + + + Gets a list of the queues associated with this shift. + + Internal for testing - immutable once initialized + + + + Gets the list of workers associated with this shift. + + Internal for testing - immutable once initialized + + + + Add a WorkItemQueue to the shift, starting it if the + shift is currently active. + + + + + Assign a worker to the shift. + + + + + + Start or restart processing for the shift + + + + + End the shift, pausing all queues and raising + the EndOfShift event. + + + + + Shut down the shift. + + + + + Cancel (abort or stop) the shift without completing all work + + true if the WorkShift should be aborted, false if it should allow its currently running tests to complete + + + + 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. + + + + + + + Gets or sets the maximum line length for this writer + + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a given + 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 result of the constraint that failed + + + + Gets the unique type name between expected and actual. + + The expected value + The actual value causing the failure + Output of the unique type name for expected + Output of the unique type name for actual + + + + 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 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 ConstraintResult for which the actual value is to be written + + + + Write the generic 'Actual' line for a given value + + The actual value causing a failure + + + + Combines multiple filters so that a test must pass all + of them in order to pass this filter. + + + + + Constructs an empty AndFilter + + + + + Constructs an AndFilter from an array of filters + + + + + + Checks whether the AndFilter is matched by a test + + The test to be matched + True if all the component filters pass, otherwise false + + + + Checks whether the AndFilter is matched by a test + + The test to be matched + True if all the component filters match, otherwise false + + + + Checks whether the AndFilter is explicit matched by a test. + + The test to be matched + True if all the component filters explicit match, otherwise false + + + + Gets the element name + + Element name + + + + CategoryFilter is able to select or exclude tests + based on their categories. + + + + + Construct a CategoryFilter using a single category name + + A category name + + + + Check whether the filter matches a test + + The test to be matched + + + + + Gets the element name + + Element name + + + + ClassName filter selects tests based on the class FullName + + + + + Construct a FullNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + A base class for multi-part filters + + + + + Constructs an empty CompositeFilter + + + + + Constructs a CompositeFilter from an array of filters + + + + + + Adds a filter to the list of filters + + The filter to be added + + + + Return a list of the composing filters. + + + + + Checks whether the CompositeFilter is matched by a test. + + The test to be matched + + + + Checks whether the CompositeFilter is matched by a test. + + The test to be matched + + + + Checks whether the CompositeFilter is explicit matched by a test. + + The test to be matched + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + FullName filter selects tests based on their FullName + + + + + Construct a FullNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + IdFilter selects tests based on their id + + + + + Construct an IdFilter for a single value + + The id the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + FullName filter selects tests based on their FullName + + + + + Construct a MethodNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + ClassName filter selects tests based on the class FullName + + + + + Construct a NamespaceFilter for a single namespace + + The namespace the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + NotFilter negates the operation of another filter + + + + + Construct a not filter on another filter + + The filter to be negated + + + + Gets the base filter + + + + + Determine if a particular test passes the filter criteria. The default + implementation checks the test itself, its parents and any descendants. + + Derived classes may override this method or any of the Match methods + to change the behavior of the filter. + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Check whether the filter matches a test + + The test to be matched + True if it matches, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Combines multiple filters so that a test must pass one + of them in order to pass this filter. + + + + + Constructs an empty OrFilter + + + + + Constructs an AndFilter from an array of filters + + + + + + Checks whether the OrFilter is matched by a test + + The test to be matched + True if any of the component filters pass, otherwise false + + + + Checks whether the OrFilter is matched by a test + + The test to be matched + True if any of the component filters match, otherwise false + + + + Checks whether the OrFilter is explicit matched by a test + + The test to be matched + True if any of the component filters explicit match, otherwise false + + + + Gets the element name + + Element name + + + + PropertyFilter is able to select or exclude tests + based on their properties. + + + + + Construct a PropertyFilter using a property name and expected value + + A property name + The expected value of the property + + + + Check whether the filter matches a test + + The test to be matched + + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + TestName filter selects tests based on their Name + + + + + Construct a TestNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + ValueMatchFilter selects tests based on some value, which + is expected to be contained in the test. + + + + + Returns the value matched by the filter - used for testing + + + + + Indicates whether the value is a regular expression + + + + + Construct a ValueMatchFilter for a single value. + + The value to be included. + + + + Match the input provided by the derived class + + The value to be matchedT + True for a match, false otherwise. + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + GenericMethodHelper is able to deduce the Type arguments for + a generic method from the actual arguments provided. + + + + + A special value, which is used to indicate that BestCommonType() method + was unable to find a common type for the specified arguments. + + + + + Construct a GenericMethodHelper for a method + + MethodInfo for the method to examine + + + + Return the type arguments for the method, deducing them + from the arguments actually provided. + + The arguments to the method + If successful, an array of type arguments. + + + + InvalidTestFixtureException is thrown when an appropriate test + fixture constructor using the provided arguments cannot be found. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + InvalidPlatformException is thrown when the platform name supplied + to a test is not recognized. + + + + + Instantiates a new instance of the class. + + + + + Instantiates a new instance of the class + + The message. + + + + Instantiates a new instance of the class + + The message. + The inner. + + + + Serialization constructor for the class + + + + + InvalidTestFixtureException is thrown when an appropriate test + fixture constructor using the provided arguments cannot be found. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + Interface for logging within the engine + + + + + Logs the specified message at the error level. + + The message. + + + + Logs the specified message at the error level. + + The message. + The arguments. + + + + Logs the specified message at the warning level. + + The message. + + + + Logs the specified message at the warning level. + + The message. + The arguments. + + + + Logs the specified message at the info level. + + The message. + + + + Logs the specified message at the info level. + + The message. + The arguments. + + + + Logs the specified message at the debug level. + + The message. + + + + Logs the specified message at the debug level. + + The message. + The arguments. + + + + InternalTrace provides facilities for tracing the execution + of the NUnit framework. Tests and classes under test may make use + of Console writes, System.Diagnostics.Trace or various loggers and + NUnit itself traps and processes each of them. For that reason, a + separate internal trace is needed. + + Note: + InternalTrace uses a global lock to allow multiple threads to write + trace messages. This can easily make it a bottleneck so it must be + used sparingly. Keep the trace Level as low as possible and only + insert InternalTrace writes where they are needed. + TODO: add some buffering and a separate writer thread as an option. + TODO: figure out a way to turn on trace in specific classes only. + + + + + Gets a flag indicating whether the InternalTrace is initialized + + + + + Initialize the internal trace facility using the name of the log + to be written to and the trace level. + + The log name + The trace level + + + + Initialize the internal trace using a provided TextWriter and level + + A TextWriter + The InternalTraceLevel + + + + Get a named Logger + + + + + + Get a logger named for a particular Type. + + + + + InternalTraceLevel is an enumeration controlling the + level of detailed presented in the internal log. + + + + + Use the default settings as specified by the user. + + + + + Do not display any trace messages + + + + + Display Error messages only + + + + + Display Warning level and higher messages + + + + + Display informational and higher messages + + + + + Display debug messages and higher - i.e. all messages + + + + + Display debug messages and higher - i.e. all messages + + + + + A trace listener that writes to a separate file per domain + and process using it. + + + + + Construct an InternalTraceWriter that writes to a file. + + Path to the file to use + + + + Construct an InternalTraceWriter that writes to a + TextWriter provided by the caller. + + + + + + Returns the character encoding in which the output is written. + + The character encoding in which the output is written. + + + + Writes a character to the text string or stream. + + The character to write to the text stream. + + + + Writes a string to the text string or stream. + + The string to write. + + + + Writes a string followed by a line terminator to the text string or stream. + + The string to write. If is null, only the line terminator is written. + + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Clears all buffers for the current writer and causes any buffered data to be written to the underlying device. + + + + + Provides internal logging to the NUnit framework + + + + + Initializes a new instance of the class. + + The name. + The log level. + The writer where logs are sent. + + + + Logs the message at error level. + + The message. + + + + Logs the message at error level. + + The message. + The message arguments. + + + + Logs the message at warm level. + + The message. + + + + Logs the message at warning level. + + The message. + The message arguments. + + + + Logs the message at info level. + + The message. + + + + Logs the message at info level. + + The message. + The message arguments. + + + + Logs the message at debug level. + + The message. + + + + Logs the message at debug level. + + The message. + The message arguments. + + + + The MethodWrapper class wraps a MethodInfo so that it may + be used in a platform-independent manner. + + + + + Construct a MethodWrapper for a Type and a MethodInfo. + + + + + Construct a MethodInfo for a given Type and method name. + + + + + Gets the Type from which this method was reflected. + + + + + Gets the MethodInfo for this method. + + + + + Gets the name of the method. + + + + + Gets a value indicating whether the method is abstract. + + + + + Gets a value indicating whether the method is public. + + + + + Gets a value indicating whether the method contains unassigned generic type parameters. + + + + + Gets a value indicating whether the method is a generic method. + + + + + Gets a value indicating whether the MethodInfo represents the definition of a generic method. + + + + + Gets the return Type of the method. + + + + + Gets the parameters of the method. + + + + + + Returns the Type arguments of a generic method or the Type parameters of a generic method definition. + + + + + Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo. + + The type arguments to be used + A new IMethodInfo with the type arguments replaced + + + + Returns an array of custom attributes of the specified type applied to this method + + + + + Gets a value indicating whether one or more attributes of the specified type are defined on the method. + + + + + Invokes the method, converting any TargetInvocationException to an NUnitException. + + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + Override ToString() so that error messages in NUnit's own tests make sense + + + + + Thrown when an assertion failed. Here to preserve the inner + exception and hence its stack trace. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The error message that explains + the reason for the exception + + + + Initializes a new instance of the class. + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Enables the syntax. + + + + + Wraps an action so that it is executed when the returned object is disposed. + This disposal is thread-safe and the action will be executed at most once. + + + + + OSPlatform represents a particular operating system platform + + + + + Platform ID for Unix as defined by Microsoft .NET 2.0 and greater + + + + + Platform ID for Unix as defined by Mono + + + + + Platform ID for XBox as defined by .NET and Mono + + + + + Platform ID for MacOSX as defined by .NET and Mono + + + + + Get the OSPlatform under which we are currently running + + + + + Gets the actual OS Version, not the incorrect value that might be + returned for Win 8.1 and Win 10 + + + If an application is not manifested as Windows 8.1 or Windows 10, + the version returned from Environment.OSVersion will not be 6.3 and 10.0 + respectively, but will be 6.2 and 6.3. The correct value can be found in + the registry. + + The original version + The correct OS version + + + + Product Type Enumeration used for Windows + + + + + Product type is unknown or unspecified + + + + + Product type is Workstation + + + + + Product type is Domain Controller + + + + + Product type is Server + + + + + Construct from a platform ID and version + + + + + Construct from a platform ID, version and product type + + + + + Get the platform ID of this instance + + + + + Implemented to use in place of Environment.OSVersion.ToString() + + A representation of the platform ID and version in an approximation of the format used by Environment.OSVersion.ToString() + + + + Get the Version of this instance + + + + + Get the Product Type of this instance + + + + + Return true if this is a windows platform + + + + + Return true if this is a Unix or Linux platform + + + + + Return true if the platform is Win32S + + + + + Return true if the platform is Win32Windows + + + + + Return true if the platform is Win32NT + + + + + Return true if the platform is Windows CE + + + + + Return true if the platform is Xbox + + + + + Return true if the platform is MacOSX + + + + + Return true if the platform is Windows 95 + + + + + Return true if the platform is Windows 98 + + + + + Return true if the platform is Windows ME + + + + + Return true if the platform is NT 3 + + + + + Return true if the platform is NT 4 + + + + + Return true if the platform is NT 5 + + + + + Return true if the platform is Windows 2000 + + + + + Return true if the platform is Windows XP + + + + + Return true if the platform is Windows 2003 Server + + + + + Return true if the platform is NT 6 + + + + + Return true if the platform is NT 6.0 + + + + + Return true if the platform is NT 6.1 + + + + + Return true if the platform is NT 6.2 + + + + + Return true if the platform is NT 6.3 + + + + + Return true if the platform is Vista + + + + + Return true if the platform is Windows 2008 Server (original or R2) + + + + + Return true if the platform is Windows 2008 Server (original) + + + + + Return true if the platform is Windows 2008 Server R2 + + + + + Return true if the platform is Windows 2012 Server (original or R2) + + + + + Return true if the platform is Windows 2012 Server (original) + + + + + Return true if the platform is Windows 2012 Server R2 + + + + + Return true if the platform is Windows 7 + + + + + Return true if the platform is Windows 8 + + + + + Return true if the platform is Windows 8.1 + + + + + Return true if the platform is Windows 10 + + + + + Return true if the platform is Windows Server. This is named Windows + Server 10 to distinguish it from previous versions of Windows Server. + + + + + + Examines an attribute argument and tries to simulate what that value would have been if the literal syntax + which might have defined the value in C# had instead been used as an argument to a given method parameter in a direct call. + + + For example, since you can’t apply attributes using arguments, we allow the C# syntax + 10 ( value) or 0.1 ( value) to be specified. + NUnit then converts it to match the method’s parameters, just as if you were actually + using the syntax TestMethod(10) or TestMethod(0.1). + + + For another example, you might have written the syntax 10 and picked up the attribute + constructor overload; however, the test method for which this value is intended only has a + signature. Again, NUnit simulates what would have happened if the inferred C# syntax was transplanted + and you were actually using the syntax TestMethod(10). + + + + + + Converts an array of objects to the , if it is supported. + + + + + Converts a single value to the , if it is supported. + + + + + Converts a single value to the , if it is supported. + + + + + The ParameterWrapper class wraps a ParameterInfo so that it may + be used in a platform-independent manner. + + + + + Construct a ParameterWrapper for a given method and parameter + + + + + + + Gets a value indicating whether the parameter is optional + + + + + Gets an IMethodInfo representing the method for which this is a parameter. + + + + + Gets the underlying ParameterInfo + + + + + Gets the Type of the parameter + + + + + Returns an array of custom attributes of the specified type applied to this method + + + + + Gets a value indicating whether one or more attributes of the specified type are defined on the parameter. + + + + + PlatformHelper class is used by the PlatformAttribute class to + determine whether a platform is supported. + + + + + Comma-delimited list of all supported OS platform constants + + + + + Comma-delimited list of all supported Runtime platform constants + + + + + Default constructor uses the operating system and + common language runtime of the system. + + + + + Construct a PlatformHelper for a particular operating + system and common language runtime. Used in testing. + + RuntimeFramework to be used + OperatingSystem to be used + + + + Test to determine if one of a collection of platforms + is being used currently. + + + + + + + Tests to determine if the current platform is supported + based on a platform attribute. + + The attribute to examine + + + + + Tests to determine if the current platform is supported + based on a platform attribute. + + The attribute to examine + + + + + Test to determine if a particular platform or comma-delimited set of platforms is in use. + + Name of the platform or comma-separated list of platform ids + True if the platform is in use on the system + + + + Return the last failure reason. Results are not + defined if called before IsSupported( Attribute ) + is called. + + + + + Implements a simplified filter for use in deciding which + Types and Methods should be used to generate tests. It is consructed with a + list of strings, each of which may end up being interpreted in various ways. + + + + + Return a new PreFilter, without elements, which is considered + empty and always matches. + + + + + Return true if the filter is empty, in which case it + always succeeds. Technically, this is just a filter and + you can add elements but it's best to use Empty when + you need an empty filter and new when you plan to add. + + + + + Add a new filter element to the filter + + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + A PropertyBag represents a collection of name value pairs + that allows duplicate entries with the same key. Methods + are provided for adding a new pair as well as for setting + a key to a single value. All keys are strings but values + may be of any type. Null values are not permitted, since + a null entry represents the absence of the key. + + + + + Adds a key/value pair to the property set + + The key + The value + + + + Sets the value for a key, removing any other + values that are already in the property set. + + + + + + + Gets a single value for a key, using the first + one if multiple values are present and returning + null if the value is not found. + + + + + + + Gets a flag indicating whether the specified key has + any entries in the property set. + + The key to be checked + + True if their are values present, otherwise false + + + + + Gets a collection containing all the keys in the property set + + + + + + Gets or sets the list of values for a particular key + + + + + Returns an XmlNode representing the current PropertyBag. + + Not used + An XmlNode representing the PropertyBag + + + + Returns an XmlNode representing the PropertyBag after + adding it as a child of the supplied parent node. + + The parent node. + Not used + + + + + The PropertyNames class provides static constants for the + standard property ids that NUnit uses on tests. + + + + + The FriendlyName of the AppDomain in which the assembly is running + + + + + The selected strategy for joining parameter data into test cases + + + + + The process ID of the executing assembly + + + + + The stack trace from any data provider that threw + an exception. + + + + + The reason a test was not run + + + + + The author of the tests + + + + + The ApartmentState required for running the test + + + + + The categories applying to a test + + + + + The Description of a test + + + + + The number of threads to be used in running tests + + + + + The maximum time in ms, above which the test is considered to have failed + + + + + The ParallelScope associated with a test + + + + + The number of times the test should be repeated + + + + + Indicates that the test should be run on a separate thread + + + + + The culture to be set for a test + + + + + The UI culture to be set for a test + + + + + The type that is under test + + + + + The timeout value for the test + + + + + The test will be ignored until the given date + + + + + The optional Order the test will run in + + + + + Randomizer returns a set of random values in a repeatable + way, to allow re-running of tests if necessary. It extends + the .NET Random class, providing random values for a much + wider range of types. + + The class is used internally by the framework to generate + test case data and is also exposed for use by users through + the TestContext.Random property. + + + For consistency with the underlying Random Type, methods + returning a single value use the prefix "Next..." Those + without an argument return a non-negative value up to + the full positive range of the Type. Overloads are provided + for specifying a maximum or a range. Methods that return + arrays or strings use the prefix "Get..." to avoid + confusion with the single-value methods. + + + + + Initial seed used to create randomizers for this run + + + + + 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. + + + + + Create a new Randomizer using the next seed + available to ensure that each randomizer gives + a unique sequence of values. + + + + + + Default constructor + + + + + Construct based on seed value + + + + + + Returns a random unsigned int. + + + + + Returns a random unsigned int less than the specified maximum. + + + + + Returns a random unsigned int within a specified range. + + + + + Returns a non-negative random short. + + + + + Returns a non-negative random short less than the specified maximum. + + + + + Returns a non-negative random short within a specified range. + + + + + Returns a random unsigned short. + + + + + Returns a random unsigned short less than the specified maximum. + + + + + Returns a random unsigned short within a specified range. + + + + + Returns a random long. + + + + + Returns a random long less than the specified maximum. + + + + + Returns a non-negative random long within a specified range. + + + + + Returns a random ulong. + + + + + Returns a random ulong less than the specified maximum. + + + + + Returns a non-negative random long within a specified range. + + + + + Returns a random Byte + + + + + Returns a random Byte less than the specified maximum. + + + + + Returns a random Byte within a specified range + + + + + Returns a random SByte + + + + + Returns a random sbyte less than the specified maximum. + + + + + Returns a random sbyte within a specified range + + + + + Returns a random bool + + + + + Returns a random bool based on the probability a true result + + + + + Returns a random double between 0.0 and the specified maximum. + + + + + Returns a random double within a specified range. + + + + + Returns a random float. + + + + + Returns a random float between 0.0 and the specified maximum. + + + + + Returns a random float within a specified range. + + + + + Returns a random enum value of the specified Type as an object. + + + + + Returns a random enum value of the specified Type. + + + + + Default characters for random functions. + + Default characters are the English alphabet (uppercase & lowercase), Arabic numerals, and underscore + + + + Generate a random string based on the characters from the input string. + + desired length of output string. + string representing the set of characters from which to construct the resulting string + A random string of arbitrary length + + + + Generate a random string based on the characters from the input string. + + desired length of output string. + A random string of arbitrary length + Uses DefaultStringChars as the input character set + + + + Generate a random string based on the characters from the input string. + + A random string of the default length + Uses DefaultStringChars as the input character set + + + + Returns a random decimal. + + + + + Returns a random decimal between positive zero and the specified maximum. + + + + + Returns a random decimal within a specified range, which is not + permitted to exceed decimal.MaxVal in the current implementation. + + + A limitation of this implementation is that the range from min + to max must not exceed decimal.MaxVal. + + + + + Generates a valid version 4 . + + + + + Helper methods for inspecting a type by reflection. + + Many of these methods take ICustomAttributeProvider as an + argument to avoid duplication, even though certain attributes can + only appear on specific types of members, like MethodInfo or Type. + + In the case where a type is being examined for the presence of + an attribute, interface or named member, the Reflect methods + operate with the full name of the member being sought. This + removes the necessity of the caller having a reference to the + assembly that defines the item being sought and allows the + NUnit core to inspect assemblies that reference an older + version of the NUnit framework. + + + + + Examine a fixture type and return an array of methods having a + particular attribute. The array is order with base methods first. + + The type to examine + The attribute Type to look for + Specifies whether to search the fixture type inheritance chain + The array of methods found + + + + Examine a fixture type and return true if it has a method with + a particular attribute. + + The type to examine + The attribute Type to look for + True if found, otherwise false + + + + Invoke the default constructor on a Type + + The Type to be constructed + An instance of the Type + + + + Invoke a constructor on a Type with arguments + + The Type to be constructed + Arguments to the constructor + An instance of the Type + + + + Returns an array of types from an array of objects. + Differs from by returning + for null elements rather than throwing . + + + + + Gets the constructors to which the specified argument types can be coerced. + + + + + Determines if the given types can be coerced to match the given parameters. + + + + + Determines whether the current type can be implicitly converted to the specified type. + + + + + Invoke a parameterless method returning void on an object. + + A MethodInfo for the method to be invoked + The object on which to invoke the method + + + + Invoke a method, converting any TargetInvocationException to an NUnitException. + + A MethodInfo for the method to be invoked + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + + Selects the ultimate shadowing property just like would, + rather than throwing + for properties that shadow properties of a different property type + which is what does. + + + If you request both public and nonpublic properties, every public property is preferred + over every nonpublic property. It would violate the principle of least surprise for a + derived class’s implementation detail to be chosen over the public API for a type. + + + See . + See . + See . + + + + Represents the result of running a single test case. + + + + + Construct a TestCaseResult based on a TestMethod + + A TestMethod to which the result applies. + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + The TestResult class represents the result of a test. + + + + + Error message for when child tests have errors + + + + + Error message for when child tests have warnings + + + + + Error message for when child tests are ignored + + + + + The minimum duration for tests + + + + + Aggregate assertion count + + + + + ReaderWriterLock + + + + + Construct a test result given a Test + + The test to be used + + + + Gets the test with which this result is associated. + + + + + Gets the ResultState of the test result, which + indicates the success or failure of the test. + + + + + Gets the name of the test result + + + + + Gets the full name of the test result + + + + + Gets or sets the elapsed time for running the test in seconds + + + + + Gets or sets the time the test started running. + + + + + Gets or sets the time the test finished running. + + + + + Adds a test attachment to the test result + + The TestAttachment object to attach + + + + Gets the collection of files attached to the test + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + + Gets or sets the count of asserts executed + when running the test. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + Gets a TextWriter, which will write output to be included in the result. + + + + + Gets any text output written to this result. + + + + + Gets a list of assertion results associated with the test. + + + + + Returns the XML representation of the result. + + If true, descendant results are included + An XmlNode representing the result + + + + Adds the XML representation of the result as a child of the + supplied parent node.. + + The parent node. + If true, descendant results are included + + + + + Gets a count of pending failures (from Multiple Assert) + + + + + Gets the worst assertion status (highest enum) in all the assertion results + + + + + Set the result of the test + + The ResultState to use in the result + + + + Set the result of the test + + The ResultState to use in the result + A message associated with the result state + + + + Set the result of the test + + The ResultState to use in the result + A message associated with the result state + Stack trace giving the location of the command + + + + Set the test result based on the type of exception thrown + + The exception that was thrown + + + + Set the test result based on the type of exception thrown + + The exception that was thrown + The FailureSite to use in the result + + + + RecordTearDownException appends the message and stack trace + from an exception arising during teardown of the test + to any previously recorded information, so that any + earlier failure information is not lost. Note that + calling Assert.Ignore, Assert.Inconclusive, etc. during + teardown is treated as an error. If the current result + represents a suite, it may show a teardown error even + though all contained tests passed. + + The Exception to be recorded + + + + Update overall test result, including legacy Message, based + on AssertionResults that have been saved to this point. + + + + + Record an assertion result + + + + + Record an assertion result + + + + + Record an assertion result + + + + + Creates a failure message incorporating failures + from a Multiple Assert block for use by runners + that don't know about AssertionResults. + + Message as a string + + + + Adds a reason element to a node and returns it. + + The target node. + The new reason element. + + + + Adds a failure element to a node and returns it. + + The target node. + The new failure element. + + + + Adds an attachments element to a node and returns it. + + The target node. + The new attachments element. + + + + Represents the result of running a test suite + + + + + Construct a TestSuiteResult base on a TestSuite + + The TestSuite to which the result applies + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + Adds a child result to this result, setting this result's + ResultState to Failure if the child result failed. + + The result to be added + + + + Enumeration identifying a common language + runtime implementation. + + + + Any supported runtime framework + + + Microsoft .NET Framework + + + Microsoft Shared Source CLI + + + Mono + + + MonoTouch + + + Microsoft .NET Core + + + + RuntimeFramework represents a particular version + of a common language runtime implementation. + + + + + DefaultVersion is an empty Version, used to indicate that + NUnit should select the CLR version to use for the test. + + + + + Construct from a runtime type and version. If the version has + two parts, it is taken as a framework version. If it has three + or more, it is taken as a CLR version. In either case, the other + version is deduced based on the runtime type and provided version. + + The runtime type of the framework + The version of the framework + + + + Static method to return a RuntimeFramework object + for the framework that is currently in use. + + + + + The type of this runtime framework + + + + + The framework version for this runtime framework + + + + + The CLR version for this runtime framework + + + + + Return true if any CLR version may be used in + matching this RuntimeFramework object. + + + + + Returns the Display name for this framework + + + + + Parses a string representing a RuntimeFramework. + The string may be just a RuntimeType name or just + a Version or a hyphenated RuntimeType-Version or + a Version prefixed by 'versionString'. + + + + + + + Overridden to return the short name of the framework + + + + + + Returns true if the current framework matches the + one supplied as an argument. Two frameworks match + if their runtime types are the same or either one + is RuntimeType.Any and all specified version components + are equal. Negative (i.e. unspecified) version + components are ignored. + + The RuntimeFramework to be matched. + True on match, otherwise false + + + + Holds thread state which is captured and restored in order to sandbox user code. + + + + + Captures a snapshot of the tracked state of the current thread to be restored later. + + + + + Restores the tracked state of the current thread to the previously captured state. + + + + + Returns a copy with the specified culture. + + + + + Returns a copy with the specified UI culture. + + + + + Returns a copy with the specified principal. + + + + + May be called from any thread. + + + + + May be called from any thread. + + + + + May be called from any thread. + + + + + May be called from any thread, but may only be called once. + + + + + StackFilter class is used to remove internal NUnit + entries from a stack trace so that the resulting + trace provides better information about the test. + + + + + Single instance of our default filter + + + + + Construct a stack filter instance + + Regex pattern used to delete lines from the top of the stack + Regex pattern used to delete lines from the bottom of the stack + + + + Construct a stack filter instance + + Regex pattern used to delete lines from the top of the stack + + + + Construct a stack filter instance + + + + + Filters a raw stack trace and returns the result. + + The original stack trace + A filtered stack trace + + + + Provides methods to support legacy string comparison methods. + + + + + Compares two strings for equality, ignoring case if requested. + + The first string. + The second string.. + if set to true, the case of the letters in the strings is ignored. + Zero if the strings are equivalent, a negative number if strA is sorted first, a positive number if + strB is sorted first + + + + Compares two strings for equality, ignoring case if requested. + + The first string. + The second string.. + if set to true, the case of the letters in the strings is ignored. + True if the strings are equivalent, false if not. + + + + The TestCaseParameters class encapsulates method arguments and + other selected parameters needed for constructing + a parameterized test case. + + + + + The expected result to be returned + + + + + Default Constructor creates an empty parameter set + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a ParameterSet from an object implementing ITestCaseData + + + + + + The expected result of the test, which + must match the method return type. + + + + + Gets a value indicating whether an expected result was specified. + + + + + TestCaseTimeoutException is thrown when a test running directly + on a TestWorker thread is cancelled due to timeout. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + Helper class used to save and restore certain static or + singleton settings in the environment that affect tests + or which might be changed by the user tests. + + + + + Link to a prior saved context + + + + + Indicates that a stop has been requested + + + + + The event listener currently receiving notifications + + + + + The number of assertions for the current test + + + + + The current test result + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + An existing instance of TestExecutionContext. + + + + Gets and sets the current context. + + + + + Gets or sets the current test + + + + + The time the current test started execution + + + + + The time the current test started in Ticks + + + + + Gets or sets the current test result + + + + + Gets a TextWriter that will send output to the current test result. + + + + + The current test object - that is the user fixture + object on which tests are being executed. + + + + + Get or set indicator that run should stop on the first error + + + + + Gets an enum indicating whether a stop has been requested. + + + + + The current test event listener + + + + + The current WorkItemDispatcher. Made public for + use by nunitlite.tests + + + + + The ParallelScope to be used by tests running in this context. + For builds with out the parallel feature, it has no effect. + + + + + Default tolerance value used for floating point equality + when no other tolerance is specified. + + + + + The worker that spawned the context. + For builds without the parallel feature, it is null. + + + + + Gets the RandomGenerator specific to this Test + + + + + Gets the assert count. + + The assert count. + + + + The current nesting level of multiple assert blocks + + + + + Gets or sets the test case timeout value + + + + + Gets a list of ITestActions set by upstream tests + + + + + Saves or restores the CurrentCulture + + + + + Saves or restores the CurrentUICulture + + + + + Gets or sets the current for the Thread. + + + + + The current head of the ValueFormatter chain, copied from MsgUtils.ValueFormatter + + + + + If true, all tests must run on the same thread. No new thread may be spawned. + + + + + The number of times the current test has been scheduled for execution. + Currently only being executed in a test using the + + + + + Record any changes in the environment made by + the test code in the execution context so it + will be passed on to lower level tests. + + + + + Set up the execution environment to match a context. + Note that we may be running on the same thread where the + context was initially created or on a different thread. + + + + + Increments the assert count by one. + + + + + Increments the assert count by a specified amount. + + + + + Adds a new ValueFormatterFactory to the chain of formatters + + The new factory + + + + Sends a message from test to listeners. This message is not kind of test output and doesn't go to test result. + + A name recognized by the intended listeners. + A message to be sent + + + + Obtain lifetime service object + + + + + + An IsolatedContext is used when running code + that may effect the current result in ways that + should not impact the final result of the test. + A new TestExecutionContext is created with an + initially clear result, which is discarded on + exiting the context. + + + using (new TestExecutionContext.IsolatedContext()) + { + // Code that should not impact the result + } + + + + + Save the original current TestExecutionContext and + make a new isolated context current. + + + + + Restore the original TestExecutionContext. + + + + + An AdhocTestExecutionContext is created whenever a context is needed + but not available in CurrentContext. This happens when tests are run + on an ad-hoc basis or Asserts are used outside of tests. + + + + + Construct an AdhocTestExecutionContext, which is used + whenever the current TestExecutionContext is found to be null. + + + + + Enumeration indicating whether the tests are + running normally or being cancelled. + + + + + Running normally with no stop requested + + + + + A graceful stop has been requested + + + + + A forced stop has been requested + + + + + Interface to be implemented by filters applied to tests. + The filter applies when running the test, after it has been + loaded, since this is the only time an ITest exists. + + + + + Unique Empty filter. + + + + + Indicates whether this is the EmptyFilter + + + + + Indicates whether this is a top-level filter, + not contained in any other filter. + + + + + Determine if a particular test passes the filter criteria. The default + implementation checks the test itself, its parents and any descendants. + + Derived classes may override this method or any of the Match methods + to change the behavior of the filter. + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + Determine whether the test itself matches the filter criteria, without + examining either parents or descendants. This is overridden by each + different type of filter to perform the necessary tests. + + The test to which the filter is applied + True if the filter matches the any parent of the test + + + + Determine whether any ancestor of the test matches the filter criteria + + The test to which the filter is applied + True if the filter matches the an ancestor of the test + + + + Determine whether any descendant of the test matches the filter criteria. + + The test to be matched + True if at least one descendant matches the filter criteria + + + + Create a TestFilter instance from an XML representation. + + + + + Create a TestFilter from its TNode representation + + + + + Nested class provides an empty filter - one that always + returns true when called. It never matches explicitly. + + + + + Adds an XML node + + True if recursive + The added XML node + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + The TestCaseParameters class encapsulates method arguments and + other selected parameters needed for constructing + a parameterized test case. + + + + + Default Constructor creates an empty parameter set + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a ParameterSet from an object implementing ITestCaseData + + + + + + Type arguments used to create a generic fixture instance + + + + + TestListener provides an implementation of ITestListener that + does nothing. It is used only through its NULL property. + + + + + Called when a test has just started + + The test that is starting + + + + Called when a test case has finished + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the message to send + + + + Construct a new TestListener - private so it may not be used. + + + + + Get a listener that does nothing + + + + + TestNameGenerator is able to create test names according to + a coded pattern. + + + + + Default pattern used to generate names + + + + + Construct a TestNameGenerator + + + + + Construct a TestNameGenerator + + The pattern used by this generator. + + + + Get the display name for a TestMethod and its arguments + + A TestMethod + The display name + + + + Get the display name for a TestMethod and its arguments + + A TestMethod + Arguments to be used + The display name + + + + TestParameters is the abstract base class for all classes + that know how to provide data for constructing a test. + + + + + Default Constructor creates an empty parameter set + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a ParameterSet from an object implementing ITestData + + + + + + The RunState for this set of parameters. + + + + + The arguments to be used in running the test, + which must match the method signature. + + + + + A name to be used for this test case in lieu + of the standard generated name containing + the argument list. + + + + + Gets the property dictionary for this test + + + + + Applies ParameterSet values to the test itself. + + A test. + + + + The original arguments provided by the user, + used for display purposes. + + + + + The list of display names to use as the parameters in the test name. + + + + + TestProgressReporter translates ITestListener events into + the async callbacks that are used to inform the client + software about the progress of a test run. + + + + + Initializes a new instance of the class. + + The callback handler to be used for reporting progress. + + + + Called when a test has just started + + The test that is starting + + + + Called when a test has finished. Sends a result summary to the callback. + to + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + Returns the parent test item for the target test item if it exists + + + parent test item + + + + Makes a string safe for use as an attribute, replacing + characters that can't be used with their + corresponding XML representations. + + The string to be used + A new string with the values replaced + + + + ParameterizedFixtureSuite serves as a container for the set of test + fixtures created from a given Type using various parameters. + + + + + Initializes a new instance of the class. + + The ITypeInfo for the type that represents the suite. + + + + Gets a string representing the type of test + + + + + ParameterizedMethodSuite holds a collection of individual + TestMethods with their arguments applied. + + + + + Initializes a new instance of the class. + + + + + Gets a string representing the type of test + + + + + SetUpFixture extends TestSuite and supports + Setup and TearDown methods. + + + + + Initializes a new instance of the class. + + + + + The Test abstract class represents a test within the framework. + + + + + Static value to seed ids. It's started at 1000 so any + uninitialized ids will stand out. + + + + + Used to cache the declaring type for this MethodInfo + + + + + Method property backing field + + + + + Constructs a test given its name + + The name of the test + + + + Constructs a test given the path through the + test hierarchy to its parent and a name. + + The parent tests full name + The name of the test + + + + Constructs a test for a specific type. + + + + + Constructs a test for a specific method. + + + + + Gets or sets the id of the test + + + + + + Gets or sets the name of the test + + + + + Gets or sets the fully qualified name of the test + + + + + + Gets the name of the class where this test was declared. + Returns null if the test is not associated with a class. + + + + + Gets the name of the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + The arguments to use in creating the test or empty array if none required. + + + + + Gets the TypeInfo of the fixture used in running this test + or null if no fixture type is associated with it. + + + + + Gets a MethodInfo for the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + Whether or not the test should be run + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Gets a string representing the type of test. Used as an attribute + value in the XML representation of a test and has no other + function in the framework. + + + + + Gets a count of test cases represented by + or contained under this test. + + + + + Gets the properties for this test + + + + + Returns true if this is a TestSuite + + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets the parent as a Test object. + Used by the core to set the parent. + + + + + Gets this test's child tests + + A list of child tests + + + + Gets or sets a fixture object for running this test. + + + + + Static prefix used for ids in this AppDomain. + Set by FrameworkController. + + + + + Gets or Sets the Int value representing the seed for the RandomGenerator + + + + + + The SetUp methods. + + + + + The teardown methods + + + + + Creates a TestResult for this test. + + A TestResult suitable for this type of test. + + + + Modify a newly constructed test by applying any of NUnit's common + attributes, based on a supplied , which is + usually the reflection element from which the test was constructed, + but may not be in some instances. The attributes retrieved are + saved for use in subsequent operations. + + + + + Mark the test as Invalid (not runnable) specifying a reason + + The reason the test is not runnable + + + + Get custom attributes applied to a test + + + + + Add standard attributes and members to a test node. + + + + + + + Returns the XML representation of the test + + If true, include child tests recursively + + + + + Returns an XmlNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Compares this test to another test for sorting purposes + + The other test + Value of -1, 0 or +1 depending on whether the current test is less than, equal to or greater than the other test + + + + TestAssembly is a TestSuite that represents the execution + of tests in a managed assembly. + + + + + Initializes a new instance of the class + specifying the Assembly and the suite name. + + The assembly this test represents. + The desired name for the test suite. + + + + Initializes a new instance of the class + specifying the suite name for an assembly that could not be loaded. + + The desired name for the test suite. + + + + Copy-constructor style to create a filtered copy of the test assemblies + test cases + + + + + + + Gets the Assembly represented by this instance. + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Get custom attributes specified on the assembly + + + + + TestFixture is a surrogate for a user test fixture class, + containing one or more tests. + + + + + Initializes a new instance of the class. + + Type of the fixture. + Arguments used to instantiate the test fixture, or null if none used + + + + The TestMethod class represents a Test implemented as a method. + + + + + The ParameterSet used to create this test method + + + + + Initializes a new instance of the class. + + The method to be used as a test. + + + + Initializes a new instance of the class. + + The method to be used as a test. + The suite or fixture to which the new test will be added + + + + The arguments to use in executing the test method, or empty array if none are provided. + + + + + Overridden to return a TestCaseResult. + + A TestResult for this test. + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Returns a TNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Gets this test's child tests + + A list of child tests + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Returns the name of the method + + + + + TestSuite represents a composite test, which contains other tests. + + + + + Our collection of child tests + + + + + Initializes a new instance of the class. + + The name of the suite. + + + + Initializes a new instance of the class. + + Name of the parent suite. + The name of the suite. + + + + Initializes a new instance of the class. + + Type of the fixture. + Arguments used to instantiate the test fixture, or null if none used. + + + + Initializes a new instance of the class. + + Type of the fixture. + + + + Copy constructor style to create a filtered copy of the given test suite + + Test Suite to copy + Filter to be applied + + + + Sorts tests under this suite. + + + + + Adds a test to the suite. + + The test. + + + + Gets this test's child tests + + The list of child tests + + + + Gets a count of test cases represented by + or contained under this test. + + + + + + The arguments to use in creating the fixture, or empty array if none are provided. + + + + + Set to true to suppress sorting this suite's contents + + + + + OneTimeSetUp methods for this suite + + + + + OneTimeTearDown methods for this suite + + + + + Overridden to return a TestSuiteResult. + + A TestResult for this test. + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Returns an XmlNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Check that setup and teardown methods marked by certain attributes + meet NUnit's requirements and mark the tests not runnable otherwise. + + A list of methodinfos to check + + + + ThreadUtility provides a set of static methods convenient + for working with threads. + + + + + Pre-Task compatibility + + + + + Abort a thread, helping to dislodging it if it is blocked in native code + + The thread to abort + The native thread id (if known), otherwise 0. + If provided, allows the thread to be killed if it's in a message pump native blocking wait. + This must have previously been captured by calling from the running thread itself. + + + + Do our best to kill a thread + + The thread to kill + The native thread id (if known), otherwise 0. + If provided, allows the thread to be killed if it's in a message pump native blocking wait. + This must have previously been captured by calling from the running thread itself. + + + + Do our best to kill a thread, passing state info + + The thread to kill + Info for the ThreadAbortException handler + The native thread id (if known), otherwise 0. + If provided, allows the thread to be killed if it's in a message pump native blocking wait. + This must have previously been captured by calling from the running thread itself. + + + + Schedule a threadpool thread to check on the aborting thread in case it's in a message pump native blocking wait + + + + + Captures the current thread's native id. If provided to later, allows the thread to be killed if it's in a message pump native blocking wait. + + + + + Sends a message to the thread to dislodge it from native code and allow a return to managed code, where a ThreadAbortException can be generated. + The message is meaningless (WM_CLOSE without a window handle) but it will end any blocking message wait. + + + + + TypeHelper provides static methods that operate on Types. + + + + + Gets the display name for a Type as used by NUnit. + + The Type for which a display name is needed. + The display name for the Type + + + + Gets the display name for a Type as used by NUnit. + + The Type for which a display name is needed. + The arglist provided. + The display name for the Type + + + + Returns the best fit for a common type to be used in + matching actual arguments to a methods Type parameters. + + + + + Determines whether the specified type is numeric. + + The type to be examined. + + true if the specified type is numeric; otherwise, false. + + + + + Convert an argument list to the required parameter types. + Currently, only widening numeric conversions are performed. + + An array of args to be converted + A ParameterInfo[] whose types will be used as targets + + + + Determines whether this instance can deduce type args for a generic type from the supplied arguments. + + The type to be examined. + The arglist. + The type args to be used. + + true if this the provided args give sufficient information to determine the type args to be used; otherwise, false. + + + + + Return the interfaces implemented by a Type. + + The Type to be examined. + An array of Types for the interfaces. + + + + Return whether or not the given type is a ValueTuple. + + Type. + Whether or not the given type is a ValueTuple. + + + + Return whether or not the given type is a Tuple. + + Type. + Whether or not the given type is a Tuple. + + + + Determines whether the cast to the given type would succeed. + If is and + can be , the cast succeeds just like the C# language feature. + + The object to cast. + + + + Casts to a value of the given type if possible. + If is and + can be , the cast succeeds just like the C# language feature. + + The object to cast. + The value of the object, if the cast succeeded. + + + + Used for resolving the type difference between objects. + + + + + Gets the shortened type name difference between and . + + The expected object. + The actual object. + Output of the unique type name for the expected object. + Output of the unique type name for actual object. + + + + Gets the shortened type name difference between and . + + The expected object . + The actual object . + Output of the unique type name for the expected object. + Output of the unique type name for actual object. + + + + Obtain the shortened generic template parameters of the given and , + if they are generic. + + The expected . + The actual . + Shortened generic parameters of the expected . + Shortened generic parameters of the actual . + + + + Obtain a shortened name of the given . + + + + + Shorten the given names by only including the relevant differing namespaces/types, if they differ. + + The expected . + The actual . + The shortened expected name. + The shortened actual name. + + + + Returns whether or not the is generic. + + + + + Returns the fully qualified generic name of a given . + + + + + Reconstruct a generic type name using the provided generic type name, and a + of the template parameters. + + The name of the generic type, including the number of template parameters expected. + A of names of the template parameters of the provided generic type. + + + + Obtain the shortened generic names of the given expected and actual s. + + The expected . + The actual . + The shortened expected generic name. + The shortened actual generic name. + + + + The TypeWrapper class wraps a Type so it may be used in + a platform-independent manner. + + + + + Construct a TypeWrapper for a specified Type. + + + + + Gets the underlying Type on which this TypeWrapper is based. + + + + + Gets the base type of this type as an ITypeInfo + + + + + Gets the Name of the Type + + + + + Gets the FullName of the Type + + + + + Gets the assembly in which the type is declared + + + + + Gets the namespace of the Type + + + + + Gets a value indicating whether the type is abstract. + + + + + Gets a value indicating whether the Type is a generic Type + + + + + Returns true if the Type wrapped is T + + + + + Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types. + + + + + Gets a value indicating whether the Type is a generic Type definition + + + + + Gets a value indicating whether the type is sealed. + + + + + Gets a value indicating whether this type represents a static class. + + + + + Get the display name for this type + + + + + Get the display name for an object of this type, constructed with the specified args. + + + + + Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments + + + + + Returns a Type representing a generic type definition from which this Type can be constructed. + + + + + Returns an array of custom attributes of the specified type applied to this type + + + + + Returns a value indicating whether the type has an attribute of the specified type. + + + + + + + + Returns a flag indicating whether this type has a method with an attribute of the specified type. + + + + + + + Returns an array of IMethodInfos for methods of this Type + that match the specified flags. + + + + + Gets the public constructor taking the specified argument Types + + + + + Returns a value indicating whether this Type has a public constructor taking the specified argument Types. + + + + + Construct an object of this Type, using the specified arguments. + + + + + Override ToString() so that error messages in NUnit's own tests make sense + + + + + Encapsulates the ability to increment a value by an amount which may be of a different type. + + + + + Creates a from the specified value if the current instance is able to + use it to increment the on values which it operates. If the creation fails, + is thrown. + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values on which it operates. A return value indicates + whether the creation succeeded. + + + + + Provides a convenient shorthand when is + and the default value of represents zero. + + + + + Initializes a new instance of the class. + + The amount by which to increment each time this step is applied. + + Must increment the given value and return the result. + If the result is outside the range representable by , + must throw . If the result does not change due to lack + of precision representable by , must throw . + + + + + Increments the given value and returns the result. + If the result is outside the range representable by , + throws . If the result does not change due to lack + of precision representable by , throws . + + + + + + + Encapsulates the ability to increment a value by an amount + which may be of a different type. + + + + + Increments the given value and returns the result. + If the result is outside the range representable by , + throws . If the result does not change due to lack + of precision representable by , throws . + + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values of type . If the creation fails, + is thrown. + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values of type . A return value indicates + whether the creation succeeded. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + 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 equality with zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 to the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable to 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + 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 a subpath of the 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 + inclusively within a specified range. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + + Returns a constraint that tests if an item is equal to any of parameters + + Expected values + + + + When implemented by an attribute, this interface implemented to provide actions to execute before and after tests. + + + + + Executed before each test is run + + The test that is going to be run. + + + + Executed after each test is run + + The test that has just been run. + + + + Provides the target for the action attribute + + The target for the action attribute + + + + 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 + + + + + Basic Asserts on strings. + + + + + DO NOT USE! Use StringAssert.AreEqualIgnoringCase(...) or Assert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 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 + + + + 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 TestCaseData class represents a set of arguments + and other parameter info to be used for a parameterized + test case. It is derived from TestCaseParameters and adds a + fluent syntax for use in initializing the 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 name of the test case + + The modified TestCaseData instance + + + + Sets the list of display names to use as the parameters in the test name. + + + + + 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 + + + + + + + + Marks the test case as explicit. + + + + + Marks the test case as explicit, specifying the reason. + + + + + Ignores this TestCase, specifying the reason. + + The reason. + + + + + Provide the context information of the current test. + This is an adapter for the internal ExecutionContext + class, hiding the internals from the user test. + + + + + Construct a TestContext for an ExecutionContext + + The ExecutionContext to adapt + + + + 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 TextWriter that will send output to the current test result. + + + + + Gets a TextWriter that will send output directly to Console.Error + + + + + Gets a TextWriter for use in displaying immediate progress messages + + + + + TestParameters object holds parameters for the test run, if any are specified + + + + + Static DefaultWorkDirectory is now used as the source + of the public instance property WorkDirectory. This is + a bit odd but necessary to avoid breaking user tests. + + + + + Get a representation of the current test. + + + + + Gets a Representation of the TestResult for the current test. + + + + + Gets the unique name of the Worker that is executing this test. + + + + + Gets the directory containing the current test assembly. + + + + + Gets the directory to be used for outputting files created + by this test run. + + + + + Gets the random generator. + + + The random generator. + + + + + Gets the number of assertions executed + up to this point in the test. + + + + + Get the number of times the current Test has been repeated. This is currently only + set when using the . + TODO: add this to the RepeatAttribute as well + + + + Write the string representation of a boolean value to the current result + + + Write a char to the current result + + + Write a char array to the current result + + + Write the string representation of a double to the current result + + + Write the string representation of an Int32 value to the current result + + + Write the string representation of an Int64 value to the current result + + + Write the string representation of a decimal value to the current result + + + Write the string representation of an object to the current result + + + Write the string representation of a Single value to the current result + + + Write a string to the current result + + + Write the string representation of a UInt32 value to the current result + + + Write the string representation of a UInt64 value to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a line terminator to the current result + + + Write the string representation of a boolean value to the current result followed by a line terminator + + + Write a char to the current result followed by a line terminator + + + Write a char array to the current result followed by a line terminator + + + Write the string representation of a double to the current result followed by a line terminator + + + Write the string representation of an Int32 value to the current result followed by a line terminator + + + Write the string representation of an Int64 value to the current result followed by a line terminator + + + Write the string representation of a decimal value to the current result followed by a line terminator + + + Write the string representation of an object to the current result followed by a line terminator + + + Write the string representation of a Single value to the current result followed by a line terminator + + + Write a string to the current result followed by a line terminator + + + Write the string representation of a UInt32 value to the current result followed by a line terminator + + + Write the string representation of a UInt64 value to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + + This method adds the a new ValueFormatterFactory to the + chain of responsibility used for formatting values in messages. + The scope of the change is the current TestContext. + + The factory delegate + + + + Attach a file to the current test result + + Relative or absolute file path to attachment + Optional description of attachment + + + + This method provides a simplified way to add a ValueFormatter + delegate to the chain of responsibility, creating the factory + delegate internally. It is useful when the Type of the object + is the only criterion for selection of the formatter, since + it can be used without getting involved with a compound function. + + The type supported by this formatter + The ValueFormatter delegate + + + + TestAdapter adapts a Test for consumption by + the user test code. + + + + + Construct a TestAdapter for a Test + + The Test to be adapted + + + + Gets the unique Id of a test + + + + + The name of the test, which may or may not be + the same as the method name. + + + + + The name of the method representing the test. + + + + + The FullName of the test + + + + + The ClassName of the test + + + + + A shallow copy of the properties of the test. + + + + + The arguments to use in creating the test or empty array if none are required. + + + + + ResultAdapter adapts a TestResult for consumption by + the user test code. + + + + + Construct a ResultAdapter for a TestResult + + The TestResult to be adapted + + + + Gets a ResultState representing the outcome of the test + up to this point in its execution. + + + + + Gets a list of the assertion results generated + up to this point in the test. + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + adapts an + for consumption by the user. + + + + + Construct a from a source + . + + + + + Get the first property with the given , if it can be found, otherwise + returns null. + + + + + Indicates whether is found in this + . + + + + + Returns a collection of properties + with the given . + + + + + Returns the count of elements with the given . + + + + + Returns a collection of the property keys. + + + + + The TestFixtureData class represents a set of arguments + and other parameter info to be used for a parameterized + fixture. It is derived from TestFixtureParameters and adds a + fluent syntax for use in initializing the fixture. + + + + + 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 name of the test fixture + + The modified TestFixtureData instance + + + + Sets the list of display names to use as the parameters in the test name. + + + + + Marks the test fixture as explicit. + + + + + Marks the test fixture as explicit, specifying the reason. + + + + + Ignores this TestFixture, specifying the reason. + + The reason. + + + + + TestParameters class holds any named parameters supplied to the test run + + + + + Gets the number of test parameters + + + + + Gets a collection of the test parameter names + + + + + Gets a flag indicating whether a parameter with the specified name exists. + + Name of the parameter + True if it exists, otherwise false + + + + Indexer provides access to the internal dictionary + + Name of the parameter + Value of the parameter or null if not present + + + + Get method is a simple alternative to the indexer + + Name of the parameter + Value of the parameter or null if not present + + + + Get the value of a parameter or a default string + + Name of the parameter + Default value of the parameter + Value of the parameter or default value if not present + + + + Get the value of a parameter or return a default + + The return Type + Name of the parameter + Default value of the parameter + Value of the parameter or default value if not present + + + + Adds a parameter to the list + + Name of the parameter + Value of the parameter + + + + Helper class with properties and methods that supply + constraints that operate on exceptions. + + + + + 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 ArgumentException + + + + + Creates a constraint specifying an expected ArgumentNullException + + + + + Creates a constraint specifying an expected InvalidOperationException + + + + + Creates a constraint specifying that no exception is thrown + + + + + 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 + + + + + Provides static methods to express conditions + that must be met for the test to succeed. If + any test fails, a warning is issued. + + + + + DO NOT USE! + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + Not applicable + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + 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 a warning is issued. + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning on success. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning on success. + + The Type being compared. + 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 an actual value, succeeding if the constraint + fails and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + 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 a warning is issued. + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + The message to display if the condition is true + Arguments to be used in formatting the message + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning if it succeeds. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning if it succeeds. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + FrameworkPackageSettings is a static class containing constant values that + are used as keys in setting up a TestPackage. These values are used in + the framework, and set in the runner. Setting values may be a string, int or bool. + + + + + Flag (bool) indicating whether tests are being debugged. + + + + + Flag (bool) indicating whether to pause execution of tests to allow + the user to attach a debugger. + + + + + The InternalTraceLevel for this run. Values are: "Default", + "Off", "Error", "Warning", "Info", "Debug", "Verbose". + Default is "Off". "Debug" and "Verbose" are synonyms. + + + + + Full path of the directory to be used for work and result files. + This path is provided to tests by the framework TestContext. + + + + + Integer value in milliseconds for the default timeout value + for test cases. If not specified, there is no timeout except + as specified by attributes on the tests themselves. + + + + + A TextWriter to which the internal trace will be sent. + + + + + A list of tests to be loaded. + + + + + The number of test threads to run for the assembly. If set to + 1, a single queue is used. If set to 0, tests are executed + directly, without queuing. + + + + + The random seed to be used for this assembly. If specified + as the value reported from a prior run, the framework should + generate identical random values for tests as were used for + that run, provided that no change has been made to the test + assembly. Default is a random value itself. + + + + + If true, execution stops after the first error or failure. + + + + + If true, use of the event queue is suppressed and test events are synchronous. + + + + + The default naming pattern used in generating test names + + + + + Parameters to be passed on to the tests, serialized to a single string which needs parsing. Obsoleted by ; kept for backward compatibility. + + + + + Parameters to be passed on to the tests, already parsed into an IDictionary<string, string>. Replaces . + + + + + If true, the tests will run on the same thread as the NUnit runner itself + + + + + Provides a platform-independent methods for getting attributes + for use by AttributeConstraint and AttributeExistsConstraint. + + + + + Gets the custom attributes from the given object. + + The actual. + Type of the attribute. + if set to true [inherit]. + A list of the given attribute on the given object. + + + + A MarshalByRefObject that lives forever + + + + + Obtains a lifetime service object to control the lifetime policy for this instance. + + + + + Provides NUnit specific extensions to aid in Reflection + across multiple frameworks + + + This version of the class supplies GetTypeInfo() on platforms + that don't support it. + + + + + GetTypeInfo gives access to most of the Type information we take for granted + on .NET Core and Windows Runtime. Rather than #ifdef different code for different + platforms, it is easiest to just code all platforms as if they worked this way, + thus the simple passthrough. + + + + + + + See . + + + + + Extensions for Assembly that are not available in pre-4.5 .NET releases + + + + + An easy way to get a single custom attribute from an assembly + + The attribute Type + The assembly + An attribute of Type T + + + + Extensions for MethodInfo that are not available in pre-4.5 .NET releases + + + + + See . + + + + + Represents a thread-safe first-in, first-out collection of objects. + + Specifies the type of elements in the queue. + + All public and protected members of are thread-safe and may be used + concurrently from multiple threads. + + + + + Initializes a new instance of the class. + + + + + Initializes the contents of the queue from an existing collection. + + A collection from which to copy elements. + + + + Initializes a new instance of the + class that contains elements copied from the specified collection + + The collection whose elements are copied to the new . + The argument is + null. + + + + Get the data array to be serialized + + + + + Construct the queue from a previously seiralized one + + + + + Copies the elements of the to an , starting at a particular + index. + + The one-dimensional Array that is the + destination of the elements copied from the + . The Array must have zero-based indexing. + The zero-based index in at which copying + begins. + is a null reference (Nothing in + Visual Basic). + is less than + zero. + + is multidimensional. -or- + does not have zero-based indexing. -or- + is equal to or greater than the length of the + -or- The number of elements in the source is + greater than the available space from to the end of the destination + . -or- The type of the source cannot be cast automatically to the type of the + destination . + + + + + Gets a value indicating whether access to the is + synchronized with the SyncRoot. + + true if access to the is synchronized + with the SyncRoot; otherwise, false. For , this property always + returns false. + + + + Gets an object that can be used to synchronize access to the . This property is not supported. + + The SyncRoot property is not supported. + + + + Returns an enumerator that iterates through a collection. + + An that can be used to iterate through the collection. + + + + Attempts to add an object to the . + + The object to add to the . The value can be a null + reference (Nothing in Visual Basic) for reference types. + + true if the object was added successfully; otherwise, false. + For , this operation will always add the object to the + end of the + and return true. + + + + Attempts to remove and return an object from the . + + + When this method returns, if the operation was successful, contains the + object removed. If no object was available to be removed, the value is unspecified. + + true if an element was removed and returned succesfully; otherwise, false. + For , this operation will attempt to remove the object + from the beginning of the . + + + + + Gets a value that indicates whether the is empty. + + true if the is empty; otherwise, false. + + For determining whether the collection contains any items, use of this property is recommended + rather than retrieving the number of items from the property and comparing it + to 0. However, as this collection is intended to be accessed concurrently, it may be the case + that another thread will modify the collection after returns, thus invalidating + the result. + + + + + Copies the elements stored in the to a new array. + + A new array containing a snapshot of elements copied from the . + + + + Copies the elements to a new . + + A new containing a snapshot of + elements copied from the . + + + + Store the position of the current head and tail positions. + + return the head segment + return the tail segment + return the head offset, value range [0, SEGMENT_SIZE] + return the tail offset, value range [-1, SEGMENT_SIZE-1] + + + + Gets the number of elements contained in the . + + The number of elements contained in the . + + For determining whether the collection contains any items, use of the + property is recommended rather than retrieving the number of items from the + property and comparing it to 0. + + + + + Copies the elements to an existing one-dimensional Array, starting at the specified array index. + + The one-dimensional Array that is the + destination of the elements copied from the + . The Array must have zero-based + indexing. + The zero-based index in at which copying + begins. + is a null reference (Nothing in + Visual Basic). + is less than + zero. + is equal to or greater than the + length of the + -or- The number of elements in the source is greater than the + available space from to the end of the destination . + + + + + Returns an enumerator that iterates through the . + + An enumerator for the contents of the . + + The enumeration represents a moment-in-time snapshot of the contents + of the queue. It does not reflect any updates to the collection after + GetEnumerator was called. The enumerator is safe to use + concurrently with reads from and writes to the queue. + + + + + Helper method of GetEnumerator to seperate out yield return statement, and prevent lazy evaluation. + + + + + Adds an object to the end of the . + + The object to add to the end of the . The value can be a null reference + (Nothing in Visual Basic) for reference types. + + + + + Attempts to remove and return the object at the beginning of the . + + + When this method returns, if the operation was successful, contains the + object removed. If no object was available to be removed, the value is unspecified. + + true if an element was removed and returned from the beggining of the + succesfully; otherwise, false. + + + + Attempts to return an object from the beginning of the + without removing it. + + When this method returns, contains an object from + the beginning of the or an + unspecified value if the operation failed. + true if and object was returned successfully; otherwise, false. + + + + private class for ConcurrentQueue. + a queue is a linked list of small arrays, each node is called a segment. + A segment contains an array, a pointer to the next segment, and m_low, m_high indices recording + the first and last valid elements of the array. + + + + + Create and initialize a segment with the specified index. + + + + + return the next segment + + + + + return true if the current segment is empty (doesn't have any element available to dequeue, + false otherwise + + + + + Add an element to the tail of the current segment + exclusively called by ConcurrentQueue.InitializedFromCollection + InitializeFromCollection is responsible to guaratee that there is no index overflow, + and there is no contention + + + + + + Create a new segment and append to the current one + Does not update the m_tail pointer + exclusively called by ConcurrentQueue.InitializedFromCollection + InitializeFromCollection is responsible to guaratee that there is no index overflow, + and there is no contention + + the reference to the new Segment + + + + Create a new segment and append to the current one + Update the m_tail pointer + This method is called when there is no contention + + + + + Try to append an element at the end of this segment. + + the element to append + true if the element is appended, false if the current segment is full + if appending the specified element succeeds, and after which the segment is full, + then grow the segment + + + + try to remove an element from the head of current segment + + The result. + return false only if the current segment is empty + + + + try to peek the current segment + + holds the return value of the element at the head position, + value set to default(T) if there is no such an element + true if there are elements in the current segment, false otherwise + + + + Adds part or all of the current segment into a List. + + the list to which to add + the start position + the end position + + + + return the position of the head of the current segment + Value range [0, SEGMENT_SIZE], if it's SEGMENT_SIZE, it means this segment is exhausted and thus empty + + + + + return the logical position of the tail of the current segment + Value range [-1, SEGMENT_SIZE-1]. When it's -1, it means this is a new segment and has no elemnet yet + + + + + A wrapper struct for volatile bool, please note the copy of the struct it self will not be volatile + for example this statement will not include in volatilness operation volatileBool1 = volatileBool2 the jit will copy the struct and will ignore the volatile + + + + + Defines methods to manipulate thread-safe collections intended for producer/consumer usage. + + Specifies the type of elements in the collection. + + All implementations of this interface must enable all members of this interface + to be used concurrently from multiple threads. + + + + + Copies the elements of the to + an + , starting at a specified index. + + The one-dimensional that is the destination of + the elements copied from the . + The array must have zero-based indexing. + The zero-based index in at which copying + begins. + is a null reference (Nothing in + Visual Basic). + is less than + zero. + is equal to or greater than the + length of the + -or- The number of elements in the source is greater than the + available space from to the end of the destination . + + + + + Attempts to add an object to the . + + The object to add to the . + true if the object was added successfully; otherwise, false. + The was invalid for this collection. + + + + Attempts to remove and return an object from the . + + + When this method returns, if the object was removed and returned successfully, contains the removed object. If no object was available to be removed, the value is + unspecified. + + true if an object was removed and returned successfully; otherwise, false. + + + + Copies the elements contained in the to a new array. + + A new array containing the elements copied from the . + + + + A debugger view of the IProducerConsumerCollection that makes it simple to browse the + collection's contents at a point in time. + + The type of elements stored within. + + + + Constructs a new debugger view object for the provided collection object. + + A collection to browse in the debugger. + + + + Returns a snapshot of the underlying collection's elements. + + + + + + + + + + + + + + + + + + + + + + + + + Compatibility polyfill based on . + + + + + Provides support for spin-based waiting. + + + + encapsulates common spinning logic. On single-processor machines, yields are + always used instead of busy waits, and on computers with Intel� processors employing Hyper-Threading� + technology, it helps to prevent hardware thread starvation. SpinWait encapsulates a good mixture of + spinning and true yielding. + + + is a value type, which means that low-level code can utilize SpinWait without + fear of unnecessary allocation overheads. SpinWait is not generally useful for ordinary applications. + In most cases, you should use the synchronization classes provided by the .NET Framework, such as + . For most purposes where spin waiting is required, however, + the type should be preferred over the method. + + + While SpinWait is designed to be used in concurrent applications, it is not designed to be + used from multiple threads concurrently. SpinWait's members are not thread-safe. If multiple + threads must spin, each should use its own instance of SpinWait. + + + + + + Gets the number of times has been called on this instance. + + + + + Gets whether the next call to will yield the processor, triggering a + forced context switch. + + Whether the next call to will yield the processor, triggering a + forced context switch. + + On a single-CPU machine, always yields the processor. On machines with + multiple CPUs, may yield after an unspecified number of calls. + + + + + Performs a single spin. + + + This is typically called in a loop, and may change in behavior based on the number of times a + has been called thus far on this instance. + + + + + Resets the spin counter. + + + This makes and behave as though no calls + to had been issued on this instance. If a instance + is reused many times, it may be useful to reset it to avoid yielding too soon. + + + + + Spins until the specified condition is satisfied. + + A delegate to be executed over and over until it returns true. + The argument is null. + + + + Spins until the specified condition is satisfied or until the specified timeout is expired. + + A delegate to be executed over and over until it returns true. + + A that represents the number of milliseconds to wait, + or a TimeSpan that represents -1 milliseconds to wait indefinitely. + True if the condition is satisfied within the timeout; otherwise, false + The argument is null. + is a negative number + other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater than + . + + + + Spins until the specified condition is satisfied or until the specified timeout is expired. + + A delegate to be executed over and over until it returns true. + The number of milliseconds to wait, or (-1) to wait indefinitely. + True if the condition is satisfied within the timeout; otherwise, false + The argument is null. + is a + negative number other than -1, which represents an infinite time-out. + + + + A helper class to get the number of processors, it updates the numbers of processors every sampling interval. + + + + + Gets the number of available processors + + + + + Gets whether the current machine has only a single processor. + + + + + A helper class to capture a start time using Environment.TickCout as a time in milliseconds, also updates a given timeout bu subtracting the current time from + the start time + + + + + Returns the Environment.TickCount as a start time in milliseconds as a uint, TickCount tools over from postive to negative every ~ 25 days + then ~25 days to back to positive again, uint is sued to ignore the sign and double the range to 50 days + + + + + + Helper function to measure and update the elapsed time + + The first time (in milliseconds) observed when the wait started + The orginal wait timeoutout in milliseconds + The new wait time in milliseconds, -1 if the time expired + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/NUnit.3.11.0/lib/net40/nunit.framework.dll b/packages/NUnit.3.11.0/lib/net40/nunit.framework.dll new file mode 100644 index 0000000000000000000000000000000000000000..d6c8551c28a6ce0d37b660efcd17bfd002a11f61 Binary files /dev/null and b/packages/NUnit.3.11.0/lib/net40/nunit.framework.dll differ diff --git a/packages/NUnit.3.11.0/lib/net40/nunit.framework.pdb b/packages/NUnit.3.11.0/lib/net40/nunit.framework.pdb new file mode 100644 index 0000000000000000000000000000000000000000..da14e45c363d71f6a1a20cfd772da517396edee6 Binary files /dev/null and b/packages/NUnit.3.11.0/lib/net40/nunit.framework.pdb differ diff --git a/packages/NUnit.3.11.0/lib/net40/nunit.framework.xml b/packages/NUnit.3.11.0/lib/net40/nunit.framework.xml new file mode 100644 index 0000000000000000000000000000000000000000..eec4dc6380b9cc34d9163356deca07c153c81549 --- /dev/null +++ b/packages/NUnit.3.11.0/lib/net40/nunit.framework.xml @@ -0,0 +1,20566 @@ + + + + nunit.framework + + + + + 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 + + + + + DefaultTestAssemblyBuilder loads a single assembly and builds a TestSuite + containing test fixtures present in the assembly. + + + + + The default suite builder used by the test assembly builder. + + + + + Initializes a new instance of the class. + + + + + Build a suite of tests from a provided assembly + + The assembly from which tests are to be built + A dictionary of options to use in building the suite + + A TestSuite containing the tests found in the assembly + + + + + Build a suite of tests given the name or the location of an assembly + + The name or the location of the assembly. + A dictionary of options to use in building the suite + + A TestSuite containing the tests found in the assembly + + + + + FrameworkController provides a facade for use in loading, browsing + and running tests without requiring a reference to the NUnit + framework. All calls are encapsulated in constructors for + this class and its nested classes, which only require the + types of the Common Type System as arguments. + + The controller supports four actions: Load, Explore, Count and Run. + They are intended to be called by a driver, which should allow for + proper sequencing of calls. Load must be called before any of the + other actions. The driver may support other actions, such as + reload on run, by combining these calls. + + + + + Construct a FrameworkController using the default builder and runner. + + The AssemblyName or path to the test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + + + + Construct a FrameworkController using the default builder and runner. + + The test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + + + + Construct a FrameworkController, specifying the types to be used + for the runner and builder. This constructor is provided for + purposes of development. + + The full AssemblyName or the path to the test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + The Type of the test runner + The Type of the test builder + + + + Construct a FrameworkController, specifying the types to be used + for the runner and builder. This constructor is provided for + purposes of development. + + The test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + The Type of the test runner + The Type of the test builder + + + + Gets the ITestAssemblyBuilder used by this controller instance. + + The builder. + + + + Gets the ITestAssemblyRunner used by this controller instance. + + The runner. + + + + Gets the AssemblyName or the path for which this FrameworkController was created + + + + + Gets the Assembly for which this + + + + + Gets a dictionary of settings for the FrameworkController + + + + + Loads the tests in the assembly + + + + + + Returns info about the tests in an assembly + + A string containing the XML representation of the filter to use + The XML result of exploring the tests + + + + Runs the tests in an assembly + + A string containing the XML representation of the filter to use + The XML result of the test run + + + + Runs the tests in an assembly synchronously reporting back the test results through the callback + or through the return value + + The callback that receives the test results + A string containing the XML representation of the filter to use + The XML result of the test run + + + + Runs the tests in an assembly asynchronously reporting back the test results through the callback + + The callback that receives the test results + A string containing the XML representation of the filter to use + + + + Stops the test run + + True to force the stop, false for a cooperative stop + + + + Counts the number of test cases in the loaded TestSuite + + A string containing the XML representation of the filter to use + The number of tests + + + + Inserts environment element + + Target node + The new node + + + + Inserts settings element + + Target node + Settings dictionary + The new node + + + + FrameworkControllerAction is the base class for all actions + performed against a FrameworkController. + + + + + LoadTestsAction loads a test into the FrameworkController + + + + + LoadTestsAction loads the tests in an assembly. + + The controller. + The callback handler. + + + + ExploreTestsAction returns info about the tests in an assembly + + + + + Initializes a new instance of the class. + + The controller for which this action is being performed. + Filter used to control which tests are included (NYI) + The callback handler. + + + + CountTestsAction counts the number of test cases in the loaded TestSuite + held by the FrameworkController. + + + + + Construct a CountsTestAction and perform the count of test cases. + + A FrameworkController holding the TestSuite whose cases are to be counted + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + RunTestsAction runs the loaded TestSuite held by the FrameworkController. + + + + + Construct a RunTestsAction and run all tests in the loaded TestSuite. + + A FrameworkController holding the TestSuite to run + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + RunAsyncAction initiates an asynchronous test run, returning immediately + + + + + Construct a RunAsyncAction and run all tests in the loaded TestSuite. + + A FrameworkController holding the TestSuite to run + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + StopRunAction stops an ongoing run. + + + + + Construct a StopRunAction and stop any ongoing run. If no + run is in process, no error is raised. + + The FrameworkController for which a run is to be stopped. + True the stop should be forced, false for a cooperative stop. + >A callback handler used to report results + A forced stop will cause threads and processes to be killed as needed. + + + + The ITestAssemblyBuilder interface is implemented by a class + that is able to build a suite of tests given an assembly or + an assembly filename. + + + + + Build a suite of tests from a provided assembly + + The assembly from which tests are to be built + A dictionary of options to use in building the suite + A TestSuite containing the tests found in the assembly + + + + Build a suite of tests given the filename of an assembly + + The filename of the assembly from which tests are to be built + A dictionary of options to use in building the suite + A TestSuite containing the tests found in the assembly + + + + The ITestAssemblyRunner interface is implemented by classes + that are able to execute a suite of tests loaded + from an assembly. + + + + + Gets the tree of loaded tests, or null if + no tests have been loaded. + + + + + Gets the tree of test results, if the test + run is completed, otherwise null. + + + + + Indicates whether a test has been loaded + + + + + Indicates whether a test is currently running + + + + + Indicates whether a test run is complete + + + + + Loads the tests found in an Assembly, returning an + indication of whether or not the load succeeded. + + File name of the assembly to load + Dictionary of options to use in loading the test + An ITest representing the loaded tests + + + + Loads the tests found in an Assembly, returning an + indication of whether or not the load succeeded. + + The assembly to load + Dictionary of options to use in loading the test + An ITest representing the loaded tests + + + + Count Test Cases using a filter + + The filter to apply + The number of test cases found + + + + Explore the test cases using a filter + + The filter to apply + Test Assembly with test cases that matches the filter + + + + Run selected tests and return a test result. The test is run synchronously, + and the listener interface is notified as it progresses. + + Interface to receive ITestListener notifications. + A test filter used to select tests to be run + + + + Run selected tests asynchronously, notifying the listener interface as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + + + Wait for the ongoing run to complete. + + Time to wait in milliseconds + True if the run completed, otherwise false + + + + Signal any test run that is in process to stop. Return without error if no test is running. + + If true, kill any test-running threads + + + + Implementation of ITestAssemblyRunner + + + + + Initializes a new instance of the class. + + The builder. + + + + Gets the default level of parallel execution (worker threads) + + + + + The tree of tests that was loaded by the builder + + + + + The test result, if a run has completed + + + + + Indicates whether a test is loaded + + + + + Indicates whether a test is running + + + + + Indicates whether a test run is complete + + + + + Our settings, specified when loading the assembly + + + + + The top level WorkItem created for the assembly as a whole + + + + + The TestExecutionContext for the top level WorkItem + + + + + Loads the tests found in an Assembly + + File name or path of the assembly to load + Dictionary of option settings for loading the assembly + True if the load was successful + + + + Loads the tests found in an Assembly + + The assembly to load + Dictionary of option settings for loading the assembly + True if the load was successful + + + + Count Test Cases using a filter + + The filter to apply + The number of test cases found + + + + Explore the test cases using a filter + + The filter to apply + Test Assembly with test cases that matches the filter + + + + Run selected tests and return a test result. The test is run synchronously, + and the listener interface is notified as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + + + + Run selected tests asynchronously, notifying the listener interface as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + RunAsync is a template method, calling various abstract and + virtual methods to be overridden by derived classes. + + + + + Wait for the ongoing run to complete. + + Time to wait in milliseconds + True if the run completed, otherwise false + + + + Signal any test run that is in process to stop. Return without error if no test is running. + + If true, kill any tests that are currently running + + + + Initiate the test run. + + + + + Create the initial TestExecutionContext used to run tests + + The ITestListener specified in the RunAsync call + + + + Handle the Completed event for the top level work item + + + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + + + Verifies that the first int is greater than the second + int. 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 int is greater than the second + int. 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Verifies that the first value is greater than or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Asserts that an int is zero. + + The number to be examined + + + + Asserts that an int is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is zero. + + The number to be examined + + + + Asserts that an unsigned int is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is zero. + + The number to be examined + + + + Asserts that a Long is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is zero. + + The number to be examined + + + + Asserts that an unsigned Long is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is zero. + + The number to be examined + + + + Asserts that a decimal is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is zero. + + The number to be examined + + + + Asserts that a double is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is zero. + + The number to be examined + + + + Asserts that a float is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is not zero. + + The number to be examined + + + + Asserts that an int is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is not zero. + + The number to be examined + + + + Asserts that an unsigned int is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is not zero. + + The number to be examined + + + + Asserts that a Long is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is not zero. + + The number to be examined + + + + Asserts that an unsigned Long is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is zero. + + The number to be examined + + + + Asserts that a decimal is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is zero. + + The number to be examined + + + + Asserts that a double is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is zero. + + The number to be examined + + + + Asserts that a float is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is positive. + + The number to be examined + + + + Asserts that an int is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is positive. + + The number to be examined + + + + Asserts that an unsigned int is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is positive. + + The number to be examined + + + + Asserts that a Long is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is positive. + + The number to be examined + + + + Asserts that an unsigned Long is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is positive. + + The number to be examined + + + + Asserts that a decimal is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is positive. + + The number to be examined + + + + Asserts that a double is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is positive. + + The number to be examined + + + + Asserts that a float is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is negative. + + The number to be examined + + + + Asserts that an int is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is negative. + + The number to be examined + + + + Asserts that an unsigned int is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is negative. + + The number to be examined + + + + Asserts that a Long is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is negative. + + The number to be examined + + + + Asserts that an unsigned Long is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is negative. + + The number to be examined + + + + Asserts that a decimal is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is negative. + + The number to be examined + + + + Asserts that a double is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is negative. + + The number to be examined + + + + Asserts that a float is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + DO NOT USE! Use Assert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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. + + + + + Issues a warning using the message and arguments provided. + + The message to display. + Arguments to be used in formatting the message + + + + Issues a warning using the message provided. + + The message to display. + + + + 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. + + + + + Asserts that an object is contained in a collection. + + The expected object + The collection 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 collection. + + The expected object + The collection to be examined + + + + Wraps code containing a series of assertions, which should all + be executed, even if they fail. Failed results are saved and + reported at the end of the code block. + + A TestDelegate to be executed in Multiple Assertion mode. + + + + Wraps code containing a series of assertions, which should all + be executed, even if they fail. Failed results are saved and + reported at the end of the code block. + + A TestDelegate to be executed in Multiple Assertion mode. + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Verifies that an async 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 an async delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + + + + Verifies that an async delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that an async delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + + + + Verifies that an async delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that an async delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + + + + Verifies that an async 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 an async delegate throws an exception when called + and returns it. + + A TestDelegate + + + + Verifies that an async 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 an async 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 an async delegate throws an exception of a certain Type + or one derived from it 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 an async delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + A TestDelegate + + + + Verifies that an async delegate does not throw an exception + + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that an async delegate does not throw an exception. + + A TestDelegate + + + + 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 + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + 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 TestDelegate + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + 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 TestDelegate + + + + 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 + + + + 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 + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it 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 of a certain Type + or one derived from it when called and returns it. + + A TestDelegate + + + + Verifies that a delegate does not throw an exception + + A TestDelegate + 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 TestDelegate + + + + 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 + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + 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. + + The actual value to test + A Constraint expression to be applied + + + + 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. + + The actual value to test + A Constraint expression to be applied + The message that will be displayed on failure + Arguments 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 + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Delegate used by tests that execute code and + capture any thrown exception. + + + + + Delegate used by tests that execute async code and + capture any thrown exception. + + + + + AssertionHelper is an optional base class for user tests, + allowing the use of shorter names in making asserts. + + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to + . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to . + + The evaluated condition + + + + 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. + + 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 + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + 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 + + + + 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 + + + + Returns a ListMapper based on a collection. + + The original collection + + + + + 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 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 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 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 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 equality with zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new 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 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 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 regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression 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 a subpath of the 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. + + + + + 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. + + + + + DO NOT USE! + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + Not applicable + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + 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 + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + 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 InconclusiveException on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Marks a test as needing to be run in a particular threading apartment state. This will cause it + to run in a separate thread if necessary. + + + + + Construct an ApartmentAttribute + + The apartment state that this test must be run under. You must pass in a valid apartment state. + + + + Provides the author of a test or test fixture. + + + + + Initializes a new instance of the class. + + The name of the author. + + + + Initializes a new instance of the class. + + The name of the author. + The email address of the author. + + + + Applies 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 + + + + + Modifies a test by adding a category to it. + + The test to modify + + + + Marks a test to use a combinatorial join of any argument data provided. + Since this is the default, the attribute is optional. + + + + + Default constructor + + + + + Marks a test as using a particular CombiningStrategy to join any supplied parameter data. + Since this is the default, the attribute is optional. + + + + + Construct a CombiningStrategyAttribute incorporating an + ICombiningStrategy and an IParameterDataProvider. + + Combining strategy to be used in combining data + An IParameterDataProvider to supply data + + + + Construct a CombiningStrategyAttribute incorporating an object + that implements ICombiningStrategy and an IParameterDataProvider. + This constructor is provided for CLS compliance. + + Combining strategy to be used in combining data + An IParameterDataProvider to supply data + + + + Builds any number of tests from the specified method and context. + + The MethodInfo for which tests are to be constructed. + The suite to which the tests will be added. + + + + Modify the test by adding the name of the combining strategy + to the properties. + + The test to modify + + + + Marks an assembly, test fixture or test method as applying to a specific Culture. + + + + + Constructor with no cultures specified, for use + with named property syntax. + + + + + Constructor taking one or more cultures + + Comma-delimited list of cultures + + + + Causes a test to be skipped if this CultureAttribute is not satisfied. + + The test to modify + + + + Tests to determine if the current culture is supported + based on the properties of this attribute. + + True, if the current culture is supported + + + + Test to determine if the a particular culture or comma- + delimited set of cultures is in use. + + Name of the culture or comma-separated list of culture ids + True if the culture is in use on the system + + + + Test to determine if one of a collection of cultures + is being used currently. + + + + + + + Abstract base class for all data-providing attributes defined by NUnit. + Used to select all data sources for a method, class or parameter. + + + + + Default constructor + + + + + Marks a field for use as a datapoint when executing a theory within + the same fixture that requires an argument of the field's Type. + + + + + Marks a field, property or method as providing a set of datapoints for use + in executing any theories within the same fixture that require an argument of + the provided Type. The data source may provide an array of the required Type + or an . Synonymous with . + + + + + Marks a field, property or method as providing a set of datapoints for use + in executing any theories within the same fixture that require an argument + of the provided type. The data source may provide an array of the required + Type or an . Synonymous with . + + + + + Sets the tolerance used by default when checking the equality of floating point values + within the test assembly, fixture or method. + + + + + Construct specifying an amount + + + + + + Apply changes to the TestExecutionContext + + The TestExecutionContext + + + + Provides the descriptive text relating to the assembly, test fixture or test method. + + + + + Construct a description Attribute + + The text of the description + + + + Marks an assembly, test fixture or test method such that it will only run if explicitly + executed from the GUI, command line or included within a test 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 + + + + Modifies a test by marking it as explicit. + + The test to modify + + + + Marks an assembly, test fixture or test method as being ignored. Ignored tests result in a warning message when the tests are run. + + + + + Constructs the attribute giving a reason for ignoring the test + + The reason for ignoring the test + + + + The date in the future to stop ignoring the test as a string in UTC time. + For example for a date and time, "2014-12-25 08:10:00Z" or for just a date, + "2014-12-25". If just a date is given, the Ignore will expire at midnight UTC. + + + Once the ignore until date has passed, the test will be marked + as runnable. Tests with an ignore until date will have an IgnoreUntilDate + property set which will appear in the test results. + + The string does not contain a valid string representation of a date and time. + + + + Modifies a test by marking it as Ignored. + + The test to modify + + + + 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 items 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 + + + + + Sets the number of worker threads that may be allocated by the framework + for running tests. + + + + + Construct a LevelOfParallelismAttribute. + + The number of worker threads to be created by the framework. + + + + Specifies the maximum time (in milliseconds) for a test case to succeed. + + + + + Construct a MaxTimeAttribute, given a time in milliseconds. + + The maximum elapsed time in milliseconds + + + + Marks tests that should NOT be run in parallel. + + + + + Construct a NonParallelizableAttribute. + + + + + Used by third-party frameworks, or other software, that reference + the NUnit framework but do not contain any tests. Applying the + attribute indicates that the assembly is not a test assembly and + may prevent errors if certain runners attempt to load the assembly. + Note that recognition of the attribute depends on each individual runner. + + + + + Abstract base class for all custom attributes defined by NUnit. + + + + + Default constructor + + + + + Identifies a method that is called once to perform setup before any child tests are run. + + + + + Identifies a method to be called once after all the child tests have run. + The method is guaranteed to be called, even if an exception is thrown. + + + + + Defines the order that the test will run in + + + + + Defines the order that the test will run in + + + + + Defines the order that the test will run in + + + + + + Modifies a test as defined for the specific attribute. + + The test to modify + + + + Marks a test as using a pairwise join of any supplied argument data. Arguments will be + combined in such a way that all possible pairs of arguments are used. + + + + + Default constructor + + + + + Marks a test assembly, fixture or method that may be run in parallel. + + + + + Construct a ParallelizableAttribute using default ParallelScope.Self. + + + + + Construct a ParallelizableAttribute with a specified scope. + + The ParallelScope associated with this attribute. + + + + Defines the degree to which this test and its descendants may be run in parallel + + + + + Overridden to check for invalid combinations of settings + + + + + + Modify the context to be used for child tests + + The current TestExecutionContext + + + + Specifies the degree to which a test, and its descendants, + may be run in parallel. + + + + + No ParallelScope was specified on the test + + + + + The test may be run in parallel with others at the same level. + Valid on classes and methods but not assemblies. + + + + + Test may not be run in parallel with any others. Valid on + classes and methods but not assemblies. + + + + + Mask used to extract the flags that apply to the item on which a + ParallelizableAttribute has been placed, as opposed to descendants. + + + + + Descendants of the test may be run in parallel with one another. + Valid on assemblies and classes but not on methods. + + + + + Descendants of the test down to the level of TestFixtures may be + run in parallel with one another. Valid on assemblies and classes + but not on methods. + + + + + Mask used to extract all the flags that impact descendants of a + test and place them in the TestExecutionContext. + + + + + The test and its descendants may be run in parallel with others at + the same level. Valid on classes and methods but not assemblies. + + + + + Marks an assembly, test fixture or test method as applying to a specific platform. + + + + + Constructor with no platforms specified, for use + with named property syntax. + + + + + Constructor taking one or more platforms + + Comma-delimited list of platforms + + + + Causes a test to be skipped if this PlatformAttribute is not satisfied. + + The test to modify + + + + Attaches information to a test assembly, fixture or method 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 + + + + + Modifies a test by adding properties to it. + + The test to modify + + + + Supplies a set of random values to a single parameter of a parameterized test. + + + + + If true, no value will be repeated. + + + + + Construct a random set of values appropriate for the Type of the + parameter on which the attribute appears, specifying only the count. + + + + + + Construct a set of ints within a specified range + + + + + Construct a set of unsigned ints within a specified range + + + + + Construct a set of longs within a specified range + + + + + Construct a set of unsigned longs within a specified range + + + + + Construct a set of shorts within a specified range + + + + + Construct a set of unsigned shorts within a specified range + + + + + Construct a set of doubles within a specified range + + + + + Construct a set of floats within a specified range + + + + + Construct a set of bytes within a specified range + + + + + Construct a set of sbytes within a specified range + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + Supplies 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 unsigned ints using default step of 1 + + + + + Construct a range of unsigned ints specifying the step size + + + + + Construct a range of longs using a default step of 1 + + + + + Construct a range of longs + + + + + Construct a range of unsigned longs using default step of 1 + + + + + Construct a range of unsigned longs specifying the step size + + + + + Construct a range of doubles + + + + + Construct a range of floats + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + Returns a string that represents the current object. + + + + Specifies that a test should be run multiple times. + + + + + Construct a RepeatAttribute + + The number of times to run the test + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + The test command for the RepeatAttribute + + + + + Initializes a new instance of the class. + + The inner command. + The number of repetitions + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Marks a test that must run on a separate thread. + + + + + Construct a RequiresThreadAttribute + + + + + Construct a RequiresThreadAttribute, specifying the apartment + + + + + Specifies that a test method should be rerun on failure up to the specified + maximum number of times. + + + + + Construct a + + The maximum number of times the test should be run if it fails + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + The test command for the + + + + + Initializes a new instance of the class. + + The inner command. + The maximum number of repetitions + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Marks a test to use a sequential join of any provided argument data. + Arguments will be combined into test cases, taking the next value of + each argument until all are used. + + + + + Default constructor + + + + + Sets the current Culture on an assembly, test fixture or test method for + the duration of a test. The culture remains set until the test or fixture + completes and is then reset to its original value. + + + + + + Construct given the name of a culture + + + + + + Sets the current UI Culture on an assembly, test fixture or test method + for the duration of a test. The UI culture remains set until the test or + fixture completes and is then reset to its original value. + + + + + + Construct given the name of a culture + + + + + + Identifies a method to be called immediately before each test is run. + + + + + Identifies a class as containing or + methods for all the test fixtures + under a given namespace. + + + + + Builds a from the specified type. + + The type info of the fixture to be used. + + + + Marks a test fixture as requiring all child tests to be run on the + same thread as the OneTimeSetUp and OneTimeTearDown. A flag in the + is set forcing all child tests + to be run sequentially on the current thread. + Any setting is ignored. + + + + + Apply changes to the TestExecutionContext + + The TestExecutionContext + + + + Identifies a method to be called immediately after each test is run. + The method is guaranteed to be called, even if an exception is thrown. + + + + + Abstract attribute providing actions to execute before and after tests. + + + + + Executed before each test is run + + The test that is going to be run. + + + + Executed after each test is run + + The test that has just been run. + + + + Provides the target for the action attribute + + + + + Marks a test assembly as needing a special assembly resolution hook that will + explicitly search the test assembly's directory for dependent assemblies. + This works around a conflict between mixed-mode assembly initialization and + tests running in their own AppDomain in some cases. + + + + + Marks the method as callable from the NUnit test runner. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + public void TestDescriptionMethod() + {} + } + + + + + + Descriptive text for this test + + + + + The author of this test + + + + + The type that this test is testing + + + + + Gets or sets the expected result. Not valid if the test + method has parameters. + + The result. + + + + Modifies a test by adding a description, if not already set. + + The test to modify + + + + Builds a single test from the specified method and context. + + The method for which a test is to be constructed. + The suite to which the test will be added. + + + + Marks a method as a parameterized test suite and provides arguments for each test case. + + + + + 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 or sets the name of the test. + + The name of the test. + + + + Gets or sets the RunState of this test case. + + + + + Gets the list of arguments to a test case + + + + + Gets the properties of the test case + + + + + Gets or sets the expected result. + + The result. + + + + Returns true if the expected result has been set + + + + + Gets or sets the description. + + The description. + + + + The author of this test + + + + + The type that this test is testing + + + + + Gets or sets the reason for ignoring the test + + + + + Gets or sets a value indicating whether this is explicit. + + + true if explicit; otherwise, false. + + + + + Gets or sets the reason for not running the test. + + The reason. + + + + Gets or sets the ignore reason. When set to a non-null + non-empty value, the test is marked as ignored. + + The ignore reason. + + + + Comma-delimited list of platforms to run the test for + + + + + Comma-delimited list of platforms to not run the test for + + + + + Gets and sets the category for this test case. + May be a comma-separated list of categories. + + + + + Performs several special conversions allowed by NUnit in order to + permit arguments with types that cannot be used in the constructor + of an Attribute such as TestCaseAttribute or to simplify their use. + + The arguments to be converted + The ParameterInfo array for the method + + + + Performs several special conversions allowed by NUnit in order to + permit arguments with types that cannot be used in the constructor + of an Attribute such as TestCaseAttribute or to simplify their use. + + The argument to be converted + The target in which the should be converted + If conversion was successfully applied, the converted into + + true if was converted and should be used; + false is no conversion was applied and should be ignored + + + + + Builds a single test from the specified method and context. + + The MethodInfo for which tests are to be constructed. + The suite to which the tests will be added. + + + + Indicates the source to be used to provide test fixture instances for a test class. + + + + + Construct with the name of the method, property or field that will provide data + + The name of a static method, property or field that will provide data. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + + + + Construct with a name + + The name of a static method, property or field that will provide data. + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + Construct with a Type + + The type that will provide data + + + + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + + 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 every fixture created from + this attribute. May be a single category or a comma-separated list. + + + + + Builds any number of tests from the specified method and context. + + The IMethod for which tests are to be constructed. + The suite to which the tests will be added. + + + + Marks the class as a TestFixture. + + + + + 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. + + + + + + Gets or sets the name of the test. + + The name of the test. + + + + Gets or sets the RunState of this test fixture. + + + + + The arguments originally provided to the attribute + + + + + Properties pertaining to this fixture + + + + + Get or set the type arguments. If not set + explicitly, any leading arguments that are + Types are taken as type arguments. + + + + + Descriptive text for this fixture + + + + + The author of this fixture + + + + + The type that this fixture is testing + + + + + Gets or sets the ignore reason. May set RunState as a side effect. + + The ignore reason. + + + + Gets or sets the reason for not running the fixture. + + The reason. + + + + Gets or sets the ignore reason. When set to a non-null + non-empty value, the test is marked as ignored. + + The ignore reason. + + + + Gets or sets a value indicating whether this is explicit. + + + true if explicit; otherwise, false. + + + + + Gets and sets the category for this fixture. + May be a comma-separated list of categories. + + + + + Builds a single test fixture from the specified type. + + + + + Builds a single test fixture from the specified type. + + The type info of the fixture to be used. + Filter used to select methods as tests. + + + + Identifies the source used to provide test fixture instances for a test class. + + + + + Error message string is public so the tests can use it + + + + + Construct with the name of the method, property or field that will provide data + + The name of a static method, property or field that will provide data. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + + + + Construct with a Type + + The type 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 every fixture created from + this attribute. May be a single category or a comma-separated list. + + + + + Builds any number of test fixtures from the specified type. + + The TypeInfo for which fixtures are to be constructed. + + + + Builds any number of test fixtures from the specified type. + + The TypeInfo for which fixtures are to be constructed. + PreFilter used to select methods as tests. + + + + Returns a set of ITestFixtureData items for use as arguments + to a parameterized test fixture. + + The type for which data is needed. + + + + + Indicates the method or class the assembly, test fixture or test method is testing. + + + + + Initializes a new instance of the class. + + The type that is being tested. + + + + Initializes a new instance of the class. + + The type that is being tested. + + + + 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")] + public void TestDescriptionMethod() + {} + } + + + + + + Construct the attribute, specifying a combining strategy and source of parameter data. + + + + + Applies a timeout in milliseconds to a test. + When applied to a method, the test is cancelled if the timeout is exceeded. + When applied to a class or assembly, the default timeout is set for all contained test methods. + + + + + Construct a TimeoutAttribute given a time in milliseconds + + The timeout value in milliseconds + + + + Provides literal arguments for an individual parameter of a test. + + + + + 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 + + + + + Constructs for use with an Enum parameter. Will pass every enum + value in to the test. + + + + + Construct with one argument + + + + + + Construct with two arguments + + + + + + + Construct with three arguments + + + + + + + + Construct with an array of arguments + + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + To generate data for Values attribute, in case no data is provided. + + + + + To Check if type is nullable enum. + + + + + Indicates the source 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 a static method, property or field 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 a static 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 + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + A set of Assert methods operating on one or more collections + + + + + DO NOT USE! Use CollectionAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + 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 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 + 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 + 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 + 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 + 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 + 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 + 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 + Arguments to be used in formatting the message + + + + Asserts that the superset does not contain the subset + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + + + + Asserts that the superset does not contain the subset + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the superset contains the subset. + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + + + + Asserts that the superset contains the subset. + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the subset does not contain the superset + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that the subset does not contain the superset + + 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 the subset contains the superset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that the subset contains the superset. + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + AllItemsConstraint applies another constraint to each + item in a collection, succeeding if they all succeed. + + + + + Construct an AllItemsConstraint on top of an existing 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. + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + AndConstraint succeeds only if both members succeed. + + + + + Create an AndConstraint from two other constraints + + The first constraint + The second constraint + + + + Gets text describing a 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 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 + + + + is used to determine whether the value is equal to any of the expected values. + + + + + Construct a + + Collection of expected values + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether item is present in expected collection + + Actual item type + Actual item + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IEqualityComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + AssignableFromConstraint is used to test that an object + can be assigned from a given Type. + + + + + Construct an AssignableFromConstraint for the type provided + + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + AssignableToConstraint is used to test that an object + can be assigned to a given Type. + + + + + Construct an AssignableToConstraint for the type provided + + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + 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. + + + + + Constructs an AttributeConstraint for a specified attribute + Type and base constraint. + + + + + + + Determines whether the Type or other provider has the + expected attribute and if its value matches the + additional constraint specified. + + + + + Returns a string representation of the constraint. + + + + + AttributeExistsConstraint tests for the presence of a + specified attribute on a Type. + + + + + Constructs an AttributeExistsConstraint for a specific attribute Type + + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Tests whether the object provides the expected attribute. + + A Type, MethodInfo, or other ICustomAttributeProvider + True if the expected attribute is present, otherwise false + + + + 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 + + + + BinarySerializableConstraint tests whether + an object is serializable in binary format. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Returns the string representation + + + + + 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 + + + + + + + CollectionContainsConstraint is used to test whether a collection + contains an expected object as a member. + + + + + Construct a CollectionContainsConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Test whether the expected item is contained in the collection + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + CollectionEquivalentConstraint is used to determine whether two + collections are equivalent. + + + + The result of the from the collections + under comparison. + + + Construct a CollectionEquivalentConstraint + Expected collection. + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether two collections are equivalent + + + + + + + Test whether the collection is equivalent to the expected. + + + Actual collection type. + + + Actual collection to compare. + + + A indicating whether or not + the two collections are equivalent. + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + Provides a for the . + + + Result of a of the collections to compare for equivalence. + + + Maximum amount of elements to write to the if there are + extra/missing elements from the collection. + + + Construct a using a . + Source . + Result of the collection comparison. + Actual collection to compare. + Whether or not the succeeded. + + + Write any additional lines (following Expected: and But was:) for a failing constraint. + The to write the failure message to. + + + + CollectionItemsEqualConstraint is the abstract base class for all + collection constraints that apply some notion of item equality + as a part of their operation. + + + + + The NUnitEqualityComparer in use for this constraint + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Get a flag indicating whether the user requested us to ignore case. + + + + + Get a flag indicating whether any external comparers are in use. + + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + Compares two collection members for equality + + + + + Return a new CollectionTally for use in making tests + + The collection to be included in the tally + + + + CollectionOrderedConstraint is used to test whether a collection is ordered. + + + + + Construct a CollectionOrderedConstraint + + + + + 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. + + + + + If used performs a default ascending comparison + + + + + If used performs a reverse comparison + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use a and returns self. + + + + + Modifies the constraint to test ordering by the value of + a specified property and returns self. + + + + + Then signals a break between two ordering steps + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Test whether the collection is ordered + + + + + Returns the string representation of the constraint. + + + + + + An OrderingStep represents one stage of the sort + + + + + Constructor for success result. + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + + + + Constructor for failure result. + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + Index at which collection order breaks. + Value at which collection order breaks. + + + + 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 + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the actual collection is a subset of + the expected collection provided. + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + CollectionSupersetConstraint is used to determine whether + one collection is a superset of another + + + + + Construct a CollectionSupersetConstraint + + The collection that the actual value is expected to be a superset of + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the actual collection is a superset of + the expected collection provided. + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + counts (tallies) the number of occurrences + of each object in one or more enumerations. + + + The result of a . + + + Items that were not in the expected collection. + + + Items that were not accounted for in the expected collection. + + + Initializes a new instance of the class with the given fields. + + + The result of the comparison between the two collections. + + + Construct a CollectionTally object from a comparer and a collection. + The comparer to use for equality. + The expected collection to compare against. + + + Try to remove an object from the tally. + The object to remove. + + + Try to remove a set of objects from the tally. + The objects to remove. + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two types related by . + + + + + Interface for comparing two s. + + + + + Method for comparing two objects with a tolerance. + + The first object to compare. + The second object to compare. + The tolerance to use when comparing the objects. + Flag indicating whether or not this is the top level comparison. + + null if the objects cannot be compared using the method. + Otherwise the result of the comparison is returned. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s or s. + + + + + Comparator for two Tuples. + + + + + Base class for comparators for tuples (both regular Tuples and ValueTuples). + + + + + Comparator for two ValueTuples. + + + + + ComparisonAdapter class centralizes all comparisons of + values in NUnit, adapting to the use of any provided + , + or . + + + + + Gets the default ComparisonAdapter, which wraps an + NUnitComparer object. + + + + + Returns a ComparisonAdapter that wraps an + + + + + Returns a ComparisonAdapter that wraps an + + + + + Returns a ComparisonAdapter that wraps a + + + + + Compares two objects + + + + + Construct a default ComparisonAdapter + + + + + Construct a ComparisonAdapter for an + + + + + Compares two objects + + + + + + + + ComparerAdapter extends and + allows use of an or + to actually perform the comparison. + + + + + Construct a ComparisonAdapter for an + + + + + Compare a Type T to an object + + + + + Construct a ComparisonAdapter for a + + + + + Compare a Type T to an object + + + + + Abstract base class for constraints that compare values to + determine if one is greater than, equal to or less than + the other. + + + + + The value against which a comparison is to be made + + + + + Tolerance used in making the comparison + + + + + ComparisonAdapter to be used in making the comparison + + + + + Initializes a new instance of the class. + + The value against which to make a comparison. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + A ConstraintResult + + + + Protected function overridden by derived class to actually perform the comparison + + + + + Modifies the constraint to use an and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Modifies the constraint to use an and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Modifies the constraint to use a and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Set the tolerance for use in this comparison + + + + + Switches the .Within() modifier to interpret its tolerance as + a percentage that the actual values is allowed to deviate from + the expected value. + + Self + + + + Delegate used to delay evaluation of the actual value + to be used in evaluating a constraint + + + + + The Constraint class is the base of all built-in constraints + within NUnit. It provides the operator overloads used to combine + constraints. + + + + + Construct a constraint with optional arguments + + Arguments to be saved + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Arguments provided to this Constraint, for use in + formatting the description. + + + + + The ConstraintBuilder holding this constraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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 + A ConstraintResult + + + + Retrieves the value to be tested from an ActualValueDelegate. + The default implementation simply evaluates the delegate but derived + classes may override it to provide for delayed processing. + + An ActualValueDelegate + Delegate evaluation result + + + + 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 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. + + + + + Returns a DelayedConstraint.WithRawDelayInterval with the specified delay time. + + The delay, which defaults to milliseconds. + + + + + Returns a DelayedConstraint with the specified delay time + and polling interval. + + The delay in milliseconds. + The interval at which to test the constraint. + + + + + Resolves any pending operators and returns the resolved 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 reorganized. a ConstraintStack holds + input constraints as well as the results of each + operator applied. + + + + + OperatorStack is a type-safe stack for holding ConstraintOperators + + + + + Initializes a new instance of the class. + + The ConstraintBuilder using this stack. + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost operator without modifying the stack. + + + + + Pushes the specified operator onto the stack. + + The operator to put onto the stack. + + + + Pops the topmost operator from the stack. + + The topmost operator on the stack + + + + ConstraintStack is a type-safe stack for holding Constraints + + + + + Initializes a new instance of the class. + + The ConstraintBuilder using this stack. + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Pushes the specified constraint. As a side effect, + the constraint's Builder field is set to the + ConstraintBuilder owning this stack. + + The constraint to put onto the stack + + + + Pops this topmost constraint from the stack. + As a side effect, the constraint's Builder + field is set to null. + + The topmost constraint on the stack + + + + 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 expression 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. + + + + + 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 + reorganized. When a constraint is appended, it is returned as the + value of the operation so that modifiers may be applied. However, + any partially built expression is attached to the constraint for + later resolution. When an operator is appended, the partial + expression is returned. If it's a self-resolving operator, then + a ResolvableConstraintExpression is returned. + + + + + 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. Note that the constraint + is not reduced at this time. For example, if there + is a NotOperator on the stack we don't reduce and + return a NotConstraint. The original constraint must + be returned because it may support modifiers that + are yet to be applied. + + + + + 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 ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a , which will + apply the following constraint to a collection of length one, succeeding + only if exactly one of them succeeds. + + + + + 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 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 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. + + + + + With is currently a NOP - reserved for future use. + + + + + 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 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 if item is equal to zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new 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 new 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 new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the Dictionary key collection. + + The key to be matched in the Dictionary key collection + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the Dictionary value collection. + + The value to be matched in the Dictionary value collection + + + + 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 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 ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression 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 a subpath of the 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 + inclusively within a specified range. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + Returns a constraint that succeeds if the value + is a file or directory and it exists. + + + + + Returns a constraint that tests if an item is equal to any of parameters + + Expected values + + + + ConstraintStatus represents the status of a ConstraintResult + returned by a Constraint being applied to an actual value. + + + + + The status has not yet been set + + + + + The constraint succeeded + + + + + The constraint failed + + + + + An error occurred in applying the constraint (reserved for future use) + + + + + Contains the result of matching a against an actual value. + + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + The status of the new ConstraintResult. + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + If true, applies a status of Success to the result, otherwise Failure. + + + + The actual value that was passed to the method. + + + + + Gets and sets the ResultStatus for this result. + + + + + True if actual value meets the Constraint criteria otherwise false. + + + + + Display friendly name of the constraint. + + + + + Description of the constraint may be affected by the state the constraint had + when was performed against the actual value. + + + + + Write the failure message to the MessageWriter provided + as an argument. The default implementation simply passes + the result 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 occurred, can override this. + + The MessageWriter on which to display the message + + + + Write some additional failure message. + + The MessageWriter on which to display the message + + + + 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 + + + + 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 value contained within the string/collection. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Flag the constraint to ignore case and return self. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Applies a delay to the match so that a match can be evaluated in the future. + + + + + Allows only changing the time dimension of delay interval and setting a polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithRawDelayInterval + + Parent DelayedConstraint on which delay interval dimension is required to be set + + + + Changes delay interval dimension to minutes + + + + + Changes delay interval dimension to seconds + + + + + Changes delay interval dimension to milliseconds + + + + + Set polling interval, in milliseconds + + A time interval, in milliseconds + + + + + Allows only setting the polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithDimensionedDelayInterval + + Parent DelayedConstraint on which polling interval is required to be set + + + + Set polling interval, in milliseconds + + A time interval, in milliseconds + + + + + Allows only changing the time dimension of the polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithRawPollingInterval + + Parent DelayedConstraint on which polling dimension is required to be set + + + + Changes polling interval dimension to minutes + + + + + Changes polling interval dimension to seconds + + + + + Changes polling interval dimension to milliseconds + + + + + Delay value store as an Interval object + + + + + Polling value stored as an Interval object + + + + + Creates a new DelayedConstraint + + The inner constraint to 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 to decorate + The time interval after which the match is performed, in milliseconds + The time interval used for polling, in milliseconds + If the value of is less than 0 + + + + Gets text describing a constraint + + + + + 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 + A ConstraintResult + + + + 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 + + + + Returns the string representation of the constraint. + + + + + Adjusts a Timestamp by a given TimeSpan + + + + + + + + Returns the difference between two Timestamps as a TimeSpan + + + + + + + + DictionaryContainsKeyConstraint is used to test whether a dictionary + contains an expected object as a key. + + + + + Construct a DictionaryContainsKeyConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Flag the constraint to ignore case and return self. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + + + + Test whether the expected key is contained in the dictionary + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + DictionaryContainsValueConstraint is used to test whether a dictionary + contains an expected object as a value. + + + + + Construct a DictionaryContainsValueConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Test whether the expected value is contained in the dictionary + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + Provides a for the constraints + that are applied to each item in the collection + + + + + Constructs a for a particular + Only used for Failure + + The Constraint to which this result applies + The actual value to which the Constraint was applied + Actual item that does not match expected condition + Non matching item index + + + + Write constraint description, actual items, and non-matching item + + The MessageWriter on which to display the message + + + + EmptyCollectionConstraint tests whether a collection is empty. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Check that the collection is empty + + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + EmptyDirectoryConstraint is used to test that a directory is empty + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + EmptyStringConstraint tests whether a string is empty. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + 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. + + + + + + + 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. + + + + + NUnitEqualityComparer used to test equality. + + + + + Initializes a new instance of the class. + + The expected value. + + + + Gets the tolerance for this comparison. + + + The tolerance. + + + + + Gets a value indicating whether to compare case insensitive. + + + true if comparing case insensitive; otherwise, false. + + + + + Gets a value indicating whether or not to clip strings. + + + true if set to clip strings otherwise, false. + + + + + Gets the failure points. + + + The failure points. + + + + + 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. + + + + + Flag the constraint to use a tolerance when determining equality. + + Tolerance value to be used + Self. + + + + Flags the constraint to include + property in comparison of two values. + + + Using this modifier does not allow to use the + constraint modifier. + + + + + 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 + + + + 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 boolean-returning delegate. + + The boolean-returning delegate 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 use the supplied predicate function + + The comparison function to use. + Self. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + The EqualConstraintResult class is tailored for formatting + and displaying the result of an EqualConstraint. + + + + + Construct an EqualConstraintResult + + + + + Write a failure message. Overridden to provide custom + failure messages for EqualConstraint. + + The MessageWriter to write to + + + + Display the failure information for two collections that did not match. + + The MessageWriter on which to display + The expected collection. + The actual collection + The depth of this failure in a set of nested collections + + + + Displays a single line showing the types and sizes of the expected + and actual collections or arrays. If both are identical, the value is + only shown once. + + The MessageWriter on which to display + The expected collection or array + The actual collection or array + The indentation level for the message line + + + + Displays a single line showing the point in the expected and actual + arrays at which the comparison failed. If the arrays have different + structures or dimensions, both values are shown. + + The MessageWriter on which to display + The expected array + The actual array + Index of the failure point in the underlying collections + The indentation level for the message line + + + + 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 + + + + EqualityAdapter class handles all equality comparisons + that use an , + or a . + + + + + 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 that wraps an . + + + + + that wraps an . + + + + + Returns an that wraps an . + + + + + Returns an EqualityAdapter that uses a predicate function for items comparison. + + + + + + + + + Returns true if the two objects can be compared by this adapter. + The base adapter cannot handle IEnumerables except for strings. + + + + + Compares two objects, returning true if they are equal + + + + + Returns true if the two objects can be compared by this adapter. + Generic adapter requires objects of the specified type. + + + + + Returns an that wraps an . + + + + + Returns an that wraps an . + + + + + that wraps an . + + + + + Returns an that wraps a . + + + + + ExactCountConstraint applies another constraint to each + item in a collection, succeeding only if a specified + number of items succeed. + + + + + Construct a standalone ExactCountConstraint + + + + + + 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. + + The value to be tested + A ConstraintResult + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Contain the result of matching a against an actual value. + + + + + The maximum count of list elements that are shown on the constraint result + + + + + The count of matched items of the + + + + + A list with maximum count (+1) of items of the + (The maximum count is set in ) + + + + + Constructs a for a . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + If true, applies a status of Success to the result, otherwise Failure. + Count of matched items of the + A list with maximum count (+1) of items of the + + + + Write the actual value for a failing constraint test to a MessageWriter. + + 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. + + + + 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. + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + ExceptionTypeConstraint is a special version of ExactTypeConstraint + used to provided detailed info about the exception thrown in + an error message. + + + + + Constructs an ExceptionTypeConstraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + FalseConstraint tests that the actual value is false + + + + + Initializes a new instance of the class. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + FileExistsConstraint is used to determine if a file exists + + + + + Initializes a new instance of the class. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + FileOrDirectoryExistsConstraint is used to determine if a file or directory exists + + + + + If true, the constraint will only check if files exist, not directories + + + + + If true, the constraint will only check if directories exist, not files + + + + + Initializes a new instance of the class that + will check files and directories. + + + + + Initializes a new instance of the class that + will only check files if ignoreDirectories is true. + + if set to true [ignore directories]. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + 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. + + + + + 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 + + + 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 between 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 between 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/ + + + + + + Tests whether a value is greater than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Tests whether a value is greater than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Interface for all constraints + + + + + The display name of this Constraint for use by ToString(). + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Arguments provided to this Constraint, for use in + formatting the description. + + + + + The ConstraintBuilder holding this constraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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 + A ConstraintResult + + + + 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 + + + + 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. + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + Keeps track of an interval time which can be represented in + Minutes, Seconds or Milliseconds + + + + + Constructs a interval given an value in milliseconds + + + + + Gets Interval value represented as a TimeSpan object + + + + + Returns the interval with the current value as a number of minutes. + + + + + Returns the interval with the current value as a number of seconds. + + + + + Returns the interval with the current value as a number of milliseconds. + + + + + Is true for intervals created with a non-zero value + + + + + Returns a string that represents the current object. + + + A string that represents the current object. + + + + + IntervalUnit provides the semantics to the value stored in Interval class. + + + + + Unit representing an Interval in minutes + + + + + Unit representing an Interval in seconds + + + + + Unit representing an Interval in milliseconds + + + + + The IResolveConstraint interface is implemented by all + complete and resolvable constraints and expressions. + + + + + Return the top-level constraint for this expression + + + + + + An extension of ResolvableConstraintExpression that adds a no-op Items property for readability. + + + + + Create a new instance of ItemsConstraintExpression + + + + + Create a new instance of ResolvableConstraintExpression, + passing in a pre-populated ConstraintBuilder. + + + + + + No-op property for readability. + + + + + Tests whether a value is less than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Tests whether a value is less than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + 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 + + + + + Abstract method to get the max line length + + + + + 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 given + 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 failing constraint result + + + + 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 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 + + + + Custom value formatter function + + The value + + + + + Custom value formatter factory function + + The next formatter function + ValueFormatter + If the given formatter is unable to handle a certain format, it must call the next formatter in the chain + + + + Static methods used in creating messages + + + + + Static string used when strings are clipped + + + + + Formatting strings used for expected and actual values + + + + + Current head of chain of value formatters. Public for testing. + + + + + Add a formatter to the chain of responsibility. + + + + + + Formats text to represent a generalized value. + + The value + The formatted text + + + + Formats 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 + + + + 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 + + + + Converts any null characters in a string + to their escaped representation. + + The string to be converted + The converted string + + + + Return the a string representation for a set of indices into an array + + Array of indices for which a string is needed + + + + Get an array of indices representing the point in a collection or + array corresponding to a single int index into the collection. + + The collection to which the indices apply + Index in the collection + Array of indices + + + + Clip a string to a given length, starting at a particular offset, returning the clipped + string with ellipses representing the removed parts + + The string to be clipped + The maximum permitted length of the result string + The point at which to start clipping + The clipped string + + + + Clip the expected and actual strings in a coordinated fashion, + so that they may be displayed together. + + + + + + + + + Shows the position two strings start to differ. Comparison + starts at the start index. + + The expected string + The actual string + The index in the strings at which comparison should start + Boolean indicating whether case should be ignored + -1 if no mismatch found, or the index where mismatch found + + + + NaNConstraint tests that the actual value is a double or float NaN + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test that the actual value is an NaN + + + + + + + NoItemConstraint applies another constraint to each + item in a collection, failing if any of them succeeds. + + + + + Construct a SomeItemsConstraint on top of an existing constraint + + + + + + 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. + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + 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 + + + + NullConstraint tests that the actual value is null + + + + + Initializes a new instance of the class. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + 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. + + + + + Returns the default NUnitComparer. + + + + + Compares two objects + + + + + + + + NUnitEqualityComparer encapsulates NUnit's handling of + equality tests between objects. + + + + + If true, all string comparisons will ignore case + + + + + If true, arrays will be treated as collections, allowing + those of different dimensions to be compared + + + + + Comparison objects used in comparisons for some constraints. + + + + + List of points at which a failure occurred. + + + + + List of comparers used to compare pairs of objects. + + + + + Initializes a new instance of the class. + + + + + 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 the list of external comparers to be used to + test for equality. They are applied to members of + collections, in place of NUnit's own logic. + + + + + Gets the list of failure points for the last Match performed. + The list consists of objects to be interpreted by the caller. + This generally means that the caller may only make use of + objects it has placed on the list at a particular depth. + + + + + Flags the comparer to include + property in comparison of two values. + + + Using this modifier does not allow to use the + modifier. + + + + + Compares two objects for equality within a tolerance. + + + + + 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 + + + + + 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. + + + + + Operator that requires both its arguments to succeed + + + + + Construct an AndOperator + + + + + Apply the operator to produce an AndConstraint + + + + + 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. + + + + + 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. + + + + + + Gets the left precedence of the operator + + + + + Gets the right precedence of the operator + + + + + Abstract method that produces a constraint by applying + the operator to its left and right constraint arguments. + + + + + Abstract base for operators that indicate how to + apply a constraint to items in a collection. + + + + + Constructs a CollectionOperator + + + + + 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. + + + + + The syntax element preceding this operator + + + + + The syntax element following 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. + + + + + 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. + + + + + + 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 + + + + 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. + + + + + + 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. + + + + + Negates the test of the constraint it wraps. + + + + + Constructs a new NotOperator + + + + + Returns a NotConstraint applied to its argument. + + + + + Operator that requires at least one of its arguments to succeed + + + + + Construct an OrOperator + + + + + Apply the operator to produce an OrConstraint + + + + + PrefixOperator takes a single constraint and modifies + its 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. + + + + + + + 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. + + + + + Gets the name of the property to which the operator applies + + + + + 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. + + + + + + Abstract base class for operators that are able to reduce to a + constraint whether or not another syntactic element follows. + + + + + 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. + + + + + 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. + + + + + Represents a constraint that simply wraps the + constraint provided as an argument, without any + further functionality, but which modifies the + order of evaluation because of its precedence. + + + + + Constructor for the WithOperator + + + + + Returns a constraint that wraps its argument + + + + + OrConstraint succeeds if either member succeeds + + + + + Create an OrConstraint from two other constraints + + The first constraint + The second constraint + + + + Gets text describing a 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 + + + + PathConstraint serves as the abstract base of constraints + that operate on paths and provides several helper methods. + + + + + Construct a PathConstraint for a give expected path + + The expected path + + + + Modifies the current instance to be case-sensitive + and returns it. + + + + + Returns the string representation of this constraint + + + + + Canonicalize the provided path + + + The path in standardized form + + + + Test whether one path in canonical form is a subpath of another path + + The first path - supposed to be the parent path + The second path - supposed to be the child path + + + + + Predicate constraint wraps a Predicate in a constraint, + returning success if the predicate is true. + + + + + Construct a PredicateConstraint from a predicate + + + + + Gets text describing a constraint + + + + + Determines whether the predicate succeeds when applied + to the actual value. + + + + + Abstract base class used for prefixes + + + + + The base constraint + + + + + Prefix used in forming the constraint description + + + + + Construct given a base constraint + + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Formats a prefix constraint's description. + + + + + 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 + + + + Returns the string representation of the constraint. + + + + + Contains the result of matching a against an actual value. + + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The base result with actual value to which the Constraint was applied. + + + + Write the additional failure message for a failing constraint to a + MessageWriter. + + The writer on which the actual value is displayed + + + + 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 value + of the property. The two constraints are now separate. + + + + + Initializes a new instance of the class. + + The name of the property. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the property exists for a given object + + The object to be tested + True for success, false for failure + + + + Returns the string representation of the constraint. + + + + + + RangeConstraint tests whether two values are within a + specified range. + + + + + Initializes a new instance of the class. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use a and returns self. + + + + + 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 + + + + 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. + + + + + Appends an And Operator to the expression + + + + + Appends an Or operator to the expression. + + + + + Resolve the current expression to a Constraint + + + + + ReusableConstraint wraps a constraint expression after + resolving it so that it can be reused consistently. + + + + + Construct a ReusableConstraint from a constraint expression + + The expression to be resolved and reused + + + + Converts a constraint to a ReusableConstraint + + The constraint to be converted + A ReusableConstraint + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Return the top-level constraint for this expression + + + + + + SameAsConstraint tests whether an object is identical to + the object passed to its constructor + + + + + Initializes a new instance of the class. + + The expected object. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Summary description for SamePathConstraint. + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + SamePathOrUnderConstraint tests that one path is under another + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + 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 + + + + + + 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. + + + + + Apply the item constraint to each item in the collection, + succeeding if any item succeeds. + + + + + + + Flag the constraint to use the supplied object. + + The type of the elements in the collection. + The type of the member. + The comparison function to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + 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. + + + + + + + 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 + + + + + Description of this constraint + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Constructs a StringConstraint without an expected value + + + + + Constructs a StringConstraint given an expected value + + The expected value + + + + Modify the constraint to ignore case in matching. + + + + + 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 a given string + + The string to be tested + True for success, false for failure + + + + SubPathConstraint tests that the actual path is under the expected path + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + SubstringConstraint can test whether a string contains + the expected substring. + + + + + Initializes a new instance of the class. + + The expected. + + + + Modify the constraint to ignore case in matching. + This will call Using(StringComparison.CurrentCultureIgnoreCase). + + Thrown when a comparison type different + than was already set. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Modify the constraint to the specified comparison. + + Thrown when a comparison type different + than was already set. + + + + 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. + + + + Get the actual exception thrown - used by Assert.Throws. + + + + + Gets text describing a constraint + + + + + 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 actual value for a failing constraint test to a + MessageWriter. This override only handles the special message + used when an exception is expected but none is thrown. + + The writer on which the actual value is displayed + + + + ThrowsExceptionConstraint tests that an exception has + been thrown, without any further tests. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Executes the code and returns success if an exception is thrown. + + A delegate representing the code to be tested + True if an exception is thrown, otherwise false + + + + Applies the constraint to 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. + + + + + ThrowsNothingConstraint tests that a delegate does not + throw an exception. + + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True if no exception is thrown, otherwise false + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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. + + + + + Returns a default Tolerance object, equivalent to an exact match. + + + + + Returns an empty Tolerance object, equivalent to an exact match. + + + + + Constructs a linear tolerance of a specified amount + + + + + Constructs a tolerance given an amount and + + + + + 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 as the amount, using + the current amount as a number of days. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of hours. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of minutes. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of seconds. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of milliseconds. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of clock ticks. + + + + + Gets the for the current Tolerance + + + + + Gets the magnitude of the current Tolerance instance. + + + + + Returns true if the current tolerance has not been set or is using the . + + + + + Apply the tolerance to an expected value and return + a Tolerance.Range that represents the acceptable values. + + + + + Tests that the current Tolerance is linear with a + numeric value, throwing an exception if it is not. + + + + + Tolerance.Range represents the range of values that match + a specific tolerance, when applied to a specific value. + + + + + The lower bound of the range + + + + + The upper bound of the range + + + + + Constructs a range + + + + + 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. + + + + + TrueConstraint tests that the actual value is true + + + + + Initializes a new instance of the class. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + TypeConstraint is the abstract base for constraints + that take a Type as their expected value. + + + + + The expected Type used by the constraint + + + + + The type of the actual argument to which the constraint was applied + + + + + Construct a TypeConstraint for a given Type + + The expected type for the constraint + Prefix used in forming the constraint description + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + UniqueItemsConstraint tests whether all the items in a + collection are unique. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Check that all items are unique. + + + + + + + XmlSerializableConstraint tests whether + an object is serializable in XML format. + + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Returns the string representation of this constraint + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the dictionary. + + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the dictionary. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Asserts on Directories + + + + + DO NOT USE! Use DirectoryAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both point to the same directory. + 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 the 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 point to the same directory. + If they are not 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 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 + + + + Asserts that the directory exists. If it does not exist + an is thrown. + + 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 the directory exists. If it does not exist + an is thrown. + + A directory containing the actual value + + + + Asserts that the directory exists. If it does not exist + an is thrown. + + The path to 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 the directory exists. If it does not exist + an is thrown. + + The path to a directory containing the actual value + + + + Asserts that the directory does not exist. If it does exist + an is thrown. + + 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 the directory does not exist. If it does exist + an is thrown. + + A directory containing the actual value + + + + Asserts that the directory does not exist. If it does exist + an is thrown. + + The path to 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 the directory does not exist. If it does exist + an is thrown. + + The path to a directory containing the actual value + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a constraint that succeeds if the value + is a file or directory and it exists. + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new . 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 new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the Dictionary key collection. + + The key to be matched in the Dictionary key collection + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the Dictionary value collection. + + The value to be matched in the Dictionary value collection + + + + 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 regular expression supplied as an argument. + + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the ResultState provided by this exception + + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + Default Constructor + + + + + Construct based on the TestResult so far. This is the constructor + used normally, when exiting the multiple assert block with failures. + Not used internally but provided to facilitate debugging. + + + The current result, up to this point. The result is not used + internally by NUnit but is provided to facilitate debugging. + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the provided by this exception. + + + + + Gets the of this test at the point the exception was thrown, + + + + + Abstract base for Exceptions that terminate a test and provide a ResultState. + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the ResultState provided by this exception + + + + + Contains extension methods that do not require a special using directive. + + + + + Asserts on Files + + + + + DO NOT USE! Use FileAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Asserts that the file exists. If it does not exist + an is thrown. + + 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 the file exists. If it does not exist + an is thrown. + + A file containing the actual value + + + + Asserts that the file exists. If it does not exist + an is thrown. + + 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 the file exists. If it does not exist + an is thrown. + + The path to a file containing the actual value + + + + Asserts that the file does not exist. If it does exist + an is thrown. + + 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 the file does not exist. If it does exist + an is thrown. + + A file containing the actual value + + + + Asserts that the file does not exist. If it does exist + an is thrown. + + 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 the file does not exist. If it does exist + an is thrown. + + The path to a file containing the actual value + + + + Class used to guard against unexpected argument values + or operations by throwing an appropriate exception. + + + + + Throws an exception if an argument is null + + The value to be tested + The name of the argument + + + + Throws an exception if a string argument is null or empty + + The value to be tested + The name of the argument + + + + Throws an ArgumentOutOfRangeException if the specified condition is not met. + + The condition that must be met + The exception message to be used + The name of the argument + + + + Throws an ArgumentException if the specified condition is not met. + + The condition that must be met + The exception message to be used + The name of the argument + + + + Throws an InvalidOperationException if the specified condition is not met. + + The condition that must be met + The exception message to be used + + + + Throws an if the specified delegate is async void. + + + + + Throws an if the specified delegate is async void. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + 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 ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a which will apply + the following constraint to only one member of the collection, + and fail if none or more than one match occurs. + + + + + 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 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 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 checking for the + presence of a particular object in the collection. + + + + + The AssertionResult class represents the result of a single assertion. + + + + + Construct an AssertionResult + + + + The pass/fail status of the assertion + + + The message produced by the assertion, or null + + + The stack trace associated with the assertion, or null + + + + ToString Override + + + + + Override GetHashCode + + + + + Override Equals + + + + + + AssertionStatus enumeration represents the possible outcomes of an assertion. + The order of definition is significant, higher level values override lower + ones in determining the overall result of a test. + + + + + An assumption failed + + + + + The assertion succeeded + + + + + A warning message was issued + + + + + The assertion failed + + + + + An unexpected exception was thrown + + + + + The IApplyToContext interface is implemented by attributes + that want to make changes to the execution context before + a test is run. + + + + + Apply changes to the execution context + + The execution context + + + + The IApplyToTest interface is implemented by self-applying + attributes that modify the state of a test in some way. + + + + + Modifies a test as defined for the specific attribute. + + The test to modify + + + + CombiningStrategy is the abstract base for classes that + know how to combine values provided for individual test + parameters to create a set of test cases. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + ICommandWrapper is implemented by attributes and other + objects able to wrap a TestCommand with another command. + + + Attributes or other objects should implement one of the + derived interfaces, rather than this one, since they + indicate in which part of the command chain the wrapper + should be applied. + + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + Objects implementing this interface are used to wrap + the TestMethodCommand itself. They apply after SetUp + has been run and before TearDown. + + + + + Objects implementing this interface are used to wrap + the entire test, including SetUp and TearDown. + + + + + Objects implementing this interface are used to wrap + tests that can repeat. The implementing command is run once, + invoking the chained commands any number of times. + + + + + Any ITest that implements this interface is at a level that the implementing + class should be disposed at the end of the test run + + + + + The IFixtureBuilder interface is exposed by a class that knows how to + build test fixtures from a specified type. In general, it is exposed + by an attribute, but it may be implemented in a helper class used by the + attribute in some cases. + + + + + Builds any number of test fixtures from the specified type. + + The type info of the fixture to be used. + + + + The IFixtureBuilder2 interface extends IFixtureBuilder by allowing + use of a PreFilter, which is used to select methods as test cases. + + + + + Builds any number of test fixtures from the specified type. + + The type info of the fixture to be used. + PreFilter to be used to select methods. + + + + IImplyFixture is an empty marker interface used by attributes like + TestAttribute that cause the class where they are used to be treated + as a TestFixture even without a TestFixtureAttribute. + + Marker interfaces are not usually considered a good practice, but + we use it here to avoid cluttering the attribute hierarchy with + classes that don't contain any extra implementation. + + + + + The IMethodInfo class is used to encapsulate information + about a method in a platform-independent manner. + + + + + Gets the Type from which this method was reflected. + + + + + Gets the MethodInfo for this method. + + + + + Gets the name of the method. + + + + + Gets a value indicating whether the method is abstract. + + + + + Gets a value indicating whether the method is public. + + + + + Gets a value indicating whether the method contains unassigned generic type parameters. + + + + + Gets a value indicating whether the method is a generic method. + + + + + Gets a value indicating whether the MethodInfo represents the definition of a generic method. + + + + + Gets the return Type of the method. + + + + + Gets the parameters of the method. + + + + + + Returns the Type arguments of a generic method or the Type parameters of a generic method definition. + + + + + Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo. + + The type arguments to be used + A new IMethodInfo with the type arguments replaced + + + + Invokes the method, converting any TargetInvocationException to an NUnitException. + + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + Provides data for a single test parameter. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test. + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + Provides data for a single test parameter. + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + The IParameterInfo interface is an abstraction of a .NET parameter. + + + + + Gets a value indicating whether the parameter is optional + + + + + Gets an IMethodInfo representing the method for which this is a parameter + + + + + Gets the underlying .NET ParameterInfo + + + + + Gets the Type of the parameter + + + + + Implemented by filters for use in deciding which + Types and Methods should be used to generate tests. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + A PropertyBag represents a collection of name/value pairs + that allows duplicate entries with the same key. Methods + are provided for adding a new pair as well as for setting + a key to a single value. All keys are strings but values + may be of any type. Null values are not permitted, since + a null entry represents the absence of the key. + + The entries in a PropertyBag are of two kinds: those that + take a single value and those that take multiple values. + However, the PropertyBag has no knowledge of which entries + fall into each category and the distinction is entirely + up to the code using the PropertyBag. + + When working with multi-valued properties, client code + should use the Add method to add name/value pairs and + indexing to retrieve a list of all values for a given + key. For example: + + bag.Add("Tag", "one"); + bag.Add("Tag", "two"); + Assert.That(bag["Tag"], + Is.EqualTo(new string[] { "one", "two" })); + + When working with single-valued properties, client code + should use the Set method to set the value and Get to + retrieve the value. The GetSetting methods may also be + used to retrieve the value in a type-safe manner while + also providing default. For example: + + bag.Set("Priority", "low"); + bag.Set("Priority", "high"); // replaces value + Assert.That(bag.Get("Priority"), + Is.EqualTo("high")); + Assert.That(bag.GetSetting("Priority", "low"), + Is.EqualTo("high")); + + + + + Adds a key/value pair to the property bag + + The key + The value + + + + Sets the value for a key, removing any other + values that are already in the property set. + + + + + + + Gets a single value for a key, using the first + one if multiple values are present and returning + null if the value is not found. + + + + + Gets a flag indicating whether the specified key has + any entries in the property set. + + The key to be checked + True if their are values present, otherwise false + + + + Gets or sets the list of values for a particular key + + The key for which the values are to be retrieved or set + + + + Gets a collection containing all the keys in the property set + + + + + The IReflectionInfo interface is implemented by NUnit wrapper objects that perform reflection. + + + + + Returns an array of custom attributes of the specified type applied to this object + + + + + Returns a value indicating whether an attribute of the specified type is defined on this object. + + + + + The ISimpleTestBuilder interface is exposed by a class that knows how to + build a single tests from a specified method. In general, + it is exposed by an attribute, but it may be implemented in a helper class + used by the attribute in some cases. + + + + + Builds a single test from the specified method and context. + + The method to be used as a test + The TestSuite to which the method will be added + + + + The ISuiteBuilder interface is exposed by a class that knows how to + build a single test suite from a specified type. + + + + + Examine the type and determine if it is suitable for + this builder to use in building a TestSuite. + + Note that returning false will cause the type to be ignored + in loading the tests. If it is desired to load the suite + but label it as non-runnable, ignored, etc., then this + method must return true. + + The type of the fixture to be used + + + + Builds a single test suite from the specified type. + + The type of the fixture to be used + + + + Builds a single test suite from the specified type, subject + to a filter that decides which methods are included. + + The type of the fixture to be used + A PreFilter for selecting methods. + + + + Common interface supported by all representations + of a test. Only includes informational fields. + The Run method is specifically excluded to allow + for data-only representations of a test. + + + + + Gets the id of the test + + + + + Gets the name of the test + + + + + Gets the type of the test + + + + + Gets the fully qualified name of the test + + + + + Gets the name of the class containing this test. Returns + null if the test is not associated with a class. + + + + + Gets the name of the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + Gets the Type of the test fixture, if applicable, or + null if no fixture type is associated with this test. + + + + + Gets the method which declares the test, or + if no method is associated with this test. + + + + + Gets the RunState of the test, indicating whether it can be run. + + + + + Count of the test cases ( 1 if this is a test case ) + + + + + Gets the properties of the test + + + + + Gets the parent test, if any. + + The parent test or null if none exists. + + + + Returns true if this is a test suite + + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets this test's child tests + + A list of child tests + + + + Gets a fixture object for running this test. + + + + + The arguments to use in creating the test or empty array if none are required. + + + + + The ITestBuilder interface is exposed by a class that knows how to + build tests from a specified method. In general, it is exposed + by an attribute which has additional information available to provide + the necessary test parameters to distinguish the test cases built. + + + + + Builds any number of tests from the specified method and context. + + The method to be used as a test + The TestSuite to which the method will be added + + + + The ITestCaseBuilder interface is exposed by a class that knows how to + build a test from a specified method, possibly containing child test cases. + + + + + Examine the method and determine if it is suitable for + this builder to use in building a TestCase to be + included in the suite being populated. + + Note that returning false will cause the method to be ignored + in loading the tests. If it is desired to load the method + but label it as non-runnable, ignored, etc., then this + method must return true. + + The test method to examine + The suite being populated + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method to be used as a test case + The test suite being populated, or null + + + + The ITestCaseData interface is implemented by a class + that is able to return complete test cases for use by + a parameterized test method. + + + + + Gets the expected result of the test case + + + + + Returns true if an expected result has been set + + + + + The ITestData interface is implemented by a class that + represents a single instance of a parameterized test. + + + + + Gets the name to be used for the test + + + + + Gets the RunState for this test case. + + + + + Gets the argument list to be provided to the test + + + + + Gets the property dictionary for the test case + + + + + Interface to be implemented by filters applied to tests. + The filter applies when running the test, after it has been + loaded, since this is the only time an ITest exists. + + + + + Determine if a particular test passes the filter criteria. Pass + may examine the parents and/or descendants of a test, depending + on the semantics of the particular filter + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + The ITestCaseData interface is implemented by a class + that is able to return the data required to create an + instance of a parameterized test fixture. + + + + + Get the TypeArgs if separately set + + + + + The ITestListener interface is used internally to receive + notifications of significant events while a test is being + run. The events are propagated to clients by means of an + AsyncCallback. NUnit extensions may also monitor these events. + + + + + Called when a test has just started + + The test that is starting + + + + Called when a test has finished + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + The ITestResult interface represents the result of a test. + + + + + Gets the ResultState of the test result, which + indicates the success or failure of the test. + + + + + Gets the name of the test result + + + + + Gets the full name of the test result + + + + + Gets the elapsed time for running the test in seconds + + + + + Gets or sets the time the test started running. + + + + + Gets or sets the time the test finished running. + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + Gets the number of asserts executed + when running the test and all its children. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + Accessing HasChildren should not force creation of the + Children collection in classes implementing this interface. + + + + + Gets the collection of child results. + + + + + Gets the Test to which this result applies. + + + + + Gets any text output written to this result. + + + + + Gets a list of AssertionResults associated with the test + + + + + Gets the collection of files attached to the test + + + + + The ITypeInfo interface is an abstraction of a .NET Type + + + + + Gets the underlying Type on which this ITypeInfo is based + + + + + Gets the base type of this type as an ITypeInfo + + + + + Returns true if the Type wrapped is equal to the argument + + + + + Gets the name of the Type + + + + + Gets the full name of the Type + + + + + Gets the assembly in which the type is declared + + + + + Gets the namespace of the Type + + + + + Gets a value indicating whether the type is abstract. + + + + + Gets a value indicating whether the Type is a generic Type + + + + + Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types. + + + + + Gets a value indicating whether the Type is a generic Type definition + + + + + Gets a value indicating whether the type is sealed. + + + + + Gets a value indicating whether this type is a static class. + + + + + Get the display name for this typeInfo. + + + + + Get the display name for an object of this type, constructed with specific arguments + + + + + Returns a Type representing a generic type definition from which this Type can be constructed. + + + + + Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments + + + + + Returns a value indicating whether this type has a method with a specified public attribute + + + + + Returns an array of IMethodInfos for methods of this Type + that match the specified flags. + + + + + Gets the public constructor taking the specified argument Types + + + + + Returns a value indicating whether this Type has a public constructor taking the specified argument Types. + + + + + Construct an object of this Type, using the specified arguments. + + + + + An object implementing IXmlNodeBuilder is able to build + an XML representation of itself and any children. + + + + + Returns a TNode representing the current object. + + If true, children are included where applicable + A TNode representing the result + + + + Returns a TNode representing the current object after + adding it as a child of the supplied parent node. + + The parent node. + If true, children are included, where applicable + + + + + The ResultState class represents the outcome of running a test. + It contains two pieces of information. The Status of the test + is an enum indicating whether the test passed, failed, was + skipped or was inconclusive. The Label provides a more + detailed breakdown for use by client runners. + + + + + Initializes a new instance of the class. + + The TestStatus. + + + + Initializes a new instance of the class. + + The TestStatus. + The label. + + + + Initializes a new instance of the class. + + The TestStatus. + The stage at which the result was produced + + + + Initializes a new instance of the class. + + The TestStatus. + The label. + The stage at which the result was produced + + + + The result is inconclusive + + + + + The test has been skipped. + + + + + The test has been ignored. + + + + + The test was skipped because it is explicit + + + + + The test succeeded + + + + + The test issued a warning + + + + + The test failed + + + + + The test encountered an unexpected exception + + + + + The test was cancelled by the user + + + + + The test was not runnable. + + + + + A suite failed because one or more child tests failed or had errors + + + + + A suite failed because one or more child tests had warnings + + + + + A suite is marked ignored because one or more child tests were ignored + + + + + A suite failed in its OneTimeSetUp + + + + + A suite had an unexpected exception in its OneTimeSetUp + + + + + A suite had an unexpected exception in its OneTimeDown + + + + + Gets the TestStatus for the test. + + The status. + + + + Gets the label under which this test result is + categorized, if any. + + + + + Gets the stage of test execution in which + the failure or other result took place. + + + + + Get a new ResultState, which is the same as the current + one but with the FailureSite set to the specified value. + + The FailureSite to use + A new ResultState + + + + Test whether this ResultState has the same Status and Label + as another one. In other words, the whether two are equal + ignoring the Site. + + + + + + + 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. + + + + + Overload == operator for ResultStates + + + + + Overload != operator for ResultStates + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + The FailureSite enum indicates the stage of a test + in which an error or failure occurred. + + + + + Failure in the test itself + + + + + Failure in the SetUp method + + + + + Failure in the TearDown method + + + + + Failure of a parent test + + + + + Failure of a child test + + + + + The RunState enum indicates whether a test can be executed. + + + + + The test is not runnable. + + + + + The test is runnable. + + + + + The test can only be run explicitly + + + + + The test has been skipped. This value may + appear on a Test when certain attributes + are used to skip the test. + + + + + The test has been ignored. May appear on + a Test, when the IgnoreAttribute is used. + + + + + The TestAttachment class represents a file attached to a TestResult, + with an optional description. + + + + + Absolute file path to attachment file + + + + + User specifed description of attachment. May be null. + + + + + Creates a TestAttachment class to represent a file attached to a test result. + + Absolute file path to attachment file + User specifed description of attachment. May be null. + + + + The class holds a message sent by a test to all listeners + + + + + Construct with text, destination type and + the name of the test that produced the message. + + Destination of the message + Text to be sent + ID of the test that produced the message + + + + Converts object to string + + + + + The message to send to listeners + + + + + The Destination of the message. + + + + + The ID of the test that sent the message + + + + + Returns the XML representation of the object. + + + + + The TestOutput class holds a unit of output from + a test to a specific output stream + + + + + Construct with text, output destination type and + the name of the test that produced the output. + + Text to be output + Name of the stream or channel to which the text should be written + Id of the test that produced the output + FullName of test that produced the output + + + + Return string representation of the object for debugging + + + + + + Get the text + + + + + Get the output type + + + + + Get the name of the test that created the output + + + + + Get the id of the test that created the output + + + + + Convert the TestOutput object to an XML string + + + + + The TestStatus enum indicates the result of running a test + + + + + The test was inconclusive + + + + + The test has skipped + + + + + The test succeeded + + + + + There was a warning + + + + + The test failed + + + + + TNode represents a single node in the XML representation + of a Test or TestResult. It replaces System.Xml.XmlNode and + System.Xml.Linq.XElement, providing a minimal set of methods + for operating on the XML in a platform-independent manner. + + + + + Constructs a new instance of TNode + + The name of the node + + + + Constructs a new instance of TNode with a value + + The name of the node + The text content of the node + + + + Constructs a new instance of TNode with a value + + The name of the node + The text content of the node + Flag indicating whether to use CDATA when writing the text + + + + Gets the name of the node + + + + + Gets the value of the node + + + + + Gets a flag indicating whether the value should be output using CDATA. + + + + + Gets the dictionary of attributes + + + + + Gets a list of child nodes + + + + + Gets the first ChildNode + + + + + Gets the XML representation of this node. + + + + + Create a TNode from its XML text representation + + The XML text to be parsed + A TNode + + + + Adds a new element as a child of the current node and returns it. + + The element name. + The newly created child element + + + + Adds a new element with a value as a child of the current node and returns it. + + The element name + The text content of the new element + The newly created child element + + + + Adds a new element with a value as a child of the current node and returns it. + The value will be output using a CDATA section. + + The element name + The text content of the new element + The newly created child element + + + + Adds an attribute with a specified name and value to the XmlNode. + + The name of the attribute. + The value of the attribute. + + + + Finds a single descendant of this node matching an XPath + specification. The format of the specification is + limited to what is needed by NUnit and its tests. + + + + + + + Finds all descendants of this node matching an XPath + specification. The format of the specification is + limited to what is needed by NUnit and its tests. + + + + + Writes the XML representation of the node to an XmlWriter + + + + + + Class used to represent a list of XmlResults + + + + + Class used to represent the attributes of a node + + + + + Gets or sets the value associated with the specified key. + Overridden to return null if attribute is not found. + + The key. + Value of the attribute or null + + + + AssemblyHelper provides static methods for working + with assemblies. + + + + + Gets the path from which an assembly was loaded. + For builds where this is not possible, returns + the name of the assembly. + + The assembly. + The path. + + + + Gets the path to the directory from which an assembly was loaded. + + The assembly. + The path. + + + + Gets the AssemblyName of an assembly. + + The assembly + An AssemblyName + + + + Loads an assembly given a string, which may be the + path to the assembly or the AssemblyName + + + + + Gets the assembly path from code base. + + Public for testing purposes + The code base. + + + + + CombinatorialStrategy creates test cases by using all possible + combinations of the parameter data. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + Provides data from fields marked with the DatapointAttribute or the + DatapointsAttribute. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + Built-in SuiteBuilder for all types of test classes. + + + + + Examine the type and determine if it is suitable for + this builder to use in building a TestSuite. + + Note that returning false will cause the type to be ignored + in loading the tests. If it is desired to load the suite + but label it as non-runnable, ignored, etc., then this + method must return true. + + The fixture type to check + + + + Builds a single test suite from the specified type. + + The fixture type to build + + + + Builds a single test suite from the specified type, subject + to a filter that decides which methods are included. + + The fixture type to build + A PreFilter for selecting methods. + + + + We look for attributes implementing IFixtureBuilder at one level + of inheritance at a time. Attributes on base classes are not used + unless there are no fixture builder attributes at all on the derived + class. This is by design. + + The type being examined for attributes + + + + Class to build ether a parameterized or a normal NUnitTestMethod. + There are four cases that the builder must deal with: + 1. The method needs no params and none are provided + 2. The method needs params and they are provided + 3. The method needs no params but they are provided in error + 4. The method needs params but they are not provided + This could have been done using two different builders, but it + turned out to be simpler to have just one. The BuildFrom method + takes a different branch depending on whether any parameters are + provided, but all four cases are dealt with in lower-level methods + + + + + Determines if the method can be used to build an NUnit test + test method of some kind. The method must normally be marked + with an identifying attribute for this to be true. + + Note that this method does not check that the signature + of the method for validity. If we did that here, any + test methods with invalid signatures would be passed + over in silence in the test run. Since we want such + methods to be reported, the check for validity is made + in BuildFrom rather than here. + + An IMethodInfo for the method being used as a test method + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method for which a test is to be built + + + + Determines if the method can be used to build an NUnit test + test method of some kind. The method must normally be marked + with an identifying attribute for this to be true. + + Note that this method does not check that the signature + of the method for validity. If we did that here, any + test methods with invalid signatures would be passed + over in silence in the test run. Since we want such + methods to be reported, the check for validity is made + in BuildFrom rather than here. + + An IMethodInfo for the method being used as a test method + The test suite being built, to which the new test would be added + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method for which a test is to be built + The test fixture being populated, or null + + + + Builds a ParameterizedMethodSuite containing individual test cases. + + The method for which a test is to be built. + The list of test cases to include. + + + + Build a simple, non-parameterized TestMethod for this method. + + The MethodInfo for which a test is to be built + The test suite for which the method is being built + + + + Class that can build a tree of automatic namespace + suites from a group of fixtures. + + + + + NamespaceDictionary of all test suites we have created to represent + namespaces. Used to locate namespace parent suites for fixtures. + + + + + Point in the tree where items in the global namespace are added + + + + + Initializes a new instance of the class. + + The root suite. + + + + Gets the root entry in the tree created by the NamespaceTreeBuilder. + + The root suite. + + + + Adds the specified fixtures to the tree. + + The fixtures to be added. + + + + Adds the specified fixture to the tree. + + The fixture to be added. + + + + NUnitTestCaseBuilder is a utility class used by attributes + that build test cases. + + + + + Constructs an + + + + + Builds a single NUnitTestMethod, either as a child of the fixture + or as one of a set of test cases under a ParameterizedTestMethodSuite. + + The MethodInfo from which to construct the TestMethod + The suite or fixture to which the new test will be added + The ParameterSet to be used, or null + + + + Checks to see if we have valid combinations of attributes. + + The TestMethod to be checked. If it + is found to be non-runnable, it will be modified. + True if the method signature is valid, false if not + + + + Helper method that checks the signature of a TestMethod and + any supplied parameters to determine if the test is valid. + + Currently, NUnitTestMethods are required to be public, + non-abstract methods, either static or instance, + returning void. They may take arguments but the values must + be provided or the TestMethod is not considered runnable. + + Methods not meeting these criteria will be marked as + non-runnable and the method will return false in that case. + + The TestMethod to be checked. If it + is found to be non-runnable, it will be modified. + Parameters to be used for this test, or null + True if the method signature is valid, false if not + + The return value is no longer used internally, but is retained + for testing purposes. + + + + + NUnitTestFixtureBuilder is able to build a fixture given + a class marked with a TestFixtureAttribute or an unmarked + class containing test methods. In the first case, it is + called by the attribute and in the second directly by + NUnitSuiteBuilder. + + + + + Build a TestFixture from type provided. A non-null TestSuite + must always be returned, since the method is generally called + because the user has marked the target class as a fixture. + If something prevents the fixture from being used, it should + be returned nonetheless, labelled as non-runnable. + + An ITypeInfo for the fixture to be used. + Filter used to select methods as tests. + A TestSuite object or one derived from TestSuite. + + + + Overload of BuildFrom called by tests that have arguments. + Builds a fixture using the provided type and information + in the ITestFixtureData object. + + The TypeInfo for which to construct a fixture. + Filter used to select methods as tests. + An object implementing ITestFixtureData or null. + + + + + Method to add test cases to the newly constructed fixture. + + + + + Method to create a test case from a MethodInfo and add + it to the fixture being built. It first checks to see if + any global TestCaseBuilder addin wants to build the + test case. If not, it uses the internal builder + collection maintained by this fixture builder. + + The default implementation has no test case builders. + Derived classes should add builders to the collection + in their constructor. + + The method for which a test is to be created + The test suite being built. + A newly constructed Test + + + + PairwiseStrategy creates test cases by combining the parameter + data so that all possible pairs of data items are used. + + + + The number of test cases that cover all possible pairs of test function + parameters values is significantly less than the number of test cases + that cover all possible combination of test function parameters values. + And because different studies show that most of software failures are + caused by combination of no more than two parameters, pairwise testing + can be an effective ways to test the system when it's impossible to test + all combinations of parameters. + + + The PairwiseStrategy code is based on "jenny" tool by Bob Jenkins: + http://burtleburtle.net/bob/math/jenny.html + + + + + + FleaRand is a pseudo-random number generator developed by Bob Jenkins: + http://burtleburtle.net/bob/rand/talksmall.html#flea + + + + + Initializes a new instance of the FleaRand class. + + The seed. + + + + FeatureInfo represents coverage of a single value of test function + parameter, represented as a pair of indices, Dimension and Feature. In + terms of unit testing, Dimension is the index of the test parameter and + Feature is the index of the supplied value in that parameter's list of + sources. + + + + + Initializes a new instance of FeatureInfo class. + + Index of a dimension. + Index of a feature. + + + + A FeatureTuple represents a combination of features, one per test + parameter, which should be covered by a test case. In the + PairwiseStrategy, we are only trying to cover pairs of features, so the + tuples actually may contain only single feature or pair of features, but + the algorithm itself works with triplets, quadruples and so on. + + + + + Initializes a new instance of FeatureTuple class for a single feature. + + Single feature. + + + + Initializes a new instance of FeatureTuple class for a pair of features. + + First feature. + Second feature. + + + + TestCase represents a single test case covering a list of features. + + + + + Initializes a new instance of TestCaseInfo class. + + A number of features in the test case. + + + + PairwiseTestCaseGenerator class implements an algorithm which generates + a set of test cases which covers all pairs of possible values of test + function. + + + + The algorithm starts with creating a set of all feature tuples which we + will try to cover (see method). This set + includes every single feature and all possible pairs of features. We + store feature tuples in the 3-D collection (where axes are "dimension", + "feature", and "all combinations which includes this feature"), and for + every two feature (e.g. "A" and "B") we generate both ("A", "B") and + ("B", "A") pairs. This data structure extremely reduces the amount of + time needed to calculate coverage for a single test case (this + calculation is the most time-consuming part of the algorithm). + + + Then the algorithm picks one tuple from the uncovered tuple, creates a + test case that covers this tuple, and then removes this tuple and all + other tuples covered by this test case from the collection of uncovered + tuples. + + + Picking a tuple to cover + + + There are no any special rules defined for picking tuples to cover. We + just pick them one by one, in the order they were generated. + + + Test generation + + + Test generation starts from creating a completely random test case which + covers, nevertheless, previously selected tuple. Then the algorithm + tries to maximize number of tuples which this test covers. + + + Test generation and maximization process repeats seven times for every + selected tuple and then the algorithm picks the best test case ("seven" + is a magic number which provides good results in acceptable time). + + Maximizing test coverage + + To maximize tests coverage, the algorithm walks through the list of mutable + dimensions (mutable dimension is a dimension that are not included in + the previously selected tuple). Then for every dimension, the algorithm + walks through the list of features and checks if this feature provides + better coverage than randomly selected feature, and if yes keeps this + feature. + + + This process repeats while it shows progress. If the last iteration + doesn't improve coverage, the process ends. + + + In addition, for better results, before start every iteration, the + algorithm "scrambles" dimensions - so for every iteration dimension + probes in a different order. + + + + + + Creates a set of test cases for specified dimensions. + + + An array which contains information about dimensions. Each element of + this array represents a number of features in the specific dimension. + + + A set of test cases. + + + + + Gets the test cases generated by this strategy instance. + + A set of test cases. + + + + The ParameterDataProvider class implements IParameterDataProvider + and hosts one or more individual providers. + + + + + Construct with a collection of individual providers + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + ParameterDataSourceProvider supplies individual argument values for + single parameters using attributes implementing IParameterDataSource. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + SequentialStrategy creates test cases by using all of the + parameter data sources in parallel, substituting null + when any of them run out of data. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + TestActionAfterCommand handles the AfterTest method of a single + TestActionItem, provided the items BeforeTest has been run. + + + + + Initializes a new instance of the class. + + The inner command. + The TestActionItem to run before the inner command. + + + + AfterCommand is a DelegatingTestCommand that performs some + specific action after the inner command is run. + + + + + Construct an AfterCommand + + + + + Execute the command + + + + + Set this to perform action after the inner command. + + + + + ContextSettingsCommand applies specified changes to the + TestExecutionContext prior to running a test. No special + action is needed after the test runs, since the prior + context will be restored automatically. + + + + + TestActionCommand handles a single ITestAction applied + to a test. It runs the BeforeTest method, then runs the + test and finally runs the AfterTest method. + + + + + Initializes a new instance of the class. + + The inner command. + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Perform the before test action + + + + + Perform the after test action + + + + + TestActionBeforeCommand handles the BeforeTest method of a single + TestActionItem, relying on the item to remember it has been run. + + + + + Initializes a new instance of the class. + + The inner command. + The TestActionItem to run before the inner command. + + + + BeforeTestCommand is a DelegatingTestCommand that performs some + specific action before the inner command is run. + + + + + Construct a BeforeCommand + + + + + Execute the command + + + + + Action to perform before the inner command. + + + + + ConstructFixtureCommand constructs the user test object if necessary. + + + + + Constructs a OneTimeSetUpCommand for a suite + + The inner command to which the command applies + + + + DelegatingTestCommand wraps an inner TestCommand. + Derived classes may do what they like before or + after running the inner command. + + + + TODO: Documentation needed for field + + + + TODO: Documentation needed for constructor + + + + + + OneTimeTearDownCommand performs any teardown actions + specified for a suite and calls Dispose on the user + test object, if any. + + + + + Construct a OneTimeTearDownCommand + + The command wrapped by this command + + + + EmptyTestCommand is a TestCommand that does nothing. It simply + returns the current result from the context when executed. We + use it to avoid testing for null when executing a chain of + DelegatingTestCommands. + + + + + Construct a NullCommand for a test + + + + + Execute the command + + + + + TODO: Documentation needed for class + + + + + Initializes a new instance of the class. + + The inner command. + The max time allowed in milliseconds + + + + OneTimeSetUpCommand runs any one-time setup methods for a suite, + constructing the user test object if necessary. + + + + + Constructs a OneTimeSetUpCommand for a suite + + The inner command to which the command applies + A SetUpTearDownList for use by the command + + + + OneTimeTearDownCommand performs any teardown actions + specified for a suite and calls Dispose on the user + test object, if any. + + + + + Construct a OneTimeTearDownCommand + + The command wrapped by this command + A SetUpTearDownList for use by the command + + + + SetUpTearDownCommand runs SetUp methods for a suite, + runs the test and then runs TearDown methods. + + + + + Initializes a new instance of the class. + + The inner command. + List of setup/teardown items + + + + SetUpTearDownItem holds the setup and teardown methods + for a single level of the inheritance hierarchy. + + + + + Construct a SetUpTearDownNode + + A list of setup methods for this level + A list teardown methods for this level + + + + Returns true if this level has any methods at all. + This flag is used to discard levels that do nothing. + + + + + Run SetUp on this level. + + The execution context to use for running. + + + + Run TearDown for this level. + + + + + + TODO: Documentation needed for class + + + + + Initializes a new instance of the class. + + The test being skipped. + + + + Overridden to simply set the CurrentResult to the + appropriate Skipped state. + + The execution context for the test + A TestResult + + + + TestActionCommand handles a single ITestAction applied + to a test. It runs the BeforeTest method, then runs the + test and finally runs the AfterTest method. + + + + + Initializes a new instance of the class. + + The inner command. + The TestAction with which to wrap the inner command. + + + + TestActionItem wraps a single execution of an ITestAction. + Its primary purpose is to track whether the BeforeTest + method has been called and suppress calling the + AfterTest method if it has not. This is necessary when + ITestActions are used before and after a CompositeWorkItem, + since the OneTimeSetUpCommand and OneTimeTearDownCommand + are separate command chains. By sharing a TestActionItem + between the setup and teardown chains, the two calls can + be coordinated. + + + + + Construct a TestActionItem + + The ITestAction to be included + + + + Get flag indicating if the BeforeTest entry was already called. + + + + + Run the BeforeTest method of the action and remember that it has been run. + + The test to which the action applies + + + + Run the AfterTest action, but only if the BeforeTest + action was actually run. + + The test to which the action applies + + + + TestCommand is the abstract base class for all test commands + in the framework. A TestCommand represents a single stage in + the execution of a test, e.g.: SetUp/TearDown, checking for + Timeout, verifying the returned result from a method, etc. + + TestCommands may decorate other test commands so that the + execution of a lower-level command is nested within that + of a higher level command. All nested commands are executed + synchronously, as a single unit. Scheduling test execution + on separate threads is handled at a higher level, using the + task dispatcher. + + + + + Construct a TestCommand for a test. + + The test to be executed + + + + Gets the test associated with this command. + + + + + Runs the test in a specified context, returning a TestResult. + + The TestExecutionContext to be used for running the test. + A TestResult + + + + TestMethodCommand is the lowest level concrete command + used to run actual test cases. + + + + + Initializes a new instance of the class. + + The test. + + + + Runs the test, saving a TestResult in the execution context, as + well as returning it. If the test has an expected result, it + is asserts on that value. Since failed tests and errors throw + an exception, this command must be wrapped in an outer command, + will handle that exception and records the failure. This role + is usually played by the SetUpTearDown command. + + The execution context + + + + TheoryResultCommand adjusts the result of a Theory so that + it fails if all the results were inconclusive. + + + + + Constructs a TheoryResultCommand + + The command to be wrapped by this one + + + + TimeoutCommand creates a timer in order to cancel + a test if it exceeds a specified time and adjusts + the test result if it did time out. + + + + + Initializes a new instance of the class. + + The inner command + Timeout value + + + + Provides methods to support consistent checking in constraints. + + + + + Requires that the provided object is actually of the type required. + + The object to verify. + Name of the parameter as passed into the checking method. + + If and can be null, returns null rather than throwing when is null. + If cannot be null, this parameter is ignored. + The type to require. + + + + CultureDetector is a helper class used by NUnit to determine + whether a test should be run based on the current culture. + + + + + Default constructor uses the current culture. + + + + + Construct a CultureDetector for a particular culture for testing. + + The culture to be used + + + + Test to determine if one of a collection of cultures + is being used currently. + + + + + + + Tests to determine if the current culture is supported + based on a culture attribute. + + The attribute to examine + + + + + Test to determine if the a particular culture or comma- + delimited set of cultures is in use. + + Name of the culture or comma-separated list of culture ids + True if the culture is in use on the system + + + + Return the last failure reason. Results are not + defined if called before IsSupported( Attribute ) + is called. + + + + + ExceptionHelper provides static methods for working with exceptions + + + + + Rethrows an exception, preserving its stack trace + + The exception to rethrow + + + + Builds up a message, using the Message field of the specified exception + as well as any InnerExceptions. Optionally excludes exception names, + creating a more readable message. + + The exception. + Flag indicating whether exception names should be excluded. + A combined message string. + + + + Builds up a message, using the Message field of the specified exception + as well as any InnerExceptions. + + The exception. + A combined stack trace. + + + + Gets the stack trace of the exception. If no stack trace + is provided, returns "No stack trace available". + + The exception. + A string representation of the stack trace. + + + + A CompositeWorkItem represents a test suite and + encapsulates the execution of the suite as well + as all its child tests. + + + + + List of Child WorkItems + + + + + Indicates whether this work item should use a separate dispatcher. + + + + + Construct a CompositeWorkItem for executing a test suite + using a filter to select child tests. + + The TestSuite to be executed + A filter used to select child tests + + + + Method that actually performs the work. Overridden + in CompositeWorkItem to do one-time setup, run all child + items and then dispatch the one-time teardown work item. + + + + + + + + + + Cancel (abort or stop) a CompositeWorkItem and all of its children + + true if the CompositeWorkItem and all of its children should be aborted, false if it should allow all currently running tests to complete + + + + OneTimeTearDownWorkItem represents the cleanup + and one-time teardown phase of a CompositeWorkItem + + + + + Construct a OneTimeTearDownWOrkItem wrapping a CompositeWorkItem + + The CompositeWorkItem being wrapped + + + + The WorkItem name, overridden to indicate this is the teardown. + + + + + The ExecutionStrategy for use in running this work item + + + + + + + + + + PerformWork is not used in CompositeWorkItem + + + + + EventListenerTextWriter sends text output to the currently active + ITestEventListener in the form of a TestOutput object. If no event + listener is active in the context, or if there is no context, + the output is forwarded to the supplied default writer. + + + + + Construct an EventListenerTextWriter + + The name of the stream to use for events + The default writer to use if no listener is available + + + + Get the Encoding for this TextWriter + + + + + Write formatted string + + + + + Write formatted string + + + + + Write formatted string + + + + + Write an object + + + + + Write a string + + + + + Write a decimal + + + + + Write a double + + + + + Write formatted string + + + + + Write a ulong + + + + + Write a long + + + + + Write a uint + + + + + Write an int + + + + + Write a char + + + + + Write a boolean + + + + + Write chars + + + + + Write chars + + + + + Write a float + + + + + Write a string with newline + + + + + Write an object with newline + + + + + Write formatted string with newline + + + + + Write formatted string with newline + + + + + Write formatted string with newline + + + + + Write a decimal with newline + + + + + Write a formatted string with newline + + + + + Write a double with newline + + + + + Write a uint with newline + + + + + Write a ulong with newline + + + + + Write a long with newline + + + + + Write an int with newline + + + + + Write a bool with newline + + + + + Write chars with newline + + + + + Write chars with newline + + + + + Write a char with newline + + + + + Write a float with newline + + + + + Write newline + + + + + The EventPumpState enum represents the state of an + EventPump. + + + + + The pump is stopped + + + + + The pump is pumping events with no stop requested + + + + + The pump is pumping events but a stop has been requested + + + + + EventPump pulls events out of an EventQueue and sends + them to a listener. It is used to send events back to + the client without using the CallContext of the test + runner thread. + + + + + The downstream listener to which we send events + + + + + The queue that holds our events + + + + + Thread to do the pumping + + + + + The current state of the event pump + + + + + Constructor + + The EventListener to receive events + The event queue to pull events from + + + + Gets or sets the current state of the pump + + + + + Gets or sets the name of this EventPump + (used only internally and for testing). + + + + + Dispose stops the pump + Disposes the used WaitHandle, too. + + + + + Start the pump + + + + + Tell the pump to stop after emptying the queue. + + + + + Our thread proc for removing items from the event + queue and sending them on. Note that this would + need to do more locking if any other thread were + removing events from the queue. + + + + + NUnit.Core.Event is the abstract base for all stored events. + An Event is the stored representation of a call to the + ITestListener interface and is used to record such calls + or to queue them for forwarding on another thread or at + a later time. + + + + + The Send method is implemented by derived classes to send the event to the specified listener. + + The listener. + + + + TestStartedEvent holds information needed to call the TestStarted method. + + + + + Initializes a new instance of the class. + + The test. + + + + Calls TestStarted on the specified listener. + + The listener. + + + + TestFinishedEvent holds information needed to call the TestFinished method. + + + + + Initializes a new instance of the class. + + The result. + + + + Calls TestFinished on the specified listener. + + The listener. + + + + TestOutputEvent holds information needed to call the TestOutput method. + + + + + Initializes a new instance of the class. + + The output object. + + + + Calls TestOutput on the specified listener. + + The listener. + + + + TestMessageEvent holds information needed to call the SendMessage method. + + + + + Initializes a new instance of the class. + + The test message object. + + + + Calls on the specified listener. + + The listener. + + + + Holds object for sending to all listeners + + + + + Implements a queue of work items each of which + is queued as a WaitCallback. + + + + + Gets the count of items in the queue. + + + + + Enqueues the specified event + + The event to enqueue. + + + + Removes the first element from the queue and returns it (or null). + + + If true and the queue is empty, the calling thread is blocked until + either an element is enqueued, or is called. + + + + + If the queue not empty + the first element. + + + otherwise, if ==false + or has been called + null. + + + + + + + Stop processing of the queue + + + + + An IWorkItemDispatcher handles execution of work items. + + + + + The level of parallelism supported. Zero if not supported. + + + + + Start execution, performing any initialization. Sets + the top level work item and dispatches it. + + + + + Dispatch a single work item for execution. The first + work item dispatched is saved as the top-level + work item and used when stopping the run. + + The item to dispatch + + + + Cancel the ongoing run completely. + If no run is in process, the call has no effect. + + true if the IWorkItemDispatcher should abort all currently running WorkItems, false if it should allow all currently running WorkItems to complete + + + + MainThreadWorkItemDispatcher handles execution of WorkItems by + directly executing them on the main thread. This is different + from the SimpleWorkItemDispatcher where the work item is dispatched + onto its own thread. + + + + + The level of parallelism supported + + + + + Start execution, dispatching the top level + work into the main thread. + + + + + Dispatch a single work item for execution by + executing it directly. + The item to dispatch + + + + + This method is not supported for + this dispatcher. Using it will throw a + NotSupportedException. + + Not used + If used, it will always throw this. + + + + Enumeration representing the strategy to follow in executing a work item. + The value is only relevant when running under the parallel dispatcher. + + + + + Run directly on same thread + + + + + Enqueue for parallel execution + + + + + Enqueue for non-parallel execution + + + + + ParallelWorkItemDispatcher handles execution of work items by + queuing them for worker threads to process. + + + + + Event raised whenever a shift is starting. + + + + + Event raised whenever a shift has ended. + + + + + Construct a ParallelWorkItemDispatcher + + Number of workers to use + + + + Number of parallel worker threads + + + + + Enumerates all the shifts supported by the dispatcher + + + + + Enumerates all the Queues supported by the dispatcher + + + + + Start execution, setting the top level work, + enqueuing it and starting a shift to execute it. + + + + + Dispatch a single work item for execution. The first + work item dispatched is saved as the top-level + work item and used when stopping the run. + + The item to dispatch + + + + Cancel the ongoing run completely. + If no run is in process, the call has no effect. + + + + + Save the state of the queues and create a new isolated set + + + + + Remove isolated queues and restore old ones + + + + + QueuingEventListener uses an EventQueue to store any + events received on its EventListener interface. + + + + + The EventQueue created and filled by this listener + + + + + Construct a QueuingEventListener + + + + + A test has started + + The test that is starting + + + + A test case finished + + Result of the test case + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + A SimpleWorkItem represents a single test case and is + marked as completed immediately upon execution. This + class is also used for skipped or ignored test suites. + + + + + Construct a simple work item for a test. + + The test to be executed + The filter used to select this test + + + + Method that performs actually performs the work. + + + + + Creates a test command for use in running this test. + + A TestCommand + + + + SimpleWorkItemDispatcher handles execution of WorkItems by + directly executing them. It is provided so that a dispatcher + is always available in the context, thereby simplifying the + code needed to run child tests. + + + + + The level of parallelism supported + + + + + Start execution, creating the execution thread, + setting the top level work and dispatching it. + + + + + Dispatch a single work item for execution by + executing it directly. + The item to dispatch + + + + + Cancel (abort or stop) the ongoing run. + If no run is in process, the call has no effect. + + true if the run should be aborted, false if it should allow its currently running test to complete + + + + A TestWorker pulls work items from a queue + and executes them. + + + + + Event handler for TestWorker events + + The TestWorker sending the event + The WorkItem that caused the event + + + + Event signaled immediately before executing a WorkItem + + + + + Event signaled immediately after executing a WorkItem + + + + + Construct a new TestWorker. + + The queue from which to pull work items + The name of this worker + + + + The WorkItemQueue from which this worker pulls WorkItems + + + + + The name of this worker - also used for the thread + + + + + Indicates whether the worker thread is running + + + + + Our ThreadProc, which pulls and runs tests in a loop + + + + + Create thread and start processing work items. + + + + + Stop the thread, either immediately or after finishing the current WorkItem + + true if the thread should be aborted, false if it should allow the currently running test to complete + + + + The TextCapture class intercepts console output and writes it + to the current execution context, if one is present on the thread. + If no execution context is found, the output is written to a + default destination, normally the original destination of the + intercepted output. + + + + + Construct a TextCapture object + + The default destination for non-intercepted output + + + + Gets the Encoding in use by this TextWriter + + + + + Writes a single character + + The char to write + + + + Writes a string + + The string to write + + + + Writes a string followed by a line terminator + + The string to write + + + + A WorkItem may be an individual test case, a fixture or + a higher level grouping of tests. All WorkItems inherit + from the abstract WorkItem class, which uses the template + pattern to allow derived classes to perform work in + whatever way is needed. + + A WorkItem is created with a particular TestExecutionContext + and is responsible for re-establishing that context in the + current thread before it begins or resumes execution. + + + + + Construct a WorkItem for a particular test. + + The test that the WorkItem will run + Filter used to include or exclude child items + + + + Construct a work Item that wraps another work Item. + Wrapper items are used to represent independently + dispatched tasks, which form part of the execution + of a single test, such as OneTimeTearDown. + + The WorkItem being wrapped + + + + Initialize the TestExecutionContext. This must be done + before executing the WorkItem. + + + Originally, the context was provided in the constructor + but delaying initialization of the context until the item + is about to be dispatched allows changes in the parent + context during OneTimeSetUp to be reflected in the child. + + The TestExecutionContext to use + + + + Event triggered when the item is complete + + + + + Gets the current state of the WorkItem + + + + + The test being executed by the work item + + + + + The name of the work item - defaults to the Test name. + + + + + Filter used to include or exclude child tests + + + + + The execution context + + + + + The worker executing this item. + + + + + The ParallelExecutionStrategy to use for this work item + + + + + Indicates whether this work item should use a separate dispatcher. + + + + + The test result + + + + + Gets the ParallelScope associated with the test, if any, + otherwise returning ParallelScope.Default; + + + + + Execute the current work item, including any + child work items. + + + + + Wait until the execution of this item is complete + + + + + Marks the WorkItem as NotRunnable. + + Reason for test being NotRunnable. + + + + Cancel (abort or stop) a WorkItem + + true if the WorkItem should be aborted, false if it should run to completion + + + + Standard Dispose + + + + + Method that performs actually performs the work. It should + set the State to WorkItemState.Complete when done. + + + + + Method called by the derived class when all work is complete + + + + + Builds the set up tear down list. + + Unsorted array of setup MethodInfos. + Unsorted array of teardown MethodInfos. + A list of SetUpTearDownItems + + + + Changes the result of the test, logging the old and new states + + The new ResultState + The new message + + + + Recursively walks up the test hierarchy to see if the + has been set on any of the parent tests. + + + + + WorkItemBuilder class knows how to build a tree of work items from a tree of tests + + + + + Creates a work item. + + The test for which this WorkItem is being created. + The filter to be used in selecting any child Tests. + True if child work items should be created and added. + + + + + Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. + + + A signed integer that indicates the relative values of and , as shown in the following table.Value Meaning Less than zero is less than .Zero equals .Greater than zero is greater than . + + The first object to compare.The second object to compare. + + + + WorkItemQueueState indicates the current state of a WorkItemQueue + + + + + The queue is paused + + + + + The queue is running + + + + + The queue is stopped + + + + + A WorkItemQueue holds work items that are ready to + be run, either initially or after some dependency + has been satisfied. + + + + + Initializes a new instance of the class. + + The name of the queue. + Flag indicating whether this is a parallel queue + ApartmentState to use for items on this queue + + + + Gets the name of the work item queue. + + + + + Gets a flag indicating whether this queue is used for parallel execution + + + + + Gets the target ApartmentState for work items on this queue + + + + + Gets the total number of items processed so far + + + + + Gets the current state of the queue + + + + + Get a bool indicating whether the queue is empty. + + + + + Enqueue a WorkItem to be processed + + The WorkItem to process + + + + Enqueue a WorkItem to be processed - internal for testing + + The WorkItem to process + The priority at which to process the item + + + + Dequeue a WorkItem for processing + + A WorkItem or null if the queue has stopped + + + + Start or restart processing of items from the queue + + + + + Signal the queue to stop + + + + + Pause the queue for restarting later + + + + + Save the current inner queue and create new ones for use by + a non-parallel fixture with parallel children. + + + + + Restore the inner queue that was previously saved + + + + + The current state of a work item + + + + + Ready to run or continue + + + + + Work Item is executing + + + + + Complete + + + + + Handler for ShiftChange events. + + The shift that is starting or ending. + + + + The dispatcher needs to do different things at different, + non-overlapped times. For example, non-parallel tests may + not be run at the same time as parallel tests. We model + this using the metaphor of a working shift. The WorkShift + class associates one or more WorkItemQueues with one or + more TestWorkers. + + Work in the queues is processed until all queues are empty + and all workers are idle. Both tests are needed because a + worker that is busy may end up adding more work to one of + the queues. At that point, the shift is over and another + shift may begin. This cycle continues until all the tests + have been run. + + + + + Construct a WorkShift + + + + + Event that fires when the shift has ended + + + + + The Name of this shift + + + + + Gets a flag indicating whether the shift is currently active + + + + + Gets a bool indicating whether this shift has any work to do + + + + + Gets a list of the queues associated with this shift. + + Internal for testing - immutable once initialized + + + + Gets the list of workers associated with this shift. + + Internal for testing - immutable once initialized + + + + Add a WorkItemQueue to the shift, starting it if the + shift is currently active. + + + + + Assign a worker to the shift. + + + + + + Start or restart processing for the shift + + + + + End the shift, pausing all queues and raising + the EndOfShift event. + + + + + Shut down the shift. + + + + + Cancel (abort or stop) the shift without completing all work + + true if the WorkShift should be aborted, false if it should allow its currently running tests to complete + + + + 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. + + + + + + + Gets or sets the maximum line length for this writer + + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a given + 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 result of the constraint that failed + + + + Gets the unique type name between expected and actual. + + The expected value + The actual value causing the failure + Output of the unique type name for expected + Output of the unique type name for actual + + + + 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 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 ConstraintResult for which the actual value is to be written + + + + Write the generic 'Actual' line for a given value + + The actual value causing a failure + + + + Combines multiple filters so that a test must pass all + of them in order to pass this filter. + + + + + Constructs an empty AndFilter + + + + + Constructs an AndFilter from an array of filters + + + + + + Checks whether the AndFilter is matched by a test + + The test to be matched + True if all the component filters pass, otherwise false + + + + Checks whether the AndFilter is matched by a test + + The test to be matched + True if all the component filters match, otherwise false + + + + Checks whether the AndFilter is explicit matched by a test. + + The test to be matched + True if all the component filters explicit match, otherwise false + + + + Gets the element name + + Element name + + + + CategoryFilter is able to select or exclude tests + based on their categories. + + + + + Construct a CategoryFilter using a single category name + + A category name + + + + Check whether the filter matches a test + + The test to be matched + + + + + Gets the element name + + Element name + + + + ClassName filter selects tests based on the class FullName + + + + + Construct a FullNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + A base class for multi-part filters + + + + + Constructs an empty CompositeFilter + + + + + Constructs a CompositeFilter from an array of filters + + + + + + Adds a filter to the list of filters + + The filter to be added + + + + Return a list of the composing filters. + + + + + Checks whether the CompositeFilter is matched by a test. + + The test to be matched + + + + Checks whether the CompositeFilter is matched by a test. + + The test to be matched + + + + Checks whether the CompositeFilter is explicit matched by a test. + + The test to be matched + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + FullName filter selects tests based on their FullName + + + + + Construct a FullNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + IdFilter selects tests based on their id + + + + + Construct an IdFilter for a single value + + The id the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + FullName filter selects tests based on their FullName + + + + + Construct a MethodNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + ClassName filter selects tests based on the class FullName + + + + + Construct a NamespaceFilter for a single namespace + + The namespace the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + NotFilter negates the operation of another filter + + + + + Construct a not filter on another filter + + The filter to be negated + + + + Gets the base filter + + + + + Determine if a particular test passes the filter criteria. The default + implementation checks the test itself, its parents and any descendants. + + Derived classes may override this method or any of the Match methods + to change the behavior of the filter. + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Check whether the filter matches a test + + The test to be matched + True if it matches, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Combines multiple filters so that a test must pass one + of them in order to pass this filter. + + + + + Constructs an empty OrFilter + + + + + Constructs an AndFilter from an array of filters + + + + + + Checks whether the OrFilter is matched by a test + + The test to be matched + True if any of the component filters pass, otherwise false + + + + Checks whether the OrFilter is matched by a test + + The test to be matched + True if any of the component filters match, otherwise false + + + + Checks whether the OrFilter is explicit matched by a test + + The test to be matched + True if any of the component filters explicit match, otherwise false + + + + Gets the element name + + Element name + + + + PropertyFilter is able to select or exclude tests + based on their properties. + + + + + Construct a PropertyFilter using a property name and expected value + + A property name + The expected value of the property + + + + Check whether the filter matches a test + + The test to be matched + + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + TestName filter selects tests based on their Name + + + + + Construct a TestNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + ValueMatchFilter selects tests based on some value, which + is expected to be contained in the test. + + + + + Returns the value matched by the filter - used for testing + + + + + Indicates whether the value is a regular expression + + + + + Construct a ValueMatchFilter for a single value. + + The value to be included. + + + + Match the input provided by the derived class + + The value to be matchedT + True for a match, false otherwise. + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + GenericMethodHelper is able to deduce the Type arguments for + a generic method from the actual arguments provided. + + + + + A special value, which is used to indicate that BestCommonType() method + was unable to find a common type for the specified arguments. + + + + + Construct a GenericMethodHelper for a method + + MethodInfo for the method to examine + + + + Return the type arguments for the method, deducing them + from the arguments actually provided. + + The arguments to the method + If successful, an array of type arguments. + + + + InvalidTestFixtureException is thrown when an appropriate test + fixture constructor using the provided arguments cannot be found. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + InvalidPlatformException is thrown when the platform name supplied + to a test is not recognized. + + + + + Instantiates a new instance of the class. + + + + + Instantiates a new instance of the class + + The message. + + + + Instantiates a new instance of the class + + The message. + The inner. + + + + Serialization constructor for the class + + + + + InvalidTestFixtureException is thrown when an appropriate test + fixture constructor using the provided arguments cannot be found. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + Interface for logging within the engine + + + + + Logs the specified message at the error level. + + The message. + + + + Logs the specified message at the error level. + + The message. + The arguments. + + + + Logs the specified message at the warning level. + + The message. + + + + Logs the specified message at the warning level. + + The message. + The arguments. + + + + Logs the specified message at the info level. + + The message. + + + + Logs the specified message at the info level. + + The message. + The arguments. + + + + Logs the specified message at the debug level. + + The message. + + + + Logs the specified message at the debug level. + + The message. + The arguments. + + + + InternalTrace provides facilities for tracing the execution + of the NUnit framework. Tests and classes under test may make use + of Console writes, System.Diagnostics.Trace or various loggers and + NUnit itself traps and processes each of them. For that reason, a + separate internal trace is needed. + + Note: + InternalTrace uses a global lock to allow multiple threads to write + trace messages. This can easily make it a bottleneck so it must be + used sparingly. Keep the trace Level as low as possible and only + insert InternalTrace writes where they are needed. + TODO: add some buffering and a separate writer thread as an option. + TODO: figure out a way to turn on trace in specific classes only. + + + + + Gets a flag indicating whether the InternalTrace is initialized + + + + + Initialize the internal trace facility using the name of the log + to be written to and the trace level. + + The log name + The trace level + + + + Initialize the internal trace using a provided TextWriter and level + + A TextWriter + The InternalTraceLevel + + + + Get a named Logger + + + + + + Get a logger named for a particular Type. + + + + + InternalTraceLevel is an enumeration controlling the + level of detailed presented in the internal log. + + + + + Use the default settings as specified by the user. + + + + + Do not display any trace messages + + + + + Display Error messages only + + + + + Display Warning level and higher messages + + + + + Display informational and higher messages + + + + + Display debug messages and higher - i.e. all messages + + + + + Display debug messages and higher - i.e. all messages + + + + + A trace listener that writes to a separate file per domain + and process using it. + + + + + Construct an InternalTraceWriter that writes to a file. + + Path to the file to use + + + + Construct an InternalTraceWriter that writes to a + TextWriter provided by the caller. + + + + + + Returns the character encoding in which the output is written. + + The character encoding in which the output is written. + + + + Writes a character to the text string or stream. + + The character to write to the text stream. + + + + Writes a string to the text string or stream. + + The string to write. + + + + Writes a string followed by a line terminator to the text string or stream. + + The string to write. If is null, only the line terminator is written. + + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Clears all buffers for the current writer and causes any buffered data to be written to the underlying device. + + + + + Provides internal logging to the NUnit framework + + + + + Initializes a new instance of the class. + + The name. + The log level. + The writer where logs are sent. + + + + Logs the message at error level. + + The message. + + + + Logs the message at error level. + + The message. + The message arguments. + + + + Logs the message at warm level. + + The message. + + + + Logs the message at warning level. + + The message. + The message arguments. + + + + Logs the message at info level. + + The message. + + + + Logs the message at info level. + + The message. + The message arguments. + + + + Logs the message at debug level. + + The message. + + + + Logs the message at debug level. + + The message. + The message arguments. + + + + The MethodWrapper class wraps a MethodInfo so that it may + be used in a platform-independent manner. + + + + + Construct a MethodWrapper for a Type and a MethodInfo. + + + + + Construct a MethodInfo for a given Type and method name. + + + + + Gets the Type from which this method was reflected. + + + + + Gets the MethodInfo for this method. + + + + + Gets the name of the method. + + + + + Gets a value indicating whether the method is abstract. + + + + + Gets a value indicating whether the method is public. + + + + + Gets a value indicating whether the method contains unassigned generic type parameters. + + + + + Gets a value indicating whether the method is a generic method. + + + + + Gets a value indicating whether the MethodInfo represents the definition of a generic method. + + + + + Gets the return Type of the method. + + + + + Gets the parameters of the method. + + + + + + Returns the Type arguments of a generic method or the Type parameters of a generic method definition. + + + + + Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo. + + The type arguments to be used + A new IMethodInfo with the type arguments replaced + + + + Returns an array of custom attributes of the specified type applied to this method + + + + + Gets a value indicating whether one or more attributes of the specified type are defined on the method. + + + + + Invokes the method, converting any TargetInvocationException to an NUnitException. + + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + Override ToString() so that error messages in NUnit's own tests make sense + + + + + Thrown when an assertion failed. Here to preserve the inner + exception and hence its stack trace. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The error message that explains + the reason for the exception + + + + Initializes a new instance of the class. + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Enables the syntax. + + + + + Wraps an action so that it is executed when the returned object is disposed. + This disposal is thread-safe and the action will be executed at most once. + + + + + OSPlatform represents a particular operating system platform + + + + + Platform ID for Unix as defined by Microsoft .NET 2.0 and greater + + + + + Platform ID for Unix as defined by Mono + + + + + Platform ID for XBox as defined by .NET and Mono + + + + + Platform ID for MacOSX as defined by .NET and Mono + + + + + Get the OSPlatform under which we are currently running + + + + + Gets the actual OS Version, not the incorrect value that might be + returned for Win 8.1 and Win 10 + + + If an application is not manifested as Windows 8.1 or Windows 10, + the version returned from Environment.OSVersion will not be 6.3 and 10.0 + respectively, but will be 6.2 and 6.3. The correct value can be found in + the registry. + + The original version + The correct OS version + + + + Product Type Enumeration used for Windows + + + + + Product type is unknown or unspecified + + + + + Product type is Workstation + + + + + Product type is Domain Controller + + + + + Product type is Server + + + + + Construct from a platform ID and version + + + + + Construct from a platform ID, version and product type + + + + + Get the platform ID of this instance + + + + + Implemented to use in place of Environment.OSVersion.ToString() + + A representation of the platform ID and version in an approximation of the format used by Environment.OSVersion.ToString() + + + + Get the Version of this instance + + + + + Get the Product Type of this instance + + + + + Return true if this is a windows platform + + + + + Return true if this is a Unix or Linux platform + + + + + Return true if the platform is Win32S + + + + + Return true if the platform is Win32Windows + + + + + Return true if the platform is Win32NT + + + + + Return true if the platform is Windows CE + + + + + Return true if the platform is Xbox + + + + + Return true if the platform is MacOSX + + + + + Return true if the platform is Windows 95 + + + + + Return true if the platform is Windows 98 + + + + + Return true if the platform is Windows ME + + + + + Return true if the platform is NT 3 + + + + + Return true if the platform is NT 4 + + + + + Return true if the platform is NT 5 + + + + + Return true if the platform is Windows 2000 + + + + + Return true if the platform is Windows XP + + + + + Return true if the platform is Windows 2003 Server + + + + + Return true if the platform is NT 6 + + + + + Return true if the platform is NT 6.0 + + + + + Return true if the platform is NT 6.1 + + + + + Return true if the platform is NT 6.2 + + + + + Return true if the platform is NT 6.3 + + + + + Return true if the platform is Vista + + + + + Return true if the platform is Windows 2008 Server (original or R2) + + + + + Return true if the platform is Windows 2008 Server (original) + + + + + Return true if the platform is Windows 2008 Server R2 + + + + + Return true if the platform is Windows 2012 Server (original or R2) + + + + + Return true if the platform is Windows 2012 Server (original) + + + + + Return true if the platform is Windows 2012 Server R2 + + + + + Return true if the platform is Windows 7 + + + + + Return true if the platform is Windows 8 + + + + + Return true if the platform is Windows 8.1 + + + + + Return true if the platform is Windows 10 + + + + + Return true if the platform is Windows Server. This is named Windows + Server 10 to distinguish it from previous versions of Windows Server. + + + + + + Examines an attribute argument and tries to simulate what that value would have been if the literal syntax + which might have defined the value in C# had instead been used as an argument to a given method parameter in a direct call. + + + For example, since you can’t apply attributes using arguments, we allow the C# syntax + 10 ( value) or 0.1 ( value) to be specified. + NUnit then converts it to match the method’s parameters, just as if you were actually + using the syntax TestMethod(10) or TestMethod(0.1). + + + For another example, you might have written the syntax 10 and picked up the attribute + constructor overload; however, the test method for which this value is intended only has a + signature. Again, NUnit simulates what would have happened if the inferred C# syntax was transplanted + and you were actually using the syntax TestMethod(10). + + + + + + Converts an array of objects to the , if it is supported. + + + + + Converts a single value to the , if it is supported. + + + + + Converts a single value to the , if it is supported. + + + + + The ParameterWrapper class wraps a ParameterInfo so that it may + be used in a platform-independent manner. + + + + + Construct a ParameterWrapper for a given method and parameter + + + + + + + Gets a value indicating whether the parameter is optional + + + + + Gets an IMethodInfo representing the method for which this is a parameter. + + + + + Gets the underlying ParameterInfo + + + + + Gets the Type of the parameter + + + + + Returns an array of custom attributes of the specified type applied to this method + + + + + Gets a value indicating whether one or more attributes of the specified type are defined on the parameter. + + + + + PlatformHelper class is used by the PlatformAttribute class to + determine whether a platform is supported. + + + + + Comma-delimited list of all supported OS platform constants + + + + + Comma-delimited list of all supported Runtime platform constants + + + + + Default constructor uses the operating system and + common language runtime of the system. + + + + + Construct a PlatformHelper for a particular operating + system and common language runtime. Used in testing. + + RuntimeFramework to be used + OperatingSystem to be used + + + + Test to determine if one of a collection of platforms + is being used currently. + + + + + + + Tests to determine if the current platform is supported + based on a platform attribute. + + The attribute to examine + + + + + Tests to determine if the current platform is supported + based on a platform attribute. + + The attribute to examine + + + + + Test to determine if a particular platform or comma-delimited set of platforms is in use. + + Name of the platform or comma-separated list of platform ids + True if the platform is in use on the system + + + + Return the last failure reason. Results are not + defined if called before IsSupported( Attribute ) + is called. + + + + + Implements a simplified filter for use in deciding which + Types and Methods should be used to generate tests. It is consructed with a + list of strings, each of which may end up being interpreted in various ways. + + + + + Return a new PreFilter, without elements, which is considered + empty and always matches. + + + + + Return true if the filter is empty, in which case it + always succeeds. Technically, this is just a filter and + you can add elements but it's best to use Empty when + you need an empty filter and new when you plan to add. + + + + + Add a new filter element to the filter + + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + A PropertyBag represents a collection of name value pairs + that allows duplicate entries with the same key. Methods + are provided for adding a new pair as well as for setting + a key to a single value. All keys are strings but values + may be of any type. Null values are not permitted, since + a null entry represents the absence of the key. + + + + + Adds a key/value pair to the property set + + The key + The value + + + + Sets the value for a key, removing any other + values that are already in the property set. + + + + + + + Gets a single value for a key, using the first + one if multiple values are present and returning + null if the value is not found. + + + + + + + Gets a flag indicating whether the specified key has + any entries in the property set. + + The key to be checked + + True if their are values present, otherwise false + + + + + Gets a collection containing all the keys in the property set + + + + + + Gets or sets the list of values for a particular key + + + + + Returns an XmlNode representing the current PropertyBag. + + Not used + An XmlNode representing the PropertyBag + + + + Returns an XmlNode representing the PropertyBag after + adding it as a child of the supplied parent node. + + The parent node. + Not used + + + + + The PropertyNames class provides static constants for the + standard property ids that NUnit uses on tests. + + + + + The FriendlyName of the AppDomain in which the assembly is running + + + + + The selected strategy for joining parameter data into test cases + + + + + The process ID of the executing assembly + + + + + The stack trace from any data provider that threw + an exception. + + + + + The reason a test was not run + + + + + The author of the tests + + + + + The ApartmentState required for running the test + + + + + The categories applying to a test + + + + + The Description of a test + + + + + The number of threads to be used in running tests + + + + + The maximum time in ms, above which the test is considered to have failed + + + + + The ParallelScope associated with a test + + + + + The number of times the test should be repeated + + + + + Indicates that the test should be run on a separate thread + + + + + The culture to be set for a test + + + + + The UI culture to be set for a test + + + + + The type that is under test + + + + + The timeout value for the test + + + + + The test will be ignored until the given date + + + + + The optional Order the test will run in + + + + + Randomizer returns a set of random values in a repeatable + way, to allow re-running of tests if necessary. It extends + the .NET Random class, providing random values for a much + wider range of types. + + The class is used internally by the framework to generate + test case data and is also exposed for use by users through + the TestContext.Random property. + + + For consistency with the underlying Random Type, methods + returning a single value use the prefix "Next..." Those + without an argument return a non-negative value up to + the full positive range of the Type. Overloads are provided + for specifying a maximum or a range. Methods that return + arrays or strings use the prefix "Get..." to avoid + confusion with the single-value methods. + + + + + Initial seed used to create randomizers for this run + + + + + 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. + + + + + Create a new Randomizer using the next seed + available to ensure that each randomizer gives + a unique sequence of values. + + + + + + Default constructor + + + + + Construct based on seed value + + + + + + Returns a random unsigned int. + + + + + Returns a random unsigned int less than the specified maximum. + + + + + Returns a random unsigned int within a specified range. + + + + + Returns a non-negative random short. + + + + + Returns a non-negative random short less than the specified maximum. + + + + + Returns a non-negative random short within a specified range. + + + + + Returns a random unsigned short. + + + + + Returns a random unsigned short less than the specified maximum. + + + + + Returns a random unsigned short within a specified range. + + + + + Returns a random long. + + + + + Returns a random long less than the specified maximum. + + + + + Returns a non-negative random long within a specified range. + + + + + Returns a random ulong. + + + + + Returns a random ulong less than the specified maximum. + + + + + Returns a non-negative random long within a specified range. + + + + + Returns a random Byte + + + + + Returns a random Byte less than the specified maximum. + + + + + Returns a random Byte within a specified range + + + + + Returns a random SByte + + + + + Returns a random sbyte less than the specified maximum. + + + + + Returns a random sbyte within a specified range + + + + + Returns a random bool + + + + + Returns a random bool based on the probability a true result + + + + + Returns a random double between 0.0 and the specified maximum. + + + + + Returns a random double within a specified range. + + + + + Returns a random float. + + + + + Returns a random float between 0.0 and the specified maximum. + + + + + Returns a random float within a specified range. + + + + + Returns a random enum value of the specified Type as an object. + + + + + Returns a random enum value of the specified Type. + + + + + Default characters for random functions. + + Default characters are the English alphabet (uppercase & lowercase), Arabic numerals, and underscore + + + + Generate a random string based on the characters from the input string. + + desired length of output string. + string representing the set of characters from which to construct the resulting string + A random string of arbitrary length + + + + Generate a random string based on the characters from the input string. + + desired length of output string. + A random string of arbitrary length + Uses DefaultStringChars as the input character set + + + + Generate a random string based on the characters from the input string. + + A random string of the default length + Uses DefaultStringChars as the input character set + + + + Returns a random decimal. + + + + + Returns a random decimal between positive zero and the specified maximum. + + + + + Returns a random decimal within a specified range, which is not + permitted to exceed decimal.MaxVal in the current implementation. + + + A limitation of this implementation is that the range from min + to max must not exceed decimal.MaxVal. + + + + + Generates a valid version 4 . + + + + + Helper methods for inspecting a type by reflection. + + Many of these methods take ICustomAttributeProvider as an + argument to avoid duplication, even though certain attributes can + only appear on specific types of members, like MethodInfo or Type. + + In the case where a type is being examined for the presence of + an attribute, interface or named member, the Reflect methods + operate with the full name of the member being sought. This + removes the necessity of the caller having a reference to the + assembly that defines the item being sought and allows the + NUnit core to inspect assemblies that reference an older + version of the NUnit framework. + + + + + Examine a fixture type and return an array of methods having a + particular attribute. The array is order with base methods first. + + The type to examine + The attribute Type to look for + Specifies whether to search the fixture type inheritance chain + The array of methods found + + + + Examine a fixture type and return true if it has a method with + a particular attribute. + + The type to examine + The attribute Type to look for + True if found, otherwise false + + + + Invoke the default constructor on a Type + + The Type to be constructed + An instance of the Type + + + + Invoke a constructor on a Type with arguments + + The Type to be constructed + Arguments to the constructor + An instance of the Type + + + + Returns an array of types from an array of objects. + Differs from by returning + for null elements rather than throwing . + + + + + Gets the constructors to which the specified argument types can be coerced. + + + + + Determines if the given types can be coerced to match the given parameters. + + + + + Determines whether the current type can be implicitly converted to the specified type. + + + + + Invoke a parameterless method returning void on an object. + + A MethodInfo for the method to be invoked + The object on which to invoke the method + + + + Invoke a method, converting any TargetInvocationException to an NUnitException. + + A MethodInfo for the method to be invoked + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + + Selects the ultimate shadowing property just like would, + rather than throwing + for properties that shadow properties of a different property type + which is what does. + + + If you request both public and nonpublic properties, every public property is preferred + over every nonpublic property. It would violate the principle of least surprise for a + derived class’s implementation detail to be chosen over the public API for a type. + + + See . + See . + See . + + + + Represents the result of running a single test case. + + + + + Construct a TestCaseResult based on a TestMethod + + A TestMethod to which the result applies. + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + The TestResult class represents the result of a test. + + + + + Error message for when child tests have errors + + + + + Error message for when child tests have warnings + + + + + Error message for when child tests are ignored + + + + + The minimum duration for tests + + + + + Aggregate assertion count + + + + + ReaderWriterLock + + + + + Construct a test result given a Test + + The test to be used + + + + Gets the test with which this result is associated. + + + + + Gets the ResultState of the test result, which + indicates the success or failure of the test. + + + + + Gets the name of the test result + + + + + Gets the full name of the test result + + + + + Gets or sets the elapsed time for running the test in seconds + + + + + Gets or sets the time the test started running. + + + + + Gets or sets the time the test finished running. + + + + + Adds a test attachment to the test result + + The TestAttachment object to attach + + + + Gets the collection of files attached to the test + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + + Gets or sets the count of asserts executed + when running the test. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + Gets a TextWriter, which will write output to be included in the result. + + + + + Gets any text output written to this result. + + + + + Gets a list of assertion results associated with the test. + + + + + Returns the XML representation of the result. + + If true, descendant results are included + An XmlNode representing the result + + + + Adds the XML representation of the result as a child of the + supplied parent node.. + + The parent node. + If true, descendant results are included + + + + + Gets a count of pending failures (from Multiple Assert) + + + + + Gets the worst assertion status (highest enum) in all the assertion results + + + + + Set the result of the test + + The ResultState to use in the result + + + + Set the result of the test + + The ResultState to use in the result + A message associated with the result state + + + + Set the result of the test + + The ResultState to use in the result + A message associated with the result state + Stack trace giving the location of the command + + + + Set the test result based on the type of exception thrown + + The exception that was thrown + + + + Set the test result based on the type of exception thrown + + The exception that was thrown + The FailureSite to use in the result + + + + RecordTearDownException appends the message and stack trace + from an exception arising during teardown of the test + to any previously recorded information, so that any + earlier failure information is not lost. Note that + calling Assert.Ignore, Assert.Inconclusive, etc. during + teardown is treated as an error. If the current result + represents a suite, it may show a teardown error even + though all contained tests passed. + + The Exception to be recorded + + + + Update overall test result, including legacy Message, based + on AssertionResults that have been saved to this point. + + + + + Record an assertion result + + + + + Record an assertion result + + + + + Record an assertion result + + + + + Creates a failure message incorporating failures + from a Multiple Assert block for use by runners + that don't know about AssertionResults. + + Message as a string + + + + Adds a reason element to a node and returns it. + + The target node. + The new reason element. + + + + Adds a failure element to a node and returns it. + + The target node. + The new failure element. + + + + Adds an attachments element to a node and returns it. + + The target node. + The new attachments element. + + + + Represents the result of running a test suite + + + + + Construct a TestSuiteResult base on a TestSuite + + The TestSuite to which the result applies + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + Adds a child result to this result, setting this result's + ResultState to Failure if the child result failed. + + The result to be added + + + + Enumeration identifying a common language + runtime implementation. + + + + Any supported runtime framework + + + Microsoft .NET Framework + + + Microsoft Shared Source CLI + + + Mono + + + MonoTouch + + + Microsoft .NET Core + + + + RuntimeFramework represents a particular version + of a common language runtime implementation. + + + + + DefaultVersion is an empty Version, used to indicate that + NUnit should select the CLR version to use for the test. + + + + + Construct from a runtime type and version. If the version has + two parts, it is taken as a framework version. If it has three + or more, it is taken as a CLR version. In either case, the other + version is deduced based on the runtime type and provided version. + + The runtime type of the framework + The version of the framework + + + + Static method to return a RuntimeFramework object + for the framework that is currently in use. + + + + + The type of this runtime framework + + + + + The framework version for this runtime framework + + + + + The CLR version for this runtime framework + + + + + Return true if any CLR version may be used in + matching this RuntimeFramework object. + + + + + Returns the Display name for this framework + + + + + Parses a string representing a RuntimeFramework. + The string may be just a RuntimeType name or just + a Version or a hyphenated RuntimeType-Version or + a Version prefixed by 'versionString'. + + + + + + + Overridden to return the short name of the framework + + + + + + Returns true if the current framework matches the + one supplied as an argument. Two frameworks match + if their runtime types are the same or either one + is RuntimeType.Any and all specified version components + are equal. Negative (i.e. unspecified) version + components are ignored. + + The RuntimeFramework to be matched. + True on match, otherwise false + + + + Holds thread state which is captured and restored in order to sandbox user code. + + + + + Captures a snapshot of the tracked state of the current thread to be restored later. + + + + + Restores the tracked state of the current thread to the previously captured state. + + + + + Returns a copy with the specified culture. + + + + + Returns a copy with the specified UI culture. + + + + + Returns a copy with the specified principal. + + + + + May be called from any thread. + + + + + May be called from any thread. + + + + + May be called from any thread. + + + + + May be called from any thread, but may only be called once. + + + + + StackFilter class is used to remove internal NUnit + entries from a stack trace so that the resulting + trace provides better information about the test. + + + + + Single instance of our default filter + + + + + Construct a stack filter instance + + Regex pattern used to delete lines from the top of the stack + Regex pattern used to delete lines from the bottom of the stack + + + + Construct a stack filter instance + + Regex pattern used to delete lines from the top of the stack + + + + Construct a stack filter instance + + + + + Filters a raw stack trace and returns the result. + + The original stack trace + A filtered stack trace + + + + Provides methods to support legacy string comparison methods. + + + + + Compares two strings for equality, ignoring case if requested. + + The first string. + The second string.. + if set to true, the case of the letters in the strings is ignored. + Zero if the strings are equivalent, a negative number if strA is sorted first, a positive number if + strB is sorted first + + + + Compares two strings for equality, ignoring case if requested. + + The first string. + The second string.. + if set to true, the case of the letters in the strings is ignored. + True if the strings are equivalent, false if not. + + + + The TestCaseParameters class encapsulates method arguments and + other selected parameters needed for constructing + a parameterized test case. + + + + + The expected result to be returned + + + + + Default Constructor creates an empty parameter set + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a ParameterSet from an object implementing ITestCaseData + + + + + + The expected result of the test, which + must match the method return type. + + + + + Gets a value indicating whether an expected result was specified. + + + + + TestCaseTimeoutException is thrown when a test running directly + on a TestWorker thread is cancelled due to timeout. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + Helper class used to save and restore certain static or + singleton settings in the environment that affect tests + or which might be changed by the user tests. + + + + + Link to a prior saved context + + + + + Indicates that a stop has been requested + + + + + The event listener currently receiving notifications + + + + + The number of assertions for the current test + + + + + The current test result + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + An existing instance of TestExecutionContext. + + + + Gets and sets the current context. + + + + + Gets or sets the current test + + + + + The time the current test started execution + + + + + The time the current test started in Ticks + + + + + Gets or sets the current test result + + + + + Gets a TextWriter that will send output to the current test result. + + + + + The current test object - that is the user fixture + object on which tests are being executed. + + + + + Get or set indicator that run should stop on the first error + + + + + Gets an enum indicating whether a stop has been requested. + + + + + The current test event listener + + + + + The current WorkItemDispatcher. Made public for + use by nunitlite.tests + + + + + The ParallelScope to be used by tests running in this context. + For builds with out the parallel feature, it has no effect. + + + + + Default tolerance value used for floating point equality + when no other tolerance is specified. + + + + + The worker that spawned the context. + For builds without the parallel feature, it is null. + + + + + Gets the RandomGenerator specific to this Test + + + + + Gets the assert count. + + The assert count. + + + + The current nesting level of multiple assert blocks + + + + + Gets or sets the test case timeout value + + + + + Gets a list of ITestActions set by upstream tests + + + + + Saves or restores the CurrentCulture + + + + + Saves or restores the CurrentUICulture + + + + + Gets or sets the current for the Thread. + + + + + The current head of the ValueFormatter chain, copied from MsgUtils.ValueFormatter + + + + + If true, all tests must run on the same thread. No new thread may be spawned. + + + + + The number of times the current test has been scheduled for execution. + Currently only being executed in a test using the + + + + + Record any changes in the environment made by + the test code in the execution context so it + will be passed on to lower level tests. + + + + + Set up the execution environment to match a context. + Note that we may be running on the same thread where the + context was initially created or on a different thread. + + + + + Increments the assert count by one. + + + + + Increments the assert count by a specified amount. + + + + + Adds a new ValueFormatterFactory to the chain of formatters + + The new factory + + + + Sends a message from test to listeners. This message is not kind of test output and doesn't go to test result. + + A name recognized by the intended listeners. + A message to be sent + + + + Obtain lifetime service object + + + + + + An IsolatedContext is used when running code + that may effect the current result in ways that + should not impact the final result of the test. + A new TestExecutionContext is created with an + initially clear result, which is discarded on + exiting the context. + + + using (new TestExecutionContext.IsolatedContext()) + { + // Code that should not impact the result + } + + + + + Save the original current TestExecutionContext and + make a new isolated context current. + + + + + Restore the original TestExecutionContext. + + + + + An AdhocTestExecutionContext is created whenever a context is needed + but not available in CurrentContext. This happens when tests are run + on an ad-hoc basis or Asserts are used outside of tests. + + + + + Construct an AdhocTestExecutionContext, which is used + whenever the current TestExecutionContext is found to be null. + + + + + Enumeration indicating whether the tests are + running normally or being cancelled. + + + + + Running normally with no stop requested + + + + + A graceful stop has been requested + + + + + A forced stop has been requested + + + + + Interface to be implemented by filters applied to tests. + The filter applies when running the test, after it has been + loaded, since this is the only time an ITest exists. + + + + + Unique Empty filter. + + + + + Indicates whether this is the EmptyFilter + + + + + Indicates whether this is a top-level filter, + not contained in any other filter. + + + + + Determine if a particular test passes the filter criteria. The default + implementation checks the test itself, its parents and any descendants. + + Derived classes may override this method or any of the Match methods + to change the behavior of the filter. + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + Determine whether the test itself matches the filter criteria, without + examining either parents or descendants. This is overridden by each + different type of filter to perform the necessary tests. + + The test to which the filter is applied + True if the filter matches the any parent of the test + + + + Determine whether any ancestor of the test matches the filter criteria + + The test to which the filter is applied + True if the filter matches the an ancestor of the test + + + + Determine whether any descendant of the test matches the filter criteria. + + The test to be matched + True if at least one descendant matches the filter criteria + + + + Create a TestFilter instance from an XML representation. + + + + + Create a TestFilter from its TNode representation + + + + + Nested class provides an empty filter - one that always + returns true when called. It never matches explicitly. + + + + + Adds an XML node + + True if recursive + The added XML node + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + The TestCaseParameters class encapsulates method arguments and + other selected parameters needed for constructing + a parameterized test case. + + + + + Default Constructor creates an empty parameter set + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a ParameterSet from an object implementing ITestCaseData + + + + + + Type arguments used to create a generic fixture instance + + + + + TestListener provides an implementation of ITestListener that + does nothing. It is used only through its NULL property. + + + + + Called when a test has just started + + The test that is starting + + + + Called when a test case has finished + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the message to send + + + + Construct a new TestListener - private so it may not be used. + + + + + Get a listener that does nothing + + + + + TestNameGenerator is able to create test names according to + a coded pattern. + + + + + Default pattern used to generate names + + + + + Construct a TestNameGenerator + + + + + Construct a TestNameGenerator + + The pattern used by this generator. + + + + Get the display name for a TestMethod and its arguments + + A TestMethod + The display name + + + + Get the display name for a TestMethod and its arguments + + A TestMethod + Arguments to be used + The display name + + + + TestParameters is the abstract base class for all classes + that know how to provide data for constructing a test. + + + + + Default Constructor creates an empty parameter set + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a ParameterSet from an object implementing ITestData + + + + + + The RunState for this set of parameters. + + + + + The arguments to be used in running the test, + which must match the method signature. + + + + + A name to be used for this test case in lieu + of the standard generated name containing + the argument list. + + + + + Gets the property dictionary for this test + + + + + Applies ParameterSet values to the test itself. + + A test. + + + + The original arguments provided by the user, + used for display purposes. + + + + + The list of display names to use as the parameters in the test name. + + + + + TestProgressReporter translates ITestListener events into + the async callbacks that are used to inform the client + software about the progress of a test run. + + + + + Initializes a new instance of the class. + + The callback handler to be used for reporting progress. + + + + Called when a test has just started + + The test that is starting + + + + Called when a test has finished. Sends a result summary to the callback. + to + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + Returns the parent test item for the target test item if it exists + + + parent test item + + + + Makes a string safe for use as an attribute, replacing + characters that can't be used with their + corresponding XML representations. + + The string to be used + A new string with the values replaced + + + + ParameterizedFixtureSuite serves as a container for the set of test + fixtures created from a given Type using various parameters. + + + + + Initializes a new instance of the class. + + The ITypeInfo for the type that represents the suite. + + + + Gets a string representing the type of test + + + + + ParameterizedMethodSuite holds a collection of individual + TestMethods with their arguments applied. + + + + + Initializes a new instance of the class. + + + + + Gets a string representing the type of test + + + + + SetUpFixture extends TestSuite and supports + Setup and TearDown methods. + + + + + Initializes a new instance of the class. + + + + + The Test abstract class represents a test within the framework. + + + + + Static value to seed ids. It's started at 1000 so any + uninitialized ids will stand out. + + + + + Used to cache the declaring type for this MethodInfo + + + + + Method property backing field + + + + + Constructs a test given its name + + The name of the test + + + + Constructs a test given the path through the + test hierarchy to its parent and a name. + + The parent tests full name + The name of the test + + + + Constructs a test for a specific type. + + + + + Constructs a test for a specific method. + + + + + Gets or sets the id of the test + + + + + + Gets or sets the name of the test + + + + + Gets or sets the fully qualified name of the test + + + + + + Gets the name of the class where this test was declared. + Returns null if the test is not associated with a class. + + + + + Gets the name of the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + The arguments to use in creating the test or empty array if none required. + + + + + Gets the TypeInfo of the fixture used in running this test + or null if no fixture type is associated with it. + + + + + Gets a MethodInfo for the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + Whether or not the test should be run + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Gets a string representing the type of test. Used as an attribute + value in the XML representation of a test and has no other + function in the framework. + + + + + Gets a count of test cases represented by + or contained under this test. + + + + + Gets the properties for this test + + + + + Returns true if this is a TestSuite + + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets the parent as a Test object. + Used by the core to set the parent. + + + + + Gets this test's child tests + + A list of child tests + + + + Gets or sets a fixture object for running this test. + + + + + Static prefix used for ids in this AppDomain. + Set by FrameworkController. + + + + + Gets or Sets the Int value representing the seed for the RandomGenerator + + + + + + The SetUp methods. + + + + + The teardown methods + + + + + Creates a TestResult for this test. + + A TestResult suitable for this type of test. + + + + Modify a newly constructed test by applying any of NUnit's common + attributes, based on a supplied , which is + usually the reflection element from which the test was constructed, + but may not be in some instances. The attributes retrieved are + saved for use in subsequent operations. + + + + + Mark the test as Invalid (not runnable) specifying a reason + + The reason the test is not runnable + + + + Get custom attributes applied to a test + + + + + Add standard attributes and members to a test node. + + + + + + + Returns the XML representation of the test + + If true, include child tests recursively + + + + + Returns an XmlNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Compares this test to another test for sorting purposes + + The other test + Value of -1, 0 or +1 depending on whether the current test is less than, equal to or greater than the other test + + + + TestAssembly is a TestSuite that represents the execution + of tests in a managed assembly. + + + + + Initializes a new instance of the class + specifying the Assembly and the suite name. + + The assembly this test represents. + The desired name for the test suite. + + + + Initializes a new instance of the class + specifying the suite name for an assembly that could not be loaded. + + The desired name for the test suite. + + + + Copy-constructor style to create a filtered copy of the test assemblies + test cases + + + + + + + Gets the Assembly represented by this instance. + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Get custom attributes specified on the assembly + + + + + TestFixture is a surrogate for a user test fixture class, + containing one or more tests. + + + + + Initializes a new instance of the class. + + Type of the fixture. + Arguments used to instantiate the test fixture, or null if none used + + + + The TestMethod class represents a Test implemented as a method. + + + + + The ParameterSet used to create this test method + + + + + Initializes a new instance of the class. + + The method to be used as a test. + + + + Initializes a new instance of the class. + + The method to be used as a test. + The suite or fixture to which the new test will be added + + + + The arguments to use in executing the test method, or empty array if none are provided. + + + + + Overridden to return a TestCaseResult. + + A TestResult for this test. + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Returns a TNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Gets this test's child tests + + A list of child tests + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Returns the name of the method + + + + + TestSuite represents a composite test, which contains other tests. + + + + + Our collection of child tests + + + + + Initializes a new instance of the class. + + The name of the suite. + + + + Initializes a new instance of the class. + + Name of the parent suite. + The name of the suite. + + + + Initializes a new instance of the class. + + Type of the fixture. + Arguments used to instantiate the test fixture, or null if none used. + + + + Initializes a new instance of the class. + + Type of the fixture. + + + + Copy constructor style to create a filtered copy of the given test suite + + Test Suite to copy + Filter to be applied + + + + Sorts tests under this suite. + + + + + Adds a test to the suite. + + The test. + + + + Gets this test's child tests + + The list of child tests + + + + Gets a count of test cases represented by + or contained under this test. + + + + + + The arguments to use in creating the fixture, or empty array if none are provided. + + + + + Set to true to suppress sorting this suite's contents + + + + + OneTimeSetUp methods for this suite + + + + + OneTimeTearDown methods for this suite + + + + + Overridden to return a TestSuiteResult. + + A TestResult for this test. + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Returns an XmlNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Check that setup and teardown methods marked by certain attributes + meet NUnit's requirements and mark the tests not runnable otherwise. + + A list of methodinfos to check + + + + ThreadUtility provides a set of static methods convenient + for working with threads. + + + + + Pre-Task compatibility + + + + + Abort a thread, helping to dislodging it if it is blocked in native code + + The thread to abort + The native thread id (if known), otherwise 0. + If provided, allows the thread to be killed if it's in a message pump native blocking wait. + This must have previously been captured by calling from the running thread itself. + + + + Do our best to kill a thread + + The thread to kill + The native thread id (if known), otherwise 0. + If provided, allows the thread to be killed if it's in a message pump native blocking wait. + This must have previously been captured by calling from the running thread itself. + + + + Do our best to kill a thread, passing state info + + The thread to kill + Info for the ThreadAbortException handler + The native thread id (if known), otherwise 0. + If provided, allows the thread to be killed if it's in a message pump native blocking wait. + This must have previously been captured by calling from the running thread itself. + + + + Schedule a threadpool thread to check on the aborting thread in case it's in a message pump native blocking wait + + + + + Captures the current thread's native id. If provided to later, allows the thread to be killed if it's in a message pump native blocking wait. + + + + + Sends a message to the thread to dislodge it from native code and allow a return to managed code, where a ThreadAbortException can be generated. + The message is meaningless (WM_CLOSE without a window handle) but it will end any blocking message wait. + + + + + TypeHelper provides static methods that operate on Types. + + + + + Gets the display name for a Type as used by NUnit. + + The Type for which a display name is needed. + The display name for the Type + + + + Gets the display name for a Type as used by NUnit. + + The Type for which a display name is needed. + The arglist provided. + The display name for the Type + + + + Returns the best fit for a common type to be used in + matching actual arguments to a methods Type parameters. + + + + + Determines whether the specified type is numeric. + + The type to be examined. + + true if the specified type is numeric; otherwise, false. + + + + + Convert an argument list to the required parameter types. + Currently, only widening numeric conversions are performed. + + An array of args to be converted + A ParameterInfo[] whose types will be used as targets + + + + Determines whether this instance can deduce type args for a generic type from the supplied arguments. + + The type to be examined. + The arglist. + The type args to be used. + + true if this the provided args give sufficient information to determine the type args to be used; otherwise, false. + + + + + Return the interfaces implemented by a Type. + + The Type to be examined. + An array of Types for the interfaces. + + + + Return whether or not the given type is a ValueTuple. + + Type. + Whether or not the given type is a ValueTuple. + + + + Return whether or not the given type is a Tuple. + + Type. + Whether or not the given type is a Tuple. + + + + Determines whether the cast to the given type would succeed. + If is and + can be , the cast succeeds just like the C# language feature. + + The object to cast. + + + + Casts to a value of the given type if possible. + If is and + can be , the cast succeeds just like the C# language feature. + + The object to cast. + The value of the object, if the cast succeeded. + + + + Used for resolving the type difference between objects. + + + + + Gets the shortened type name difference between and . + + The expected object. + The actual object. + Output of the unique type name for the expected object. + Output of the unique type name for actual object. + + + + Gets the shortened type name difference between and . + + The expected object . + The actual object . + Output of the unique type name for the expected object. + Output of the unique type name for actual object. + + + + Obtain the shortened generic template parameters of the given and , + if they are generic. + + The expected . + The actual . + Shortened generic parameters of the expected . + Shortened generic parameters of the actual . + + + + Obtain a shortened name of the given . + + + + + Shorten the given names by only including the relevant differing namespaces/types, if they differ. + + The expected . + The actual . + The shortened expected name. + The shortened actual name. + + + + Returns whether or not the is generic. + + + + + Returns the fully qualified generic name of a given . + + + + + Reconstruct a generic type name using the provided generic type name, and a + of the template parameters. + + The name of the generic type, including the number of template parameters expected. + A of names of the template parameters of the provided generic type. + + + + Obtain the shortened generic names of the given expected and actual s. + + The expected . + The actual . + The shortened expected generic name. + The shortened actual generic name. + + + + The TypeWrapper class wraps a Type so it may be used in + a platform-independent manner. + + + + + Construct a TypeWrapper for a specified Type. + + + + + Gets the underlying Type on which this TypeWrapper is based. + + + + + Gets the base type of this type as an ITypeInfo + + + + + Gets the Name of the Type + + + + + Gets the FullName of the Type + + + + + Gets the assembly in which the type is declared + + + + + Gets the namespace of the Type + + + + + Gets a value indicating whether the type is abstract. + + + + + Gets a value indicating whether the Type is a generic Type + + + + + Returns true if the Type wrapped is T + + + + + Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types. + + + + + Gets a value indicating whether the Type is a generic Type definition + + + + + Gets a value indicating whether the type is sealed. + + + + + Gets a value indicating whether this type represents a static class. + + + + + Get the display name for this type + + + + + Get the display name for an object of this type, constructed with the specified args. + + + + + Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments + + + + + Returns a Type representing a generic type definition from which this Type can be constructed. + + + + + Returns an array of custom attributes of the specified type applied to this type + + + + + Returns a value indicating whether the type has an attribute of the specified type. + + + + + + + + Returns a flag indicating whether this type has a method with an attribute of the specified type. + + + + + + + Returns an array of IMethodInfos for methods of this Type + that match the specified flags. + + + + + Gets the public constructor taking the specified argument Types + + + + + Returns a value indicating whether this Type has a public constructor taking the specified argument Types. + + + + + Construct an object of this Type, using the specified arguments. + + + + + Override ToString() so that error messages in NUnit's own tests make sense + + + + + Encapsulates the ability to increment a value by an amount which may be of a different type. + + + + + Creates a from the specified value if the current instance is able to + use it to increment the on values which it operates. If the creation fails, + is thrown. + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values on which it operates. A return value indicates + whether the creation succeeded. + + + + + Provides a convenient shorthand when is + and the default value of represents zero. + + + + + Initializes a new instance of the class. + + The amount by which to increment each time this step is applied. + + Must increment the given value and return the result. + If the result is outside the range representable by , + must throw . If the result does not change due to lack + of precision representable by , must throw . + + + + + Increments the given value and returns the result. + If the result is outside the range representable by , + throws . If the result does not change due to lack + of precision representable by , throws . + + + + + + + Encapsulates the ability to increment a value by an amount + which may be of a different type. + + + + + Increments the given value and returns the result. + If the result is outside the range representable by , + throws . If the result does not change due to lack + of precision representable by , throws . + + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values of type . If the creation fails, + is thrown. + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values of type . A return value indicates + whether the creation succeeded. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + 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 equality with zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 to the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable to 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + 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 a subpath of the 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 + inclusively within a specified range. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + + Returns a constraint that tests if an item is equal to any of parameters + + Expected values + + + + When implemented by an attribute, this interface implemented to provide actions to execute before and after tests. + + + + + Executed before each test is run + + The test that is going to be run. + + + + Executed after each test is run + + The test that has just been run. + + + + Provides the target for the action attribute + + The target for the action attribute + + + + 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 + + + + + Basic Asserts on strings. + + + + + DO NOT USE! Use StringAssert.AreEqualIgnoringCase(...) or Assert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 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 + + + + 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 TestCaseData class represents a set of arguments + and other parameter info to be used for a parameterized + test case. It is derived from TestCaseParameters and adds a + fluent syntax for use in initializing the 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 name of the test case + + The modified TestCaseData instance + + + + Sets the list of display names to use as the parameters in the test name. + + + + + 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 + + + + + + + + Marks the test case as explicit. + + + + + Marks the test case as explicit, specifying the reason. + + + + + Ignores this TestCase, specifying the reason. + + The reason. + + + + + Provide the context information of the current test. + This is an adapter for the internal ExecutionContext + class, hiding the internals from the user test. + + + + + Construct a TestContext for an ExecutionContext + + The ExecutionContext to adapt + + + + 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 TextWriter that will send output to the current test result. + + + + + Gets a TextWriter that will send output directly to Console.Error + + + + + Gets a TextWriter for use in displaying immediate progress messages + + + + + TestParameters object holds parameters for the test run, if any are specified + + + + + Static DefaultWorkDirectory is now used as the source + of the public instance property WorkDirectory. This is + a bit odd but necessary to avoid breaking user tests. + + + + + Get a representation of the current test. + + + + + Gets a Representation of the TestResult for the current test. + + + + + Gets the unique name of the Worker that is executing this test. + + + + + Gets the directory containing the current test assembly. + + + + + Gets the directory to be used for outputting files created + by this test run. + + + + + Gets the random generator. + + + The random generator. + + + + + Gets the number of assertions executed + up to this point in the test. + + + + + Get the number of times the current Test has been repeated. This is currently only + set when using the . + TODO: add this to the RepeatAttribute as well + + + + Write the string representation of a boolean value to the current result + + + Write a char to the current result + + + Write a char array to the current result + + + Write the string representation of a double to the current result + + + Write the string representation of an Int32 value to the current result + + + Write the string representation of an Int64 value to the current result + + + Write the string representation of a decimal value to the current result + + + Write the string representation of an object to the current result + + + Write the string representation of a Single value to the current result + + + Write a string to the current result + + + Write the string representation of a UInt32 value to the current result + + + Write the string representation of a UInt64 value to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a line terminator to the current result + + + Write the string representation of a boolean value to the current result followed by a line terminator + + + Write a char to the current result followed by a line terminator + + + Write a char array to the current result followed by a line terminator + + + Write the string representation of a double to the current result followed by a line terminator + + + Write the string representation of an Int32 value to the current result followed by a line terminator + + + Write the string representation of an Int64 value to the current result followed by a line terminator + + + Write the string representation of a decimal value to the current result followed by a line terminator + + + Write the string representation of an object to the current result followed by a line terminator + + + Write the string representation of a Single value to the current result followed by a line terminator + + + Write a string to the current result followed by a line terminator + + + Write the string representation of a UInt32 value to the current result followed by a line terminator + + + Write the string representation of a UInt64 value to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + + This method adds the a new ValueFormatterFactory to the + chain of responsibility used for formatting values in messages. + The scope of the change is the current TestContext. + + The factory delegate + + + + Attach a file to the current test result + + Relative or absolute file path to attachment + Optional description of attachment + + + + This method provides a simplified way to add a ValueFormatter + delegate to the chain of responsibility, creating the factory + delegate internally. It is useful when the Type of the object + is the only criterion for selection of the formatter, since + it can be used without getting involved with a compound function. + + The type supported by this formatter + The ValueFormatter delegate + + + + TestAdapter adapts a Test for consumption by + the user test code. + + + + + Construct a TestAdapter for a Test + + The Test to be adapted + + + + Gets the unique Id of a test + + + + + The name of the test, which may or may not be + the same as the method name. + + + + + The name of the method representing the test. + + + + + The FullName of the test + + + + + The ClassName of the test + + + + + A shallow copy of the properties of the test. + + + + + The arguments to use in creating the test or empty array if none are required. + + + + + ResultAdapter adapts a TestResult for consumption by + the user test code. + + + + + Construct a ResultAdapter for a TestResult + + The TestResult to be adapted + + + + Gets a ResultState representing the outcome of the test + up to this point in its execution. + + + + + Gets a list of the assertion results generated + up to this point in the test. + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + adapts an + for consumption by the user. + + + + + Construct a from a source + . + + + + + Get the first property with the given , if it can be found, otherwise + returns null. + + + + + Indicates whether is found in this + . + + + + + Returns a collection of properties + with the given . + + + + + Returns the count of elements with the given . + + + + + Returns a collection of the property keys. + + + + + The TestFixtureData class represents a set of arguments + and other parameter info to be used for a parameterized + fixture. It is derived from TestFixtureParameters and adds a + fluent syntax for use in initializing the fixture. + + + + + 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 name of the test fixture + + The modified TestFixtureData instance + + + + Sets the list of display names to use as the parameters in the test name. + + + + + Marks the test fixture as explicit. + + + + + Marks the test fixture as explicit, specifying the reason. + + + + + Ignores this TestFixture, specifying the reason. + + The reason. + + + + + TestParameters class holds any named parameters supplied to the test run + + + + + Gets the number of test parameters + + + + + Gets a collection of the test parameter names + + + + + Gets a flag indicating whether a parameter with the specified name exists. + + Name of the parameter + True if it exists, otherwise false + + + + Indexer provides access to the internal dictionary + + Name of the parameter + Value of the parameter or null if not present + + + + Get method is a simple alternative to the indexer + + Name of the parameter + Value of the parameter or null if not present + + + + Get the value of a parameter or a default string + + Name of the parameter + Default value of the parameter + Value of the parameter or default value if not present + + + + Get the value of a parameter or return a default + + The return Type + Name of the parameter + Default value of the parameter + Value of the parameter or default value if not present + + + + Adds a parameter to the list + + Name of the parameter + Value of the parameter + + + + Helper class with properties and methods that supply + constraints that operate on exceptions. + + + + + 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 ArgumentException + + + + + Creates a constraint specifying an expected ArgumentNullException + + + + + Creates a constraint specifying an expected InvalidOperationException + + + + + Creates a constraint specifying that no exception is thrown + + + + + 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 + + + + + Provides static methods to express conditions + that must be met for the test to succeed. If + any test fails, a warning is issued. + + + + + DO NOT USE! + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + Not applicable + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + 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 a warning is issued. + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning on success. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning on success. + + The Type being compared. + 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 an actual value, succeeding if the constraint + fails and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + 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 a warning is issued. + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + The message to display if the condition is true + Arguments to be used in formatting the message + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning if it succeeds. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning if it succeeds. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + FrameworkPackageSettings is a static class containing constant values that + are used as keys in setting up a TestPackage. These values are used in + the framework, and set in the runner. Setting values may be a string, int or bool. + + + + + Flag (bool) indicating whether tests are being debugged. + + + + + Flag (bool) indicating whether to pause execution of tests to allow + the user to attach a debugger. + + + + + The InternalTraceLevel for this run. Values are: "Default", + "Off", "Error", "Warning", "Info", "Debug", "Verbose". + Default is "Off". "Debug" and "Verbose" are synonyms. + + + + + Full path of the directory to be used for work and result files. + This path is provided to tests by the framework TestContext. + + + + + Integer value in milliseconds for the default timeout value + for test cases. If not specified, there is no timeout except + as specified by attributes on the tests themselves. + + + + + A TextWriter to which the internal trace will be sent. + + + + + A list of tests to be loaded. + + + + + The number of test threads to run for the assembly. If set to + 1, a single queue is used. If set to 0, tests are executed + directly, without queuing. + + + + + The random seed to be used for this assembly. If specified + as the value reported from a prior run, the framework should + generate identical random values for tests as were used for + that run, provided that no change has been made to the test + assembly. Default is a random value itself. + + + + + If true, execution stops after the first error or failure. + + + + + If true, use of the event queue is suppressed and test events are synchronous. + + + + + The default naming pattern used in generating test names + + + + + Parameters to be passed on to the tests, serialized to a single string which needs parsing. Obsoleted by ; kept for backward compatibility. + + + + + Parameters to be passed on to the tests, already parsed into an IDictionary<string, string>. Replaces . + + + + + If true, the tests will run on the same thread as the NUnit runner itself + + + + + Provides a platform-independent methods for getting attributes + for use by AttributeConstraint and AttributeExistsConstraint. + + + + + Gets the custom attributes from the given object. + + The actual. + Type of the attribute. + if set to true [inherit]. + A list of the given attribute on the given object. + + + + A MarshalByRefObject that lives forever + + + + + Obtains a lifetime service object to control the lifetime policy for this instance. + + + + + Provides NUnit specific extensions to aid in Reflection + across multiple frameworks + + + This version of the class supplies GetTypeInfo() on platforms + that don't support it. + + + + + GetTypeInfo gives access to most of the Type information we take for granted + on .NET Core and Windows Runtime. Rather than #ifdef different code for different + platforms, it is easiest to just code all platforms as if they worked this way, + thus the simple passthrough. + + + + + + + See . + + + + + Extensions for Assembly that are not available in pre-4.5 .NET releases + + + + + An easy way to get a single custom attribute from an assembly + + The attribute Type + The assembly + An attribute of Type T + + + + Extensions for MethodInfo that are not available in pre-4.5 .NET releases + + + + + See . + + + + diff --git a/packages/NUnit.3.11.0/lib/net45/nunit.framework.dll b/packages/NUnit.3.11.0/lib/net45/nunit.framework.dll new file mode 100644 index 0000000000000000000000000000000000000000..67928cc96a761736bb47a27c8a7ea73b584b4040 Binary files /dev/null and b/packages/NUnit.3.11.0/lib/net45/nunit.framework.dll differ diff --git a/packages/NUnit.3.11.0/lib/net45/nunit.framework.pdb b/packages/NUnit.3.11.0/lib/net45/nunit.framework.pdb new file mode 100644 index 0000000000000000000000000000000000000000..45461cc2387e30c3f9c0f00839f452fb961e9a18 Binary files /dev/null and b/packages/NUnit.3.11.0/lib/net45/nunit.framework.pdb differ diff --git a/packages/NUnit.3.11.0/lib/net45/nunit.framework.xml b/packages/NUnit.3.11.0/lib/net45/nunit.framework.xml new file mode 100644 index 0000000000000000000000000000000000000000..656f60095e73aa1d3f4eeefb0ea736efe3c7d938 --- /dev/null +++ b/packages/NUnit.3.11.0/lib/net45/nunit.framework.xml @@ -0,0 +1,20518 @@ + + + + nunit.framework + + + + + 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 + + + + + DefaultTestAssemblyBuilder loads a single assembly and builds a TestSuite + containing test fixtures present in the assembly. + + + + + The default suite builder used by the test assembly builder. + + + + + Initializes a new instance of the class. + + + + + Build a suite of tests from a provided assembly + + The assembly from which tests are to be built + A dictionary of options to use in building the suite + + A TestSuite containing the tests found in the assembly + + + + + Build a suite of tests given the name or the location of an assembly + + The name or the location of the assembly. + A dictionary of options to use in building the suite + + A TestSuite containing the tests found in the assembly + + + + + FrameworkController provides a facade for use in loading, browsing + and running tests without requiring a reference to the NUnit + framework. All calls are encapsulated in constructors for + this class and its nested classes, which only require the + types of the Common Type System as arguments. + + The controller supports four actions: Load, Explore, Count and Run. + They are intended to be called by a driver, which should allow for + proper sequencing of calls. Load must be called before any of the + other actions. The driver may support other actions, such as + reload on run, by combining these calls. + + + + + Construct a FrameworkController using the default builder and runner. + + The AssemblyName or path to the test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + + + + Construct a FrameworkController using the default builder and runner. + + The test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + + + + Construct a FrameworkController, specifying the types to be used + for the runner and builder. This constructor is provided for + purposes of development. + + The full AssemblyName or the path to the test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + The Type of the test runner + The Type of the test builder + + + + Construct a FrameworkController, specifying the types to be used + for the runner and builder. This constructor is provided for + purposes of development. + + The test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + The Type of the test runner + The Type of the test builder + + + + Gets the ITestAssemblyBuilder used by this controller instance. + + The builder. + + + + Gets the ITestAssemblyRunner used by this controller instance. + + The runner. + + + + Gets the AssemblyName or the path for which this FrameworkController was created + + + + + Gets the Assembly for which this + + + + + Gets a dictionary of settings for the FrameworkController + + + + + Loads the tests in the assembly + + + + + + Returns info about the tests in an assembly + + A string containing the XML representation of the filter to use + The XML result of exploring the tests + + + + Runs the tests in an assembly + + A string containing the XML representation of the filter to use + The XML result of the test run + + + + Runs the tests in an assembly synchronously reporting back the test results through the callback + or through the return value + + The callback that receives the test results + A string containing the XML representation of the filter to use + The XML result of the test run + + + + Runs the tests in an assembly asynchronously reporting back the test results through the callback + + The callback that receives the test results + A string containing the XML representation of the filter to use + + + + Stops the test run + + True to force the stop, false for a cooperative stop + + + + Counts the number of test cases in the loaded TestSuite + + A string containing the XML representation of the filter to use + The number of tests + + + + Inserts environment element + + Target node + The new node + + + + Inserts settings element + + Target node + Settings dictionary + The new node + + + + FrameworkControllerAction is the base class for all actions + performed against a FrameworkController. + + + + + LoadTestsAction loads a test into the FrameworkController + + + + + LoadTestsAction loads the tests in an assembly. + + The controller. + The callback handler. + + + + ExploreTestsAction returns info about the tests in an assembly + + + + + Initializes a new instance of the class. + + The controller for which this action is being performed. + Filter used to control which tests are included (NYI) + The callback handler. + + + + CountTestsAction counts the number of test cases in the loaded TestSuite + held by the FrameworkController. + + + + + Construct a CountsTestAction and perform the count of test cases. + + A FrameworkController holding the TestSuite whose cases are to be counted + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + RunTestsAction runs the loaded TestSuite held by the FrameworkController. + + + + + Construct a RunTestsAction and run all tests in the loaded TestSuite. + + A FrameworkController holding the TestSuite to run + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + RunAsyncAction initiates an asynchronous test run, returning immediately + + + + + Construct a RunAsyncAction and run all tests in the loaded TestSuite. + + A FrameworkController holding the TestSuite to run + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + StopRunAction stops an ongoing run. + + + + + Construct a StopRunAction and stop any ongoing run. If no + run is in process, no error is raised. + + The FrameworkController for which a run is to be stopped. + True the stop should be forced, false for a cooperative stop. + >A callback handler used to report results + A forced stop will cause threads and processes to be killed as needed. + + + + The ITestAssemblyBuilder interface is implemented by a class + that is able to build a suite of tests given an assembly or + an assembly filename. + + + + + Build a suite of tests from a provided assembly + + The assembly from which tests are to be built + A dictionary of options to use in building the suite + A TestSuite containing the tests found in the assembly + + + + Build a suite of tests given the filename of an assembly + + The filename of the assembly from which tests are to be built + A dictionary of options to use in building the suite + A TestSuite containing the tests found in the assembly + + + + The ITestAssemblyRunner interface is implemented by classes + that are able to execute a suite of tests loaded + from an assembly. + + + + + Gets the tree of loaded tests, or null if + no tests have been loaded. + + + + + Gets the tree of test results, if the test + run is completed, otherwise null. + + + + + Indicates whether a test has been loaded + + + + + Indicates whether a test is currently running + + + + + Indicates whether a test run is complete + + + + + Loads the tests found in an Assembly, returning an + indication of whether or not the load succeeded. + + File name of the assembly to load + Dictionary of options to use in loading the test + An ITest representing the loaded tests + + + + Loads the tests found in an Assembly, returning an + indication of whether or not the load succeeded. + + The assembly to load + Dictionary of options to use in loading the test + An ITest representing the loaded tests + + + + Count Test Cases using a filter + + The filter to apply + The number of test cases found + + + + Explore the test cases using a filter + + The filter to apply + Test Assembly with test cases that matches the filter + + + + Run selected tests and return a test result. The test is run synchronously, + and the listener interface is notified as it progresses. + + Interface to receive ITestListener notifications. + A test filter used to select tests to be run + + + + Run selected tests asynchronously, notifying the listener interface as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + + + Wait for the ongoing run to complete. + + Time to wait in milliseconds + True if the run completed, otherwise false + + + + Signal any test run that is in process to stop. Return without error if no test is running. + + If true, kill any test-running threads + + + + Implementation of ITestAssemblyRunner + + + + + Initializes a new instance of the class. + + The builder. + + + + Gets the default level of parallel execution (worker threads) + + + + + The tree of tests that was loaded by the builder + + + + + The test result, if a run has completed + + + + + Indicates whether a test is loaded + + + + + Indicates whether a test is running + + + + + Indicates whether a test run is complete + + + + + Our settings, specified when loading the assembly + + + + + The top level WorkItem created for the assembly as a whole + + + + + The TestExecutionContext for the top level WorkItem + + + + + Loads the tests found in an Assembly + + File name or path of the assembly to load + Dictionary of option settings for loading the assembly + True if the load was successful + + + + Loads the tests found in an Assembly + + The assembly to load + Dictionary of option settings for loading the assembly + True if the load was successful + + + + Count Test Cases using a filter + + The filter to apply + The number of test cases found + + + + Explore the test cases using a filter + + The filter to apply + Test Assembly with test cases that matches the filter + + + + Run selected tests and return a test result. The test is run synchronously, + and the listener interface is notified as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + + + + Run selected tests asynchronously, notifying the listener interface as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + RunAsync is a template method, calling various abstract and + virtual methods to be overridden by derived classes. + + + + + Wait for the ongoing run to complete. + + Time to wait in milliseconds + True if the run completed, otherwise false + + + + Signal any test run that is in process to stop. Return without error if no test is running. + + If true, kill any tests that are currently running + + + + Initiate the test run. + + + + + Create the initial TestExecutionContext used to run tests + + The ITestListener specified in the RunAsync call + + + + Handle the Completed event for the top level work item + + + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + + + Verifies that the first int is greater than the second + int. 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 int is greater than the second + int. 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Verifies that the first value is greater than or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Asserts that an int is zero. + + The number to be examined + + + + Asserts that an int is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is zero. + + The number to be examined + + + + Asserts that an unsigned int is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is zero. + + The number to be examined + + + + Asserts that a Long is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is zero. + + The number to be examined + + + + Asserts that an unsigned Long is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is zero. + + The number to be examined + + + + Asserts that a decimal is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is zero. + + The number to be examined + + + + Asserts that a double is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is zero. + + The number to be examined + + + + Asserts that a float is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is not zero. + + The number to be examined + + + + Asserts that an int is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is not zero. + + The number to be examined + + + + Asserts that an unsigned int is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is not zero. + + The number to be examined + + + + Asserts that a Long is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is not zero. + + The number to be examined + + + + Asserts that an unsigned Long is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is zero. + + The number to be examined + + + + Asserts that a decimal is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is zero. + + The number to be examined + + + + Asserts that a double is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is zero. + + The number to be examined + + + + Asserts that a float is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is positive. + + The number to be examined + + + + Asserts that an int is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is positive. + + The number to be examined + + + + Asserts that an unsigned int is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is positive. + + The number to be examined + + + + Asserts that a Long is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is positive. + + The number to be examined + + + + Asserts that an unsigned Long is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is positive. + + The number to be examined + + + + Asserts that a decimal is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is positive. + + The number to be examined + + + + Asserts that a double is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is positive. + + The number to be examined + + + + Asserts that a float is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is negative. + + The number to be examined + + + + Asserts that an int is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is negative. + + The number to be examined + + + + Asserts that an unsigned int is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is negative. + + The number to be examined + + + + Asserts that a Long is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is negative. + + The number to be examined + + + + Asserts that an unsigned Long is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is negative. + + The number to be examined + + + + Asserts that a decimal is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is negative. + + The number to be examined + + + + Asserts that a double is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is negative. + + The number to be examined + + + + Asserts that a float is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + DO NOT USE! Use Assert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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. + + + + + Issues a warning using the message and arguments provided. + + The message to display. + Arguments to be used in formatting the message + + + + Issues a warning using the message provided. + + The message to display. + + + + 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. + + + + + Asserts that an object is contained in a collection. + + The expected object + The collection 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 collection. + + The expected object + The collection to be examined + + + + Wraps code containing a series of assertions, which should all + be executed, even if they fail. Failed results are saved and + reported at the end of the code block. + + A TestDelegate to be executed in Multiple Assertion mode. + + + + Wraps code containing a series of assertions, which should all + be executed, even if they fail. Failed results are saved and + reported at the end of the code block. + + A TestDelegate to be executed in Multiple Assertion mode. + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Verifies that an async 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 an async delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + + + + Verifies that an async delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that an async delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + + + + Verifies that an async delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that an async delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + + + + Verifies that an async 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 an async delegate throws an exception when called + and returns it. + + A TestDelegate + + + + Verifies that an async 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 an async 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 an async delegate throws an exception of a certain Type + or one derived from it 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 an async delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + A TestDelegate + + + + Verifies that an async delegate does not throw an exception + + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that an async delegate does not throw an exception. + + A TestDelegate + + + + 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 + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + 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 TestDelegate + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + 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 TestDelegate + + + + 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 + + + + 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 + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it 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 of a certain Type + or one derived from it when called and returns it. + + A TestDelegate + + + + Verifies that a delegate does not throw an exception + + A TestDelegate + 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 TestDelegate + + + + 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 + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + 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. + + The actual value to test + A Constraint expression to be applied + + + + 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. + + The actual value to test + A Constraint expression to be applied + The message that will be displayed on failure + Arguments 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 + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Delegate used by tests that execute code and + capture any thrown exception. + + + + + Delegate used by tests that execute async code and + capture any thrown exception. + + + + + AssertionHelper is an optional base class for user tests, + allowing the use of shorter names in making asserts. + + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to + . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to . + + The evaluated condition + + + + 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. + + 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 + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + 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 + + + + 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 + + + + Returns a ListMapper based on a collection. + + The original collection + + + + + 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 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 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 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 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 equality with zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new 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 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 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 regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression 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 a subpath of the 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. + + + + + 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. + + + + + DO NOT USE! + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + Not applicable + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + 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 + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + 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 InconclusiveException on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Marks a test as needing to be run in a particular threading apartment state. This will cause it + to run in a separate thread if necessary. + + + + + Construct an ApartmentAttribute + + The apartment state that this test must be run under. You must pass in a valid apartment state. + + + + Provides the author of a test or test fixture. + + + + + Initializes a new instance of the class. + + The name of the author. + + + + Initializes a new instance of the class. + + The name of the author. + The email address of the author. + + + + Applies 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 + + + + + Modifies a test by adding a category to it. + + The test to modify + + + + Marks a test to use a combinatorial join of any argument data provided. + Since this is the default, the attribute is optional. + + + + + Default constructor + + + + + Marks a test as using a particular CombiningStrategy to join any supplied parameter data. + Since this is the default, the attribute is optional. + + + + + Construct a CombiningStrategyAttribute incorporating an + ICombiningStrategy and an IParameterDataProvider. + + Combining strategy to be used in combining data + An IParameterDataProvider to supply data + + + + Construct a CombiningStrategyAttribute incorporating an object + that implements ICombiningStrategy and an IParameterDataProvider. + This constructor is provided for CLS compliance. + + Combining strategy to be used in combining data + An IParameterDataProvider to supply data + + + + Builds any number of tests from the specified method and context. + + The MethodInfo for which tests are to be constructed. + The suite to which the tests will be added. + + + + Modify the test by adding the name of the combining strategy + to the properties. + + The test to modify + + + + Marks an assembly, test fixture or test method as applying to a specific Culture. + + + + + Constructor with no cultures specified, for use + with named property syntax. + + + + + Constructor taking one or more cultures + + Comma-delimited list of cultures + + + + Causes a test to be skipped if this CultureAttribute is not satisfied. + + The test to modify + + + + Tests to determine if the current culture is supported + based on the properties of this attribute. + + True, if the current culture is supported + + + + Test to determine if the a particular culture or comma- + delimited set of cultures is in use. + + Name of the culture or comma-separated list of culture ids + True if the culture is in use on the system + + + + Test to determine if one of a collection of cultures + is being used currently. + + + + + + + Abstract base class for all data-providing attributes defined by NUnit. + Used to select all data sources for a method, class or parameter. + + + + + Default constructor + + + + + Marks a field for use as a datapoint when executing a theory within + the same fixture that requires an argument of the field's Type. + + + + + Marks a field, property or method as providing a set of datapoints for use + in executing any theories within the same fixture that require an argument of + the provided Type. The data source may provide an array of the required Type + or an . Synonymous with . + + + + + Marks a field, property or method as providing a set of datapoints for use + in executing any theories within the same fixture that require an argument + of the provided type. The data source may provide an array of the required + Type or an . Synonymous with . + + + + + Sets the tolerance used by default when checking the equality of floating point values + within the test assembly, fixture or method. + + + + + Construct specifying an amount + + + + + + Apply changes to the TestExecutionContext + + The TestExecutionContext + + + + Provides the descriptive text relating to the assembly, test fixture or test method. + + + + + Construct a description Attribute + + The text of the description + + + + Marks an assembly, test fixture or test method such that it will only run if explicitly + executed from the GUI, command line or included within a test 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 + + + + Modifies a test by marking it as explicit. + + The test to modify + + + + Marks an assembly, test fixture or test method as being ignored. Ignored tests result in a warning message when the tests are run. + + + + + Constructs the attribute giving a reason for ignoring the test + + The reason for ignoring the test + + + + The date in the future to stop ignoring the test as a string in UTC time. + For example for a date and time, "2014-12-25 08:10:00Z" or for just a date, + "2014-12-25". If just a date is given, the Ignore will expire at midnight UTC. + + + Once the ignore until date has passed, the test will be marked + as runnable. Tests with an ignore until date will have an IgnoreUntilDate + property set which will appear in the test results. + + The string does not contain a valid string representation of a date and time. + + + + Modifies a test by marking it as Ignored. + + The test to modify + + + + 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 items 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 + + + + + Sets the number of worker threads that may be allocated by the framework + for running tests. + + + + + Construct a LevelOfParallelismAttribute. + + The number of worker threads to be created by the framework. + + + + Specifies the maximum time (in milliseconds) for a test case to succeed. + + + + + Construct a MaxTimeAttribute, given a time in milliseconds. + + The maximum elapsed time in milliseconds + + + + Marks tests that should NOT be run in parallel. + + + + + Construct a NonParallelizableAttribute. + + + + + Used by third-party frameworks, or other software, that reference + the NUnit framework but do not contain any tests. Applying the + attribute indicates that the assembly is not a test assembly and + may prevent errors if certain runners attempt to load the assembly. + Note that recognition of the attribute depends on each individual runner. + + + + + Abstract base class for all custom attributes defined by NUnit. + + + + + Default constructor + + + + + Identifies a method that is called once to perform setup before any child tests are run. + + + + + Identifies a method to be called once after all the child tests have run. + The method is guaranteed to be called, even if an exception is thrown. + + + + + Defines the order that the test will run in + + + + + Defines the order that the test will run in + + + + + Defines the order that the test will run in + + + + + + Modifies a test as defined for the specific attribute. + + The test to modify + + + + Marks a test as using a pairwise join of any supplied argument data. Arguments will be + combined in such a way that all possible pairs of arguments are used. + + + + + Default constructor + + + + + Marks a test assembly, fixture or method that may be run in parallel. + + + + + Construct a ParallelizableAttribute using default ParallelScope.Self. + + + + + Construct a ParallelizableAttribute with a specified scope. + + The ParallelScope associated with this attribute. + + + + Defines the degree to which this test and its descendants may be run in parallel + + + + + Overridden to check for invalid combinations of settings + + + + + + Modify the context to be used for child tests + + The current TestExecutionContext + + + + Specifies the degree to which a test, and its descendants, + may be run in parallel. + + + + + No ParallelScope was specified on the test + + + + + The test may be run in parallel with others at the same level. + Valid on classes and methods but not assemblies. + + + + + Test may not be run in parallel with any others. Valid on + classes and methods but not assemblies. + + + + + Mask used to extract the flags that apply to the item on which a + ParallelizableAttribute has been placed, as opposed to descendants. + + + + + Descendants of the test may be run in parallel with one another. + Valid on assemblies and classes but not on methods. + + + + + Descendants of the test down to the level of TestFixtures may be + run in parallel with one another. Valid on assemblies and classes + but not on methods. + + + + + Mask used to extract all the flags that impact descendants of a + test and place them in the TestExecutionContext. + + + + + The test and its descendants may be run in parallel with others at + the same level. Valid on classes and methods but not assemblies. + + + + + Marks an assembly, test fixture or test method as applying to a specific platform. + + + + + Constructor with no platforms specified, for use + with named property syntax. + + + + + Constructor taking one or more platforms + + Comma-delimited list of platforms + + + + Causes a test to be skipped if this PlatformAttribute is not satisfied. + + The test to modify + + + + Attaches information to a test assembly, fixture or method 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 + + + + + Modifies a test by adding properties to it. + + The test to modify + + + + Supplies a set of random values to a single parameter of a parameterized test. + + + + + If true, no value will be repeated. + + + + + Construct a random set of values appropriate for the Type of the + parameter on which the attribute appears, specifying only the count. + + + + + + Construct a set of ints within a specified range + + + + + Construct a set of unsigned ints within a specified range + + + + + Construct a set of longs within a specified range + + + + + Construct a set of unsigned longs within a specified range + + + + + Construct a set of shorts within a specified range + + + + + Construct a set of unsigned shorts within a specified range + + + + + Construct a set of doubles within a specified range + + + + + Construct a set of floats within a specified range + + + + + Construct a set of bytes within a specified range + + + + + Construct a set of sbytes within a specified range + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + Supplies 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 unsigned ints using default step of 1 + + + + + Construct a range of unsigned ints specifying the step size + + + + + Construct a range of longs using a default step of 1 + + + + + Construct a range of longs + + + + + Construct a range of unsigned longs using default step of 1 + + + + + Construct a range of unsigned longs specifying the step size + + + + + Construct a range of doubles + + + + + Construct a range of floats + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + Returns a string that represents the current object. + + + + Specifies that a test should be run multiple times. + + + + + Construct a RepeatAttribute + + The number of times to run the test + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + The test command for the RepeatAttribute + + + + + Initializes a new instance of the class. + + The inner command. + The number of repetitions + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Marks a test that must run on a separate thread. + + + + + Construct a RequiresThreadAttribute + + + + + Construct a RequiresThreadAttribute, specifying the apartment + + + + + Specifies that a test method should be rerun on failure up to the specified + maximum number of times. + + + + + Construct a + + The maximum number of times the test should be run if it fails + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + The test command for the + + + + + Initializes a new instance of the class. + + The inner command. + The maximum number of repetitions + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Marks a test to use a sequential join of any provided argument data. + Arguments will be combined into test cases, taking the next value of + each argument until all are used. + + + + + Default constructor + + + + + Sets the current Culture on an assembly, test fixture or test method for + the duration of a test. The culture remains set until the test or fixture + completes and is then reset to its original value. + + + + + + Construct given the name of a culture + + + + + + Sets the current UI Culture on an assembly, test fixture or test method + for the duration of a test. The UI culture remains set until the test or + fixture completes and is then reset to its original value. + + + + + + Construct given the name of a culture + + + + + + Identifies a method to be called immediately before each test is run. + + + + + Identifies a class as containing or + methods for all the test fixtures + under a given namespace. + + + + + Builds a from the specified type. + + The type info of the fixture to be used. + + + + Marks a test fixture as requiring all child tests to be run on the + same thread as the OneTimeSetUp and OneTimeTearDown. A flag in the + is set forcing all child tests + to be run sequentially on the current thread. + Any setting is ignored. + + + + + Apply changes to the TestExecutionContext + + The TestExecutionContext + + + + Identifies a method to be called immediately after each test is run. + The method is guaranteed to be called, even if an exception is thrown. + + + + + Abstract attribute providing actions to execute before and after tests. + + + + + Executed before each test is run + + The test that is going to be run. + + + + Executed after each test is run + + The test that has just been run. + + + + Provides the target for the action attribute + + + + + Marks a test assembly as needing a special assembly resolution hook that will + explicitly search the test assembly's directory for dependent assemblies. + This works around a conflict between mixed-mode assembly initialization and + tests running in their own AppDomain in some cases. + + + + + Marks the method as callable from the NUnit test runner. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + public void TestDescriptionMethod() + {} + } + + + + + + Descriptive text for this test + + + + + The author of this test + + + + + The type that this test is testing + + + + + Gets or sets the expected result. Not valid if the test + method has parameters. + + The result. + + + + Modifies a test by adding a description, if not already set. + + The test to modify + + + + Builds a single test from the specified method and context. + + The method for which a test is to be constructed. + The suite to which the test will be added. + + + + Marks a method as a parameterized test suite and provides arguments for each test case. + + + + + 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 or sets the name of the test. + + The name of the test. + + + + Gets or sets the RunState of this test case. + + + + + Gets the list of arguments to a test case + + + + + Gets the properties of the test case + + + + + Gets or sets the expected result. + + The result. + + + + Returns true if the expected result has been set + + + + + Gets or sets the description. + + The description. + + + + The author of this test + + + + + The type that this test is testing + + + + + Gets or sets the reason for ignoring the test + + + + + Gets or sets a value indicating whether this is explicit. + + + true if explicit; otherwise, false. + + + + + Gets or sets the reason for not running the test. + + The reason. + + + + Gets or sets the ignore reason. When set to a non-null + non-empty value, the test is marked as ignored. + + The ignore reason. + + + + Comma-delimited list of platforms to run the test for + + + + + Comma-delimited list of platforms to not run the test for + + + + + Gets and sets the category for this test case. + May be a comma-separated list of categories. + + + + + Performs several special conversions allowed by NUnit in order to + permit arguments with types that cannot be used in the constructor + of an Attribute such as TestCaseAttribute or to simplify their use. + + The arguments to be converted + The ParameterInfo array for the method + + + + Performs several special conversions allowed by NUnit in order to + permit arguments with types that cannot be used in the constructor + of an Attribute such as TestCaseAttribute or to simplify their use. + + The argument to be converted + The target in which the should be converted + If conversion was successfully applied, the converted into + + true if was converted and should be used; + false is no conversion was applied and should be ignored + + + + + Builds a single test from the specified method and context. + + The MethodInfo for which tests are to be constructed. + The suite to which the tests will be added. + + + + Indicates the source to be used to provide test fixture instances for a test class. + + + + + Construct with the name of the method, property or field that will provide data + + The name of a static method, property or field that will provide data. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + + + + Construct with a name + + The name of a static method, property or field that will provide data. + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + Construct with a Type + + The type that will provide data + + + + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + + 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 every fixture created from + this attribute. May be a single category or a comma-separated list. + + + + + Builds any number of tests from the specified method and context. + + The IMethod for which tests are to be constructed. + The suite to which the tests will be added. + + + + Marks the class as a TestFixture. + + + + + 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. + + + + + + Gets or sets the name of the test. + + The name of the test. + + + + Gets or sets the RunState of this test fixture. + + + + + The arguments originally provided to the attribute + + + + + Properties pertaining to this fixture + + + + + Get or set the type arguments. If not set + explicitly, any leading arguments that are + Types are taken as type arguments. + + + + + Descriptive text for this fixture + + + + + The author of this fixture + + + + + The type that this fixture is testing + + + + + Gets or sets the ignore reason. May set RunState as a side effect. + + The ignore reason. + + + + Gets or sets the reason for not running the fixture. + + The reason. + + + + Gets or sets the ignore reason. When set to a non-null + non-empty value, the test is marked as ignored. + + The ignore reason. + + + + Gets or sets a value indicating whether this is explicit. + + + true if explicit; otherwise, false. + + + + + Gets and sets the category for this fixture. + May be a comma-separated list of categories. + + + + + Builds a single test fixture from the specified type. + + + + + Builds a single test fixture from the specified type. + + The type info of the fixture to be used. + Filter used to select methods as tests. + + + + Identifies the source used to provide test fixture instances for a test class. + + + + + Error message string is public so the tests can use it + + + + + Construct with the name of the method, property or field that will provide data + + The name of a static method, property or field that will provide data. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + + + + Construct with a Type + + The type 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 every fixture created from + this attribute. May be a single category or a comma-separated list. + + + + + Builds any number of test fixtures from the specified type. + + The TypeInfo for which fixtures are to be constructed. + + + + Builds any number of test fixtures from the specified type. + + The TypeInfo for which fixtures are to be constructed. + PreFilter used to select methods as tests. + + + + Returns a set of ITestFixtureData items for use as arguments + to a parameterized test fixture. + + The type for which data is needed. + + + + + Indicates the method or class the assembly, test fixture or test method is testing. + + + + + Initializes a new instance of the class. + + The type that is being tested. + + + + Initializes a new instance of the class. + + The type that is being tested. + + + + 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")] + public void TestDescriptionMethod() + {} + } + + + + + + Construct the attribute, specifying a combining strategy and source of parameter data. + + + + + Applies a timeout in milliseconds to a test. + When applied to a method, the test is cancelled if the timeout is exceeded. + When applied to a class or assembly, the default timeout is set for all contained test methods. + + + + + Construct a TimeoutAttribute given a time in milliseconds + + The timeout value in milliseconds + + + + Provides literal arguments for an individual parameter of a test. + + + + + 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 + + + + + Constructs for use with an Enum parameter. Will pass every enum + value in to the test. + + + + + Construct with one argument + + + + + + Construct with two arguments + + + + + + + Construct with three arguments + + + + + + + + Construct with an array of arguments + + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + To generate data for Values attribute, in case no data is provided. + + + + + To Check if type is nullable enum. + + + + + Indicates the source 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 a static method, property or field 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 a static 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 + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + A set of Assert methods operating on one or more collections + + + + + DO NOT USE! Use CollectionAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + 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 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 + 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 + 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 + 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 + 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 + 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 + 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 + Arguments to be used in formatting the message + + + + Asserts that the superset does not contain the subset + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + + + + Asserts that the superset does not contain the subset + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the superset contains the subset. + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + + + + Asserts that the superset contains the subset. + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the subset does not contain the superset + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that the subset does not contain the superset + + 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 the subset contains the superset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that the subset contains the superset. + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + AllItemsConstraint applies another constraint to each + item in a collection, succeeding if they all succeed. + + + + + Construct an AllItemsConstraint on top of an existing 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. + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + AndConstraint succeeds only if both members succeed. + + + + + Create an AndConstraint from two other constraints + + The first constraint + The second constraint + + + + Gets text describing a 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 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 + + + + is used to determine whether the value is equal to any of the expected values. + + + + + Construct a + + Collection of expected values + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether item is present in expected collection + + Actual item type + Actual item + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IEqualityComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + AssignableFromConstraint is used to test that an object + can be assigned from a given Type. + + + + + Construct an AssignableFromConstraint for the type provided + + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + AssignableToConstraint is used to test that an object + can be assigned to a given Type. + + + + + Construct an AssignableToConstraint for the type provided + + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + 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. + + + + + Constructs an AttributeConstraint for a specified attribute + Type and base constraint. + + + + + + + Determines whether the Type or other provider has the + expected attribute and if its value matches the + additional constraint specified. + + + + + Returns a string representation of the constraint. + + + + + AttributeExistsConstraint tests for the presence of a + specified attribute on a Type. + + + + + Constructs an AttributeExistsConstraint for a specific attribute Type + + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Tests whether the object provides the expected attribute. + + A Type, MethodInfo, or other ICustomAttributeProvider + True if the expected attribute is present, otherwise false + + + + 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 + + + + BinarySerializableConstraint tests whether + an object is serializable in binary format. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Returns the string representation + + + + + 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 + + + + + + + CollectionContainsConstraint is used to test whether a collection + contains an expected object as a member. + + + + + Construct a CollectionContainsConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Test whether the expected item is contained in the collection + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + CollectionEquivalentConstraint is used to determine whether two + collections are equivalent. + + + + The result of the from the collections + under comparison. + + + Construct a CollectionEquivalentConstraint + Expected collection. + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether two collections are equivalent + + + + + + + Test whether the collection is equivalent to the expected. + + + Actual collection type. + + + Actual collection to compare. + + + A indicating whether or not + the two collections are equivalent. + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + Provides a for the . + + + Result of a of the collections to compare for equivalence. + + + Maximum amount of elements to write to the if there are + extra/missing elements from the collection. + + + Construct a using a . + Source . + Result of the collection comparison. + Actual collection to compare. + Whether or not the succeeded. + + + Write any additional lines (following Expected: and But was:) for a failing constraint. + The to write the failure message to. + + + + CollectionItemsEqualConstraint is the abstract base class for all + collection constraints that apply some notion of item equality + as a part of their operation. + + + + + The NUnitEqualityComparer in use for this constraint + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Get a flag indicating whether the user requested us to ignore case. + + + + + Get a flag indicating whether any external comparers are in use. + + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + Compares two collection members for equality + + + + + Return a new CollectionTally for use in making tests + + The collection to be included in the tally + + + + CollectionOrderedConstraint is used to test whether a collection is ordered. + + + + + Construct a CollectionOrderedConstraint + + + + + 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. + + + + + If used performs a default ascending comparison + + + + + If used performs a reverse comparison + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use a and returns self. + + + + + Modifies the constraint to test ordering by the value of + a specified property and returns self. + + + + + Then signals a break between two ordering steps + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Test whether the collection is ordered + + + + + Returns the string representation of the constraint. + + + + + + An OrderingStep represents one stage of the sort + + + + + Constructor for success result. + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + + + + Constructor for failure result. + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + Index at which collection order breaks. + Value at which collection order breaks. + + + + 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 + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the actual collection is a subset of + the expected collection provided. + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + CollectionSupersetConstraint is used to determine whether + one collection is a superset of another + + + + + Construct a CollectionSupersetConstraint + + The collection that the actual value is expected to be a superset of + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the actual collection is a superset of + the expected collection provided. + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + counts (tallies) the number of occurrences + of each object in one or more enumerations. + + + The result of a . + + + Items that were not in the expected collection. + + + Items that were not accounted for in the expected collection. + + + Initializes a new instance of the class with the given fields. + + + The result of the comparison between the two collections. + + + Construct a CollectionTally object from a comparer and a collection. + The comparer to use for equality. + The expected collection to compare against. + + + Try to remove an object from the tally. + The object to remove. + + + Try to remove a set of objects from the tally. + The objects to remove. + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two types related by . + + + + + Interface for comparing two s. + + + + + Method for comparing two objects with a tolerance. + + The first object to compare. + The second object to compare. + The tolerance to use when comparing the objects. + Flag indicating whether or not this is the top level comparison. + + null if the objects cannot be compared using the method. + Otherwise the result of the comparison is returned. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s or s. + + + + + Comparator for two Tuples. + + + + + Base class for comparators for tuples (both regular Tuples and ValueTuples). + + + + + Comparator for two ValueTuples. + + + + + ComparisonAdapter class centralizes all comparisons of + values in NUnit, adapting to the use of any provided + , + or . + + + + + Gets the default ComparisonAdapter, which wraps an + NUnitComparer object. + + + + + Returns a ComparisonAdapter that wraps an + + + + + Returns a ComparisonAdapter that wraps an + + + + + Returns a ComparisonAdapter that wraps a + + + + + Compares two objects + + + + + Construct a default ComparisonAdapter + + + + + Construct a ComparisonAdapter for an + + + + + Compares two objects + + + + + + + + ComparerAdapter extends and + allows use of an or + to actually perform the comparison. + + + + + Construct a ComparisonAdapter for an + + + + + Compare a Type T to an object + + + + + Construct a ComparisonAdapter for a + + + + + Compare a Type T to an object + + + + + Abstract base class for constraints that compare values to + determine if one is greater than, equal to or less than + the other. + + + + + The value against which a comparison is to be made + + + + + Tolerance used in making the comparison + + + + + ComparisonAdapter to be used in making the comparison + + + + + Initializes a new instance of the class. + + The value against which to make a comparison. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + A ConstraintResult + + + + Protected function overridden by derived class to actually perform the comparison + + + + + Modifies the constraint to use an and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Modifies the constraint to use an and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Modifies the constraint to use a and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Set the tolerance for use in this comparison + + + + + Switches the .Within() modifier to interpret its tolerance as + a percentage that the actual values is allowed to deviate from + the expected value. + + Self + + + + Delegate used to delay evaluation of the actual value + to be used in evaluating a constraint + + + + + The Constraint class is the base of all built-in constraints + within NUnit. It provides the operator overloads used to combine + constraints. + + + + + Construct a constraint with optional arguments + + Arguments to be saved + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Arguments provided to this Constraint, for use in + formatting the description. + + + + + The ConstraintBuilder holding this constraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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 + A ConstraintResult + + + + Retrieves the value to be tested from an ActualValueDelegate. + The default implementation simply evaluates the delegate but derived + classes may override it to provide for delayed processing. + + An ActualValueDelegate + Delegate evaluation result + + + + 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 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. + + + + + Returns a DelayedConstraint.WithRawDelayInterval with the specified delay time. + + The delay, which defaults to milliseconds. + + + + + Returns a DelayedConstraint with the specified delay time + and polling interval. + + The delay in milliseconds. + The interval at which to test the constraint. + + + + + Resolves any pending operators and returns the resolved 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 reorganized. a ConstraintStack holds + input constraints as well as the results of each + operator applied. + + + + + OperatorStack is a type-safe stack for holding ConstraintOperators + + + + + Initializes a new instance of the class. + + The ConstraintBuilder using this stack. + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost operator without modifying the stack. + + + + + Pushes the specified operator onto the stack. + + The operator to put onto the stack. + + + + Pops the topmost operator from the stack. + + The topmost operator on the stack + + + + ConstraintStack is a type-safe stack for holding Constraints + + + + + Initializes a new instance of the class. + + The ConstraintBuilder using this stack. + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Pushes the specified constraint. As a side effect, + the constraint's Builder field is set to the + ConstraintBuilder owning this stack. + + The constraint to put onto the stack + + + + Pops this topmost constraint from the stack. + As a side effect, the constraint's Builder + field is set to null. + + The topmost constraint on the stack + + + + 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 expression 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. + + + + + 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 + reorganized. When a constraint is appended, it is returned as the + value of the operation so that modifiers may be applied. However, + any partially built expression is attached to the constraint for + later resolution. When an operator is appended, the partial + expression is returned. If it's a self-resolving operator, then + a ResolvableConstraintExpression is returned. + + + + + 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. Note that the constraint + is not reduced at this time. For example, if there + is a NotOperator on the stack we don't reduce and + return a NotConstraint. The original constraint must + be returned because it may support modifiers that + are yet to be applied. + + + + + 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 ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a , which will + apply the following constraint to a collection of length one, succeeding + only if exactly one of them succeeds. + + + + + 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 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 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. + + + + + With is currently a NOP - reserved for future use. + + + + + 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 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 if item is equal to zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new 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 new 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 new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the Dictionary key collection. + + The key to be matched in the Dictionary key collection + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the Dictionary value collection. + + The value to be matched in the Dictionary value collection + + + + 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 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 ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression 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 a subpath of the 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 + inclusively within a specified range. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + Returns a constraint that succeeds if the value + is a file or directory and it exists. + + + + + Returns a constraint that tests if an item is equal to any of parameters + + Expected values + + + + ConstraintStatus represents the status of a ConstraintResult + returned by a Constraint being applied to an actual value. + + + + + The status has not yet been set + + + + + The constraint succeeded + + + + + The constraint failed + + + + + An error occurred in applying the constraint (reserved for future use) + + + + + Contains the result of matching a against an actual value. + + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + The status of the new ConstraintResult. + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + If true, applies a status of Success to the result, otherwise Failure. + + + + The actual value that was passed to the method. + + + + + Gets and sets the ResultStatus for this result. + + + + + True if actual value meets the Constraint criteria otherwise false. + + + + + Display friendly name of the constraint. + + + + + Description of the constraint may be affected by the state the constraint had + when was performed against the actual value. + + + + + Write the failure message to the MessageWriter provided + as an argument. The default implementation simply passes + the result 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 occurred, can override this. + + The MessageWriter on which to display the message + + + + Write some additional failure message. + + The MessageWriter on which to display the message + + + + 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 + + + + 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 value contained within the string/collection. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Flag the constraint to ignore case and return self. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Applies a delay to the match so that a match can be evaluated in the future. + + + + + Allows only changing the time dimension of delay interval and setting a polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithRawDelayInterval + + Parent DelayedConstraint on which delay interval dimension is required to be set + + + + Changes delay interval dimension to minutes + + + + + Changes delay interval dimension to seconds + + + + + Changes delay interval dimension to milliseconds + + + + + Set polling interval, in milliseconds + + A time interval, in milliseconds + + + + + Allows only setting the polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithDimensionedDelayInterval + + Parent DelayedConstraint on which polling interval is required to be set + + + + Set polling interval, in milliseconds + + A time interval, in milliseconds + + + + + Allows only changing the time dimension of the polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithRawPollingInterval + + Parent DelayedConstraint on which polling dimension is required to be set + + + + Changes polling interval dimension to minutes + + + + + Changes polling interval dimension to seconds + + + + + Changes polling interval dimension to milliseconds + + + + + Delay value store as an Interval object + + + + + Polling value stored as an Interval object + + + + + Creates a new DelayedConstraint + + The inner constraint to 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 to decorate + The time interval after which the match is performed, in milliseconds + The time interval used for polling, in milliseconds + If the value of is less than 0 + + + + Gets text describing a constraint + + + + + 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 + A ConstraintResult + + + + 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 + + + + Returns the string representation of the constraint. + + + + + Adjusts a Timestamp by a given TimeSpan + + + + + + + + Returns the difference between two Timestamps as a TimeSpan + + + + + + + + DictionaryContainsKeyConstraint is used to test whether a dictionary + contains an expected object as a key. + + + + + Construct a DictionaryContainsKeyConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Flag the constraint to ignore case and return self. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + + + + Test whether the expected key is contained in the dictionary + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + DictionaryContainsValueConstraint is used to test whether a dictionary + contains an expected object as a value. + + + + + Construct a DictionaryContainsValueConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Test whether the expected value is contained in the dictionary + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + Provides a for the constraints + that are applied to each item in the collection + + + + + Constructs a for a particular + Only used for Failure + + The Constraint to which this result applies + The actual value to which the Constraint was applied + Actual item that does not match expected condition + Non matching item index + + + + Write constraint description, actual items, and non-matching item + + The MessageWriter on which to display the message + + + + EmptyCollectionConstraint tests whether a collection is empty. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Check that the collection is empty + + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + EmptyDirectoryConstraint is used to test that a directory is empty + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + EmptyStringConstraint tests whether a string is empty. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + 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. + + + + + + + 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. + + + + + NUnitEqualityComparer used to test equality. + + + + + Initializes a new instance of the class. + + The expected value. + + + + Gets the tolerance for this comparison. + + + The tolerance. + + + + + Gets a value indicating whether to compare case insensitive. + + + true if comparing case insensitive; otherwise, false. + + + + + Gets a value indicating whether or not to clip strings. + + + true if set to clip strings otherwise, false. + + + + + Gets the failure points. + + + The failure points. + + + + + 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. + + + + + Flag the constraint to use a tolerance when determining equality. + + Tolerance value to be used + Self. + + + + Flags the constraint to include + property in comparison of two values. + + + Using this modifier does not allow to use the + constraint modifier. + + + + + 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 + + + + 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 boolean-returning delegate. + + The boolean-returning delegate 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 use the supplied predicate function + + The comparison function to use. + Self. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + The EqualConstraintResult class is tailored for formatting + and displaying the result of an EqualConstraint. + + + + + Construct an EqualConstraintResult + + + + + Write a failure message. Overridden to provide custom + failure messages for EqualConstraint. + + The MessageWriter to write to + + + + Display the failure information for two collections that did not match. + + The MessageWriter on which to display + The expected collection. + The actual collection + The depth of this failure in a set of nested collections + + + + Displays a single line showing the types and sizes of the expected + and actual collections or arrays. If both are identical, the value is + only shown once. + + The MessageWriter on which to display + The expected collection or array + The actual collection or array + The indentation level for the message line + + + + Displays a single line showing the point in the expected and actual + arrays at which the comparison failed. If the arrays have different + structures or dimensions, both values are shown. + + The MessageWriter on which to display + The expected array + The actual array + Index of the failure point in the underlying collections + The indentation level for the message line + + + + 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 + + + + EqualityAdapter class handles all equality comparisons + that use an , + or a . + + + + + 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 that wraps an . + + + + + that wraps an . + + + + + Returns an that wraps an . + + + + + Returns an EqualityAdapter that uses a predicate function for items comparison. + + + + + + + + + Returns true if the two objects can be compared by this adapter. + The base adapter cannot handle IEnumerables except for strings. + + + + + Compares two objects, returning true if they are equal + + + + + Returns true if the two objects can be compared by this adapter. + Generic adapter requires objects of the specified type. + + + + + Returns an that wraps an . + + + + + Returns an that wraps an . + + + + + that wraps an . + + + + + Returns an that wraps a . + + + + + ExactCountConstraint applies another constraint to each + item in a collection, succeeding only if a specified + number of items succeed. + + + + + Construct a standalone ExactCountConstraint + + + + + + 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. + + The value to be tested + A ConstraintResult + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Contain the result of matching a against an actual value. + + + + + The maximum count of list elements that are shown on the constraint result + + + + + The count of matched items of the + + + + + A list with maximum count (+1) of items of the + (The maximum count is set in ) + + + + + Constructs a for a . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + If true, applies a status of Success to the result, otherwise Failure. + Count of matched items of the + A list with maximum count (+1) of items of the + + + + Write the actual value for a failing constraint test to a MessageWriter. + + 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. + + + + 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. + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + ExceptionTypeConstraint is a special version of ExactTypeConstraint + used to provided detailed info about the exception thrown in + an error message. + + + + + Constructs an ExceptionTypeConstraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + FalseConstraint tests that the actual value is false + + + + + Initializes a new instance of the class. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + FileExistsConstraint is used to determine if a file exists + + + + + Initializes a new instance of the class. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + FileOrDirectoryExistsConstraint is used to determine if a file or directory exists + + + + + If true, the constraint will only check if files exist, not directories + + + + + If true, the constraint will only check if directories exist, not files + + + + + Initializes a new instance of the class that + will check files and directories. + + + + + Initializes a new instance of the class that + will only check files if ignoreDirectories is true. + + if set to true [ignore directories]. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + 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. + + + + + 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 + + + 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 between 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 between 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/ + + + + + + Tests whether a value is greater than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Tests whether a value is greater than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Interface for all constraints + + + + + The display name of this Constraint for use by ToString(). + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Arguments provided to this Constraint, for use in + formatting the description. + + + + + The ConstraintBuilder holding this constraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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 + A ConstraintResult + + + + 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 + + + + 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. + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + Keeps track of an interval time which can be represented in + Minutes, Seconds or Milliseconds + + + + + Constructs a interval given an value in milliseconds + + + + + Gets Interval value represented as a TimeSpan object + + + + + Returns the interval with the current value as a number of minutes. + + + + + Returns the interval with the current value as a number of seconds. + + + + + Returns the interval with the current value as a number of milliseconds. + + + + + Is true for intervals created with a non-zero value + + + + + Returns a string that represents the current object. + + + A string that represents the current object. + + + + + IntervalUnit provides the semantics to the value stored in Interval class. + + + + + Unit representing an Interval in minutes + + + + + Unit representing an Interval in seconds + + + + + Unit representing an Interval in milliseconds + + + + + The IResolveConstraint interface is implemented by all + complete and resolvable constraints and expressions. + + + + + Return the top-level constraint for this expression + + + + + + An extension of ResolvableConstraintExpression that adds a no-op Items property for readability. + + + + + Create a new instance of ItemsConstraintExpression + + + + + Create a new instance of ResolvableConstraintExpression, + passing in a pre-populated ConstraintBuilder. + + + + + + No-op property for readability. + + + + + Tests whether a value is less than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Tests whether a value is less than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + 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 + + + + + Abstract method to get the max line length + + + + + 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 given + 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 failing constraint result + + + + 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 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 + + + + Custom value formatter function + + The value + + + + + Custom value formatter factory function + + The next formatter function + ValueFormatter + If the given formatter is unable to handle a certain format, it must call the next formatter in the chain + + + + Static methods used in creating messages + + + + + Static string used when strings are clipped + + + + + Formatting strings used for expected and actual values + + + + + Current head of chain of value formatters. Public for testing. + + + + + Add a formatter to the chain of responsibility. + + + + + + Formats text to represent a generalized value. + + The value + The formatted text + + + + Formats 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 + + + + 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 + + + + Converts any null characters in a string + to their escaped representation. + + The string to be converted + The converted string + + + + Return the a string representation for a set of indices into an array + + Array of indices for which a string is needed + + + + Get an array of indices representing the point in a collection or + array corresponding to a single int index into the collection. + + The collection to which the indices apply + Index in the collection + Array of indices + + + + Clip a string to a given length, starting at a particular offset, returning the clipped + string with ellipses representing the removed parts + + The string to be clipped + The maximum permitted length of the result string + The point at which to start clipping + The clipped string + + + + Clip the expected and actual strings in a coordinated fashion, + so that they may be displayed together. + + + + + + + + + Shows the position two strings start to differ. Comparison + starts at the start index. + + The expected string + The actual string + The index in the strings at which comparison should start + Boolean indicating whether case should be ignored + -1 if no mismatch found, or the index where mismatch found + + + + NaNConstraint tests that the actual value is a double or float NaN + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test that the actual value is an NaN + + + + + + + NoItemConstraint applies another constraint to each + item in a collection, failing if any of them succeeds. + + + + + Construct a SomeItemsConstraint on top of an existing constraint + + + + + + 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. + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + 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 + + + + NullConstraint tests that the actual value is null + + + + + Initializes a new instance of the class. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + 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. + + + + + Returns the default NUnitComparer. + + + + + Compares two objects + + + + + + + + NUnitEqualityComparer encapsulates NUnit's handling of + equality tests between objects. + + + + + If true, all string comparisons will ignore case + + + + + If true, arrays will be treated as collections, allowing + those of different dimensions to be compared + + + + + Comparison objects used in comparisons for some constraints. + + + + + List of points at which a failure occurred. + + + + + List of comparers used to compare pairs of objects. + + + + + Initializes a new instance of the class. + + + + + 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 the list of external comparers to be used to + test for equality. They are applied to members of + collections, in place of NUnit's own logic. + + + + + Gets the list of failure points for the last Match performed. + The list consists of objects to be interpreted by the caller. + This generally means that the caller may only make use of + objects it has placed on the list at a particular depth. + + + + + Flags the comparer to include + property in comparison of two values. + + + Using this modifier does not allow to use the + modifier. + + + + + Compares two objects for equality within a tolerance. + + + + + 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 + + + + + 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. + + + + + Operator that requires both its arguments to succeed + + + + + Construct an AndOperator + + + + + Apply the operator to produce an AndConstraint + + + + + 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. + + + + + 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. + + + + + + Gets the left precedence of the operator + + + + + Gets the right precedence of the operator + + + + + Abstract method that produces a constraint by applying + the operator to its left and right constraint arguments. + + + + + Abstract base for operators that indicate how to + apply a constraint to items in a collection. + + + + + Constructs a CollectionOperator + + + + + 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. + + + + + The syntax element preceding this operator + + + + + The syntax element following 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. + + + + + 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. + + + + + + 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 + + + + 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. + + + + + + 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. + + + + + Negates the test of the constraint it wraps. + + + + + Constructs a new NotOperator + + + + + Returns a NotConstraint applied to its argument. + + + + + Operator that requires at least one of its arguments to succeed + + + + + Construct an OrOperator + + + + + Apply the operator to produce an OrConstraint + + + + + PrefixOperator takes a single constraint and modifies + its 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. + + + + + + + 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. + + + + + Gets the name of the property to which the operator applies + + + + + 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. + + + + + + Abstract base class for operators that are able to reduce to a + constraint whether or not another syntactic element follows. + + + + + 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. + + + + + 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. + + + + + Represents a constraint that simply wraps the + constraint provided as an argument, without any + further functionality, but which modifies the + order of evaluation because of its precedence. + + + + + Constructor for the WithOperator + + + + + Returns a constraint that wraps its argument + + + + + OrConstraint succeeds if either member succeeds + + + + + Create an OrConstraint from two other constraints + + The first constraint + The second constraint + + + + Gets text describing a 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 + + + + PathConstraint serves as the abstract base of constraints + that operate on paths and provides several helper methods. + + + + + Construct a PathConstraint for a give expected path + + The expected path + + + + Modifies the current instance to be case-sensitive + and returns it. + + + + + Returns the string representation of this constraint + + + + + Canonicalize the provided path + + + The path in standardized form + + + + Test whether one path in canonical form is a subpath of another path + + The first path - supposed to be the parent path + The second path - supposed to be the child path + + + + + Predicate constraint wraps a Predicate in a constraint, + returning success if the predicate is true. + + + + + Construct a PredicateConstraint from a predicate + + + + + Gets text describing a constraint + + + + + Determines whether the predicate succeeds when applied + to the actual value. + + + + + Abstract base class used for prefixes + + + + + The base constraint + + + + + Prefix used in forming the constraint description + + + + + Construct given a base constraint + + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Formats a prefix constraint's description. + + + + + 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 + + + + Returns the string representation of the constraint. + + + + + Contains the result of matching a against an actual value. + + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The base result with actual value to which the Constraint was applied. + + + + Write the additional failure message for a failing constraint to a + MessageWriter. + + The writer on which the actual value is displayed + + + + 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 value + of the property. The two constraints are now separate. + + + + + Initializes a new instance of the class. + + The name of the property. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the property exists for a given object + + The object to be tested + True for success, false for failure + + + + Returns the string representation of the constraint. + + + + + + RangeConstraint tests whether two values are within a + specified range. + + + + + Initializes a new instance of the class. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use a and returns self. + + + + + 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 + + + + 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. + + + + + Appends an And Operator to the expression + + + + + Appends an Or operator to the expression. + + + + + Resolve the current expression to a Constraint + + + + + ReusableConstraint wraps a constraint expression after + resolving it so that it can be reused consistently. + + + + + Construct a ReusableConstraint from a constraint expression + + The expression to be resolved and reused + + + + Converts a constraint to a ReusableConstraint + + The constraint to be converted + A ReusableConstraint + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Return the top-level constraint for this expression + + + + + + SameAsConstraint tests whether an object is identical to + the object passed to its constructor + + + + + Initializes a new instance of the class. + + The expected object. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Summary description for SamePathConstraint. + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + SamePathOrUnderConstraint tests that one path is under another + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + 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 + + + + + + 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. + + + + + Apply the item constraint to each item in the collection, + succeeding if any item succeeds. + + + + + + + Flag the constraint to use the supplied object. + + The type of the elements in the collection. + The type of the member. + The comparison function to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + 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. + + + + + + + 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 + + + + + Description of this constraint + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Constructs a StringConstraint without an expected value + + + + + Constructs a StringConstraint given an expected value + + The expected value + + + + Modify the constraint to ignore case in matching. + + + + + 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 a given string + + The string to be tested + True for success, false for failure + + + + SubPathConstraint tests that the actual path is under the expected path + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + SubstringConstraint can test whether a string contains + the expected substring. + + + + + Initializes a new instance of the class. + + The expected. + + + + Modify the constraint to ignore case in matching. + This will call Using(StringComparison.CurrentCultureIgnoreCase). + + Thrown when a comparison type different + than was already set. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Modify the constraint to the specified comparison. + + Thrown when a comparison type different + than was already set. + + + + 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. + + + + Get the actual exception thrown - used by Assert.Throws. + + + + + Gets text describing a constraint + + + + + 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 actual value for a failing constraint test to a + MessageWriter. This override only handles the special message + used when an exception is expected but none is thrown. + + The writer on which the actual value is displayed + + + + ThrowsExceptionConstraint tests that an exception has + been thrown, without any further tests. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Executes the code and returns success if an exception is thrown. + + A delegate representing the code to be tested + True if an exception is thrown, otherwise false + + + + Applies the constraint to 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. + + + + + ThrowsNothingConstraint tests that a delegate does not + throw an exception. + + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True if no exception is thrown, otherwise false + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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. + + + + + Returns a default Tolerance object, equivalent to an exact match. + + + + + Returns an empty Tolerance object, equivalent to an exact match. + + + + + Constructs a linear tolerance of a specified amount + + + + + Constructs a tolerance given an amount and + + + + + 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 as the amount, using + the current amount as a number of days. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of hours. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of minutes. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of seconds. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of milliseconds. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of clock ticks. + + + + + Gets the for the current Tolerance + + + + + Gets the magnitude of the current Tolerance instance. + + + + + Returns true if the current tolerance has not been set or is using the . + + + + + Apply the tolerance to an expected value and return + a Tolerance.Range that represents the acceptable values. + + + + + Tests that the current Tolerance is linear with a + numeric value, throwing an exception if it is not. + + + + + Tolerance.Range represents the range of values that match + a specific tolerance, when applied to a specific value. + + + + + The lower bound of the range + + + + + The upper bound of the range + + + + + Constructs a range + + + + + 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. + + + + + TrueConstraint tests that the actual value is true + + + + + Initializes a new instance of the class. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + TypeConstraint is the abstract base for constraints + that take a Type as their expected value. + + + + + The expected Type used by the constraint + + + + + The type of the actual argument to which the constraint was applied + + + + + Construct a TypeConstraint for a given Type + + The expected type for the constraint + Prefix used in forming the constraint description + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + UniqueItemsConstraint tests whether all the items in a + collection are unique. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Check that all items are unique. + + + + + + + XmlSerializableConstraint tests whether + an object is serializable in XML format. + + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Returns the string representation of this constraint + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the dictionary. + + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the dictionary. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Asserts on Directories + + + + + DO NOT USE! Use DirectoryAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both point to the same directory. + 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 the 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 point to the same directory. + If they are not 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 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 + + + + Asserts that the directory exists. If it does not exist + an is thrown. + + 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 the directory exists. If it does not exist + an is thrown. + + A directory containing the actual value + + + + Asserts that the directory exists. If it does not exist + an is thrown. + + The path to 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 the directory exists. If it does not exist + an is thrown. + + The path to a directory containing the actual value + + + + Asserts that the directory does not exist. If it does exist + an is thrown. + + 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 the directory does not exist. If it does exist + an is thrown. + + A directory containing the actual value + + + + Asserts that the directory does not exist. If it does exist + an is thrown. + + The path to 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 the directory does not exist. If it does exist + an is thrown. + + The path to a directory containing the actual value + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a constraint that succeeds if the value + is a file or directory and it exists. + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new . 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 new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the Dictionary key collection. + + The key to be matched in the Dictionary key collection + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the Dictionary value collection. + + The value to be matched in the Dictionary value collection + + + + 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 regular expression supplied as an argument. + + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the ResultState provided by this exception + + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + Default Constructor + + + + + Construct based on the TestResult so far. This is the constructor + used normally, when exiting the multiple assert block with failures. + Not used internally but provided to facilitate debugging. + + + The current result, up to this point. The result is not used + internally by NUnit but is provided to facilitate debugging. + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the provided by this exception. + + + + + Gets the of this test at the point the exception was thrown, + + + + + Abstract base for Exceptions that terminate a test and provide a ResultState. + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the ResultState provided by this exception + + + + + Contains extension methods that do not require a special using directive. + + + + + Asserts on Files + + + + + DO NOT USE! Use FileAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Asserts that the file exists. If it does not exist + an is thrown. + + 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 the file exists. If it does not exist + an is thrown. + + A file containing the actual value + + + + Asserts that the file exists. If it does not exist + an is thrown. + + 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 the file exists. If it does not exist + an is thrown. + + The path to a file containing the actual value + + + + Asserts that the file does not exist. If it does exist + an is thrown. + + 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 the file does not exist. If it does exist + an is thrown. + + A file containing the actual value + + + + Asserts that the file does not exist. If it does exist + an is thrown. + + 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 the file does not exist. If it does exist + an is thrown. + + The path to a file containing the actual value + + + + Class used to guard against unexpected argument values + or operations by throwing an appropriate exception. + + + + + Throws an exception if an argument is null + + The value to be tested + The name of the argument + + + + Throws an exception if a string argument is null or empty + + The value to be tested + The name of the argument + + + + Throws an ArgumentOutOfRangeException if the specified condition is not met. + + The condition that must be met + The exception message to be used + The name of the argument + + + + Throws an ArgumentException if the specified condition is not met. + + The condition that must be met + The exception message to be used + The name of the argument + + + + Throws an InvalidOperationException if the specified condition is not met. + + The condition that must be met + The exception message to be used + + + + Throws an if the specified delegate is async void. + + + + + Throws an if the specified delegate is async void. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + 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 ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a which will apply + the following constraint to only one member of the collection, + and fail if none or more than one match occurs. + + + + + 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 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 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 checking for the + presence of a particular object in the collection. + + + + + The AssertionResult class represents the result of a single assertion. + + + + + Construct an AssertionResult + + + + The pass/fail status of the assertion + + + The message produced by the assertion, or null + + + The stack trace associated with the assertion, or null + + + + ToString Override + + + + + Override GetHashCode + + + + + Override Equals + + + + + + AssertionStatus enumeration represents the possible outcomes of an assertion. + The order of definition is significant, higher level values override lower + ones in determining the overall result of a test. + + + + + An assumption failed + + + + + The assertion succeeded + + + + + A warning message was issued + + + + + The assertion failed + + + + + An unexpected exception was thrown + + + + + The IApplyToContext interface is implemented by attributes + that want to make changes to the execution context before + a test is run. + + + + + Apply changes to the execution context + + The execution context + + + + The IApplyToTest interface is implemented by self-applying + attributes that modify the state of a test in some way. + + + + + Modifies a test as defined for the specific attribute. + + The test to modify + + + + CombiningStrategy is the abstract base for classes that + know how to combine values provided for individual test + parameters to create a set of test cases. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + ICommandWrapper is implemented by attributes and other + objects able to wrap a TestCommand with another command. + + + Attributes or other objects should implement one of the + derived interfaces, rather than this one, since they + indicate in which part of the command chain the wrapper + should be applied. + + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + Objects implementing this interface are used to wrap + the TestMethodCommand itself. They apply after SetUp + has been run and before TearDown. + + + + + Objects implementing this interface are used to wrap + the entire test, including SetUp and TearDown. + + + + + Objects implementing this interface are used to wrap + tests that can repeat. The implementing command is run once, + invoking the chained commands any number of times. + + + + + Any ITest that implements this interface is at a level that the implementing + class should be disposed at the end of the test run + + + + + The IFixtureBuilder interface is exposed by a class that knows how to + build test fixtures from a specified type. In general, it is exposed + by an attribute, but it may be implemented in a helper class used by the + attribute in some cases. + + + + + Builds any number of test fixtures from the specified type. + + The type info of the fixture to be used. + + + + The IFixtureBuilder2 interface extends IFixtureBuilder by allowing + use of a PreFilter, which is used to select methods as test cases. + + + + + Builds any number of test fixtures from the specified type. + + The type info of the fixture to be used. + PreFilter to be used to select methods. + + + + IImplyFixture is an empty marker interface used by attributes like + TestAttribute that cause the class where they are used to be treated + as a TestFixture even without a TestFixtureAttribute. + + Marker interfaces are not usually considered a good practice, but + we use it here to avoid cluttering the attribute hierarchy with + classes that don't contain any extra implementation. + + + + + The IMethodInfo class is used to encapsulate information + about a method in a platform-independent manner. + + + + + Gets the Type from which this method was reflected. + + + + + Gets the MethodInfo for this method. + + + + + Gets the name of the method. + + + + + Gets a value indicating whether the method is abstract. + + + + + Gets a value indicating whether the method is public. + + + + + Gets a value indicating whether the method contains unassigned generic type parameters. + + + + + Gets a value indicating whether the method is a generic method. + + + + + Gets a value indicating whether the MethodInfo represents the definition of a generic method. + + + + + Gets the return Type of the method. + + + + + Gets the parameters of the method. + + + + + + Returns the Type arguments of a generic method or the Type parameters of a generic method definition. + + + + + Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo. + + The type arguments to be used + A new IMethodInfo with the type arguments replaced + + + + Invokes the method, converting any TargetInvocationException to an NUnitException. + + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + Provides data for a single test parameter. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test. + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + Provides data for a single test parameter. + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + The IParameterInfo interface is an abstraction of a .NET parameter. + + + + + Gets a value indicating whether the parameter is optional + + + + + Gets an IMethodInfo representing the method for which this is a parameter + + + + + Gets the underlying .NET ParameterInfo + + + + + Gets the Type of the parameter + + + + + Implemented by filters for use in deciding which + Types and Methods should be used to generate tests. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + A PropertyBag represents a collection of name/value pairs + that allows duplicate entries with the same key. Methods + are provided for adding a new pair as well as for setting + a key to a single value. All keys are strings but values + may be of any type. Null values are not permitted, since + a null entry represents the absence of the key. + + The entries in a PropertyBag are of two kinds: those that + take a single value and those that take multiple values. + However, the PropertyBag has no knowledge of which entries + fall into each category and the distinction is entirely + up to the code using the PropertyBag. + + When working with multi-valued properties, client code + should use the Add method to add name/value pairs and + indexing to retrieve a list of all values for a given + key. For example: + + bag.Add("Tag", "one"); + bag.Add("Tag", "two"); + Assert.That(bag["Tag"], + Is.EqualTo(new string[] { "one", "two" })); + + When working with single-valued properties, client code + should use the Set method to set the value and Get to + retrieve the value. The GetSetting methods may also be + used to retrieve the value in a type-safe manner while + also providing default. For example: + + bag.Set("Priority", "low"); + bag.Set("Priority", "high"); // replaces value + Assert.That(bag.Get("Priority"), + Is.EqualTo("high")); + Assert.That(bag.GetSetting("Priority", "low"), + Is.EqualTo("high")); + + + + + Adds a key/value pair to the property bag + + The key + The value + + + + Sets the value for a key, removing any other + values that are already in the property set. + + + + + + + Gets a single value for a key, using the first + one if multiple values are present and returning + null if the value is not found. + + + + + Gets a flag indicating whether the specified key has + any entries in the property set. + + The key to be checked + True if their are values present, otherwise false + + + + Gets or sets the list of values for a particular key + + The key for which the values are to be retrieved or set + + + + Gets a collection containing all the keys in the property set + + + + + The IReflectionInfo interface is implemented by NUnit wrapper objects that perform reflection. + + + + + Returns an array of custom attributes of the specified type applied to this object + + + + + Returns a value indicating whether an attribute of the specified type is defined on this object. + + + + + The ISimpleTestBuilder interface is exposed by a class that knows how to + build a single tests from a specified method. In general, + it is exposed by an attribute, but it may be implemented in a helper class + used by the attribute in some cases. + + + + + Builds a single test from the specified method and context. + + The method to be used as a test + The TestSuite to which the method will be added + + + + The ISuiteBuilder interface is exposed by a class that knows how to + build a single test suite from a specified type. + + + + + Examine the type and determine if it is suitable for + this builder to use in building a TestSuite. + + Note that returning false will cause the type to be ignored + in loading the tests. If it is desired to load the suite + but label it as non-runnable, ignored, etc., then this + method must return true. + + The type of the fixture to be used + + + + Builds a single test suite from the specified type. + + The type of the fixture to be used + + + + Builds a single test suite from the specified type, subject + to a filter that decides which methods are included. + + The type of the fixture to be used + A PreFilter for selecting methods. + + + + Common interface supported by all representations + of a test. Only includes informational fields. + The Run method is specifically excluded to allow + for data-only representations of a test. + + + + + Gets the id of the test + + + + + Gets the name of the test + + + + + Gets the type of the test + + + + + Gets the fully qualified name of the test + + + + + Gets the name of the class containing this test. Returns + null if the test is not associated with a class. + + + + + Gets the name of the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + Gets the Type of the test fixture, if applicable, or + null if no fixture type is associated with this test. + + + + + Gets the method which declares the test, or + if no method is associated with this test. + + + + + Gets the RunState of the test, indicating whether it can be run. + + + + + Count of the test cases ( 1 if this is a test case ) + + + + + Gets the properties of the test + + + + + Gets the parent test, if any. + + The parent test or null if none exists. + + + + Returns true if this is a test suite + + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets this test's child tests + + A list of child tests + + + + Gets a fixture object for running this test. + + + + + The arguments to use in creating the test or empty array if none are required. + + + + + The ITestBuilder interface is exposed by a class that knows how to + build tests from a specified method. In general, it is exposed + by an attribute which has additional information available to provide + the necessary test parameters to distinguish the test cases built. + + + + + Builds any number of tests from the specified method and context. + + The method to be used as a test + The TestSuite to which the method will be added + + + + The ITestCaseBuilder interface is exposed by a class that knows how to + build a test from a specified method, possibly containing child test cases. + + + + + Examine the method and determine if it is suitable for + this builder to use in building a TestCase to be + included in the suite being populated. + + Note that returning false will cause the method to be ignored + in loading the tests. If it is desired to load the method + but label it as non-runnable, ignored, etc., then this + method must return true. + + The test method to examine + The suite being populated + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method to be used as a test case + The test suite being populated, or null + + + + The ITestCaseData interface is implemented by a class + that is able to return complete test cases for use by + a parameterized test method. + + + + + Gets the expected result of the test case + + + + + Returns true if an expected result has been set + + + + + The ITestData interface is implemented by a class that + represents a single instance of a parameterized test. + + + + + Gets the name to be used for the test + + + + + Gets the RunState for this test case. + + + + + Gets the argument list to be provided to the test + + + + + Gets the property dictionary for the test case + + + + + Interface to be implemented by filters applied to tests. + The filter applies when running the test, after it has been + loaded, since this is the only time an ITest exists. + + + + + Determine if a particular test passes the filter criteria. Pass + may examine the parents and/or descendants of a test, depending + on the semantics of the particular filter + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + The ITestCaseData interface is implemented by a class + that is able to return the data required to create an + instance of a parameterized test fixture. + + + + + Get the TypeArgs if separately set + + + + + The ITestListener interface is used internally to receive + notifications of significant events while a test is being + run. The events are propagated to clients by means of an + AsyncCallback. NUnit extensions may also monitor these events. + + + + + Called when a test has just started + + The test that is starting + + + + Called when a test has finished + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + The ITestResult interface represents the result of a test. + + + + + Gets the ResultState of the test result, which + indicates the success or failure of the test. + + + + + Gets the name of the test result + + + + + Gets the full name of the test result + + + + + Gets the elapsed time for running the test in seconds + + + + + Gets or sets the time the test started running. + + + + + Gets or sets the time the test finished running. + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + Gets the number of asserts executed + when running the test and all its children. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + Accessing HasChildren should not force creation of the + Children collection in classes implementing this interface. + + + + + Gets the collection of child results. + + + + + Gets the Test to which this result applies. + + + + + Gets any text output written to this result. + + + + + Gets a list of AssertionResults associated with the test + + + + + Gets the collection of files attached to the test + + + + + The ITypeInfo interface is an abstraction of a .NET Type + + + + + Gets the underlying Type on which this ITypeInfo is based + + + + + Gets the base type of this type as an ITypeInfo + + + + + Returns true if the Type wrapped is equal to the argument + + + + + Gets the name of the Type + + + + + Gets the full name of the Type + + + + + Gets the assembly in which the type is declared + + + + + Gets the namespace of the Type + + + + + Gets a value indicating whether the type is abstract. + + + + + Gets a value indicating whether the Type is a generic Type + + + + + Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types. + + + + + Gets a value indicating whether the Type is a generic Type definition + + + + + Gets a value indicating whether the type is sealed. + + + + + Gets a value indicating whether this type is a static class. + + + + + Get the display name for this typeInfo. + + + + + Get the display name for an object of this type, constructed with specific arguments + + + + + Returns a Type representing a generic type definition from which this Type can be constructed. + + + + + Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments + + + + + Returns a value indicating whether this type has a method with a specified public attribute + + + + + Returns an array of IMethodInfos for methods of this Type + that match the specified flags. + + + + + Gets the public constructor taking the specified argument Types + + + + + Returns a value indicating whether this Type has a public constructor taking the specified argument Types. + + + + + Construct an object of this Type, using the specified arguments. + + + + + An object implementing IXmlNodeBuilder is able to build + an XML representation of itself and any children. + + + + + Returns a TNode representing the current object. + + If true, children are included where applicable + A TNode representing the result + + + + Returns a TNode representing the current object after + adding it as a child of the supplied parent node. + + The parent node. + If true, children are included, where applicable + + + + + The ResultState class represents the outcome of running a test. + It contains two pieces of information. The Status of the test + is an enum indicating whether the test passed, failed, was + skipped or was inconclusive. The Label provides a more + detailed breakdown for use by client runners. + + + + + Initializes a new instance of the class. + + The TestStatus. + + + + Initializes a new instance of the class. + + The TestStatus. + The label. + + + + Initializes a new instance of the class. + + The TestStatus. + The stage at which the result was produced + + + + Initializes a new instance of the class. + + The TestStatus. + The label. + The stage at which the result was produced + + + + The result is inconclusive + + + + + The test has been skipped. + + + + + The test has been ignored. + + + + + The test was skipped because it is explicit + + + + + The test succeeded + + + + + The test issued a warning + + + + + The test failed + + + + + The test encountered an unexpected exception + + + + + The test was cancelled by the user + + + + + The test was not runnable. + + + + + A suite failed because one or more child tests failed or had errors + + + + + A suite failed because one or more child tests had warnings + + + + + A suite is marked ignored because one or more child tests were ignored + + + + + A suite failed in its OneTimeSetUp + + + + + A suite had an unexpected exception in its OneTimeSetUp + + + + + A suite had an unexpected exception in its OneTimeDown + + + + + Gets the TestStatus for the test. + + The status. + + + + Gets the label under which this test result is + categorized, if any. + + + + + Gets the stage of test execution in which + the failure or other result took place. + + + + + Get a new ResultState, which is the same as the current + one but with the FailureSite set to the specified value. + + The FailureSite to use + A new ResultState + + + + Test whether this ResultState has the same Status and Label + as another one. In other words, the whether two are equal + ignoring the Site. + + + + + + + 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. + + + + + Overload == operator for ResultStates + + + + + Overload != operator for ResultStates + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + The FailureSite enum indicates the stage of a test + in which an error or failure occurred. + + + + + Failure in the test itself + + + + + Failure in the SetUp method + + + + + Failure in the TearDown method + + + + + Failure of a parent test + + + + + Failure of a child test + + + + + The RunState enum indicates whether a test can be executed. + + + + + The test is not runnable. + + + + + The test is runnable. + + + + + The test can only be run explicitly + + + + + The test has been skipped. This value may + appear on a Test when certain attributes + are used to skip the test. + + + + + The test has been ignored. May appear on + a Test, when the IgnoreAttribute is used. + + + + + The TestAttachment class represents a file attached to a TestResult, + with an optional description. + + + + + Absolute file path to attachment file + + + + + User specifed description of attachment. May be null. + + + + + Creates a TestAttachment class to represent a file attached to a test result. + + Absolute file path to attachment file + User specifed description of attachment. May be null. + + + + The class holds a message sent by a test to all listeners + + + + + Construct with text, destination type and + the name of the test that produced the message. + + Destination of the message + Text to be sent + ID of the test that produced the message + + + + Converts object to string + + + + + The message to send to listeners + + + + + The Destination of the message. + + + + + The ID of the test that sent the message + + + + + Returns the XML representation of the object. + + + + + The TestOutput class holds a unit of output from + a test to a specific output stream + + + + + Construct with text, output destination type and + the name of the test that produced the output. + + Text to be output + Name of the stream or channel to which the text should be written + Id of the test that produced the output + FullName of test that produced the output + + + + Return string representation of the object for debugging + + + + + + Get the text + + + + + Get the output type + + + + + Get the name of the test that created the output + + + + + Get the id of the test that created the output + + + + + Convert the TestOutput object to an XML string + + + + + The TestStatus enum indicates the result of running a test + + + + + The test was inconclusive + + + + + The test has skipped + + + + + The test succeeded + + + + + There was a warning + + + + + The test failed + + + + + TNode represents a single node in the XML representation + of a Test or TestResult. It replaces System.Xml.XmlNode and + System.Xml.Linq.XElement, providing a minimal set of methods + for operating on the XML in a platform-independent manner. + + + + + Constructs a new instance of TNode + + The name of the node + + + + Constructs a new instance of TNode with a value + + The name of the node + The text content of the node + + + + Constructs a new instance of TNode with a value + + The name of the node + The text content of the node + Flag indicating whether to use CDATA when writing the text + + + + Gets the name of the node + + + + + Gets the value of the node + + + + + Gets a flag indicating whether the value should be output using CDATA. + + + + + Gets the dictionary of attributes + + + + + Gets a list of child nodes + + + + + Gets the first ChildNode + + + + + Gets the XML representation of this node. + + + + + Create a TNode from its XML text representation + + The XML text to be parsed + A TNode + + + + Adds a new element as a child of the current node and returns it. + + The element name. + The newly created child element + + + + Adds a new element with a value as a child of the current node and returns it. + + The element name + The text content of the new element + The newly created child element + + + + Adds a new element with a value as a child of the current node and returns it. + The value will be output using a CDATA section. + + The element name + The text content of the new element + The newly created child element + + + + Adds an attribute with a specified name and value to the XmlNode. + + The name of the attribute. + The value of the attribute. + + + + Finds a single descendant of this node matching an XPath + specification. The format of the specification is + limited to what is needed by NUnit and its tests. + + + + + + + Finds all descendants of this node matching an XPath + specification. The format of the specification is + limited to what is needed by NUnit and its tests. + + + + + Writes the XML representation of the node to an XmlWriter + + + + + + Class used to represent a list of XmlResults + + + + + Class used to represent the attributes of a node + + + + + Gets or sets the value associated with the specified key. + Overridden to return null if attribute is not found. + + The key. + Value of the attribute or null + + + + AssemblyHelper provides static methods for working + with assemblies. + + + + + Gets the path from which an assembly was loaded. + For builds where this is not possible, returns + the name of the assembly. + + The assembly. + The path. + + + + Gets the path to the directory from which an assembly was loaded. + + The assembly. + The path. + + + + Gets the AssemblyName of an assembly. + + The assembly + An AssemblyName + + + + Loads an assembly given a string, which may be the + path to the assembly or the AssemblyName + + + + + Gets the assembly path from code base. + + Public for testing purposes + The code base. + + + + + CombinatorialStrategy creates test cases by using all possible + combinations of the parameter data. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + Provides data from fields marked with the DatapointAttribute or the + DatapointsAttribute. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + Built-in SuiteBuilder for all types of test classes. + + + + + Examine the type and determine if it is suitable for + this builder to use in building a TestSuite. + + Note that returning false will cause the type to be ignored + in loading the tests. If it is desired to load the suite + but label it as non-runnable, ignored, etc., then this + method must return true. + + The fixture type to check + + + + Builds a single test suite from the specified type. + + The fixture type to build + + + + Builds a single test suite from the specified type, subject + to a filter that decides which methods are included. + + The fixture type to build + A PreFilter for selecting methods. + + + + We look for attributes implementing IFixtureBuilder at one level + of inheritance at a time. Attributes on base classes are not used + unless there are no fixture builder attributes at all on the derived + class. This is by design. + + The type being examined for attributes + + + + Class to build ether a parameterized or a normal NUnitTestMethod. + There are four cases that the builder must deal with: + 1. The method needs no params and none are provided + 2. The method needs params and they are provided + 3. The method needs no params but they are provided in error + 4. The method needs params but they are not provided + This could have been done using two different builders, but it + turned out to be simpler to have just one. The BuildFrom method + takes a different branch depending on whether any parameters are + provided, but all four cases are dealt with in lower-level methods + + + + + Determines if the method can be used to build an NUnit test + test method of some kind. The method must normally be marked + with an identifying attribute for this to be true. + + Note that this method does not check that the signature + of the method for validity. If we did that here, any + test methods with invalid signatures would be passed + over in silence in the test run. Since we want such + methods to be reported, the check for validity is made + in BuildFrom rather than here. + + An IMethodInfo for the method being used as a test method + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method for which a test is to be built + + + + Determines if the method can be used to build an NUnit test + test method of some kind. The method must normally be marked + with an identifying attribute for this to be true. + + Note that this method does not check that the signature + of the method for validity. If we did that here, any + test methods with invalid signatures would be passed + over in silence in the test run. Since we want such + methods to be reported, the check for validity is made + in BuildFrom rather than here. + + An IMethodInfo for the method being used as a test method + The test suite being built, to which the new test would be added + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method for which a test is to be built + The test fixture being populated, or null + + + + Builds a ParameterizedMethodSuite containing individual test cases. + + The method for which a test is to be built. + The list of test cases to include. + + + + Build a simple, non-parameterized TestMethod for this method. + + The MethodInfo for which a test is to be built + The test suite for which the method is being built + + + + Class that can build a tree of automatic namespace + suites from a group of fixtures. + + + + + NamespaceDictionary of all test suites we have created to represent + namespaces. Used to locate namespace parent suites for fixtures. + + + + + Point in the tree where items in the global namespace are added + + + + + Initializes a new instance of the class. + + The root suite. + + + + Gets the root entry in the tree created by the NamespaceTreeBuilder. + + The root suite. + + + + Adds the specified fixtures to the tree. + + The fixtures to be added. + + + + Adds the specified fixture to the tree. + + The fixture to be added. + + + + NUnitTestCaseBuilder is a utility class used by attributes + that build test cases. + + + + + Constructs an + + + + + Builds a single NUnitTestMethod, either as a child of the fixture + or as one of a set of test cases under a ParameterizedTestMethodSuite. + + The MethodInfo from which to construct the TestMethod + The suite or fixture to which the new test will be added + The ParameterSet to be used, or null + + + + Checks to see if we have valid combinations of attributes. + + The TestMethod to be checked. If it + is found to be non-runnable, it will be modified. + True if the method signature is valid, false if not + + + + Helper method that checks the signature of a TestMethod and + any supplied parameters to determine if the test is valid. + + Currently, NUnitTestMethods are required to be public, + non-abstract methods, either static or instance, + returning void. They may take arguments but the values must + be provided or the TestMethod is not considered runnable. + + Methods not meeting these criteria will be marked as + non-runnable and the method will return false in that case. + + The TestMethod to be checked. If it + is found to be non-runnable, it will be modified. + Parameters to be used for this test, or null + True if the method signature is valid, false if not + + The return value is no longer used internally, but is retained + for testing purposes. + + + + + NUnitTestFixtureBuilder is able to build a fixture given + a class marked with a TestFixtureAttribute or an unmarked + class containing test methods. In the first case, it is + called by the attribute and in the second directly by + NUnitSuiteBuilder. + + + + + Build a TestFixture from type provided. A non-null TestSuite + must always be returned, since the method is generally called + because the user has marked the target class as a fixture. + If something prevents the fixture from being used, it should + be returned nonetheless, labelled as non-runnable. + + An ITypeInfo for the fixture to be used. + Filter used to select methods as tests. + A TestSuite object or one derived from TestSuite. + + + + Overload of BuildFrom called by tests that have arguments. + Builds a fixture using the provided type and information + in the ITestFixtureData object. + + The TypeInfo for which to construct a fixture. + Filter used to select methods as tests. + An object implementing ITestFixtureData or null. + + + + + Method to add test cases to the newly constructed fixture. + + + + + Method to create a test case from a MethodInfo and add + it to the fixture being built. It first checks to see if + any global TestCaseBuilder addin wants to build the + test case. If not, it uses the internal builder + collection maintained by this fixture builder. + + The default implementation has no test case builders. + Derived classes should add builders to the collection + in their constructor. + + The method for which a test is to be created + The test suite being built. + A newly constructed Test + + + + PairwiseStrategy creates test cases by combining the parameter + data so that all possible pairs of data items are used. + + + + The number of test cases that cover all possible pairs of test function + parameters values is significantly less than the number of test cases + that cover all possible combination of test function parameters values. + And because different studies show that most of software failures are + caused by combination of no more than two parameters, pairwise testing + can be an effective ways to test the system when it's impossible to test + all combinations of parameters. + + + The PairwiseStrategy code is based on "jenny" tool by Bob Jenkins: + http://burtleburtle.net/bob/math/jenny.html + + + + + + FleaRand is a pseudo-random number generator developed by Bob Jenkins: + http://burtleburtle.net/bob/rand/talksmall.html#flea + + + + + Initializes a new instance of the FleaRand class. + + The seed. + + + + FeatureInfo represents coverage of a single value of test function + parameter, represented as a pair of indices, Dimension and Feature. In + terms of unit testing, Dimension is the index of the test parameter and + Feature is the index of the supplied value in that parameter's list of + sources. + + + + + Initializes a new instance of FeatureInfo class. + + Index of a dimension. + Index of a feature. + + + + A FeatureTuple represents a combination of features, one per test + parameter, which should be covered by a test case. In the + PairwiseStrategy, we are only trying to cover pairs of features, so the + tuples actually may contain only single feature or pair of features, but + the algorithm itself works with triplets, quadruples and so on. + + + + + Initializes a new instance of FeatureTuple class for a single feature. + + Single feature. + + + + Initializes a new instance of FeatureTuple class for a pair of features. + + First feature. + Second feature. + + + + TestCase represents a single test case covering a list of features. + + + + + Initializes a new instance of TestCaseInfo class. + + A number of features in the test case. + + + + PairwiseTestCaseGenerator class implements an algorithm which generates + a set of test cases which covers all pairs of possible values of test + function. + + + + The algorithm starts with creating a set of all feature tuples which we + will try to cover (see method). This set + includes every single feature and all possible pairs of features. We + store feature tuples in the 3-D collection (where axes are "dimension", + "feature", and "all combinations which includes this feature"), and for + every two feature (e.g. "A" and "B") we generate both ("A", "B") and + ("B", "A") pairs. This data structure extremely reduces the amount of + time needed to calculate coverage for a single test case (this + calculation is the most time-consuming part of the algorithm). + + + Then the algorithm picks one tuple from the uncovered tuple, creates a + test case that covers this tuple, and then removes this tuple and all + other tuples covered by this test case from the collection of uncovered + tuples. + + + Picking a tuple to cover + + + There are no any special rules defined for picking tuples to cover. We + just pick them one by one, in the order they were generated. + + + Test generation + + + Test generation starts from creating a completely random test case which + covers, nevertheless, previously selected tuple. Then the algorithm + tries to maximize number of tuples which this test covers. + + + Test generation and maximization process repeats seven times for every + selected tuple and then the algorithm picks the best test case ("seven" + is a magic number which provides good results in acceptable time). + + Maximizing test coverage + + To maximize tests coverage, the algorithm walks through the list of mutable + dimensions (mutable dimension is a dimension that are not included in + the previously selected tuple). Then for every dimension, the algorithm + walks through the list of features and checks if this feature provides + better coverage than randomly selected feature, and if yes keeps this + feature. + + + This process repeats while it shows progress. If the last iteration + doesn't improve coverage, the process ends. + + + In addition, for better results, before start every iteration, the + algorithm "scrambles" dimensions - so for every iteration dimension + probes in a different order. + + + + + + Creates a set of test cases for specified dimensions. + + + An array which contains information about dimensions. Each element of + this array represents a number of features in the specific dimension. + + + A set of test cases. + + + + + Gets the test cases generated by this strategy instance. + + A set of test cases. + + + + The ParameterDataProvider class implements IParameterDataProvider + and hosts one or more individual providers. + + + + + Construct with a collection of individual providers + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + ParameterDataSourceProvider supplies individual argument values for + single parameters using attributes implementing IParameterDataSource. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + SequentialStrategy creates test cases by using all of the + parameter data sources in parallel, substituting null + when any of them run out of data. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + TestActionAfterCommand handles the AfterTest method of a single + TestActionItem, provided the items BeforeTest has been run. + + + + + Initializes a new instance of the class. + + The inner command. + The TestActionItem to run before the inner command. + + + + AfterCommand is a DelegatingTestCommand that performs some + specific action after the inner command is run. + + + + + Construct an AfterCommand + + + + + Execute the command + + + + + Set this to perform action after the inner command. + + + + + ContextSettingsCommand applies specified changes to the + TestExecutionContext prior to running a test. No special + action is needed after the test runs, since the prior + context will be restored automatically. + + + + + TestActionCommand handles a single ITestAction applied + to a test. It runs the BeforeTest method, then runs the + test and finally runs the AfterTest method. + + + + + Initializes a new instance of the class. + + The inner command. + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Perform the before test action + + + + + Perform the after test action + + + + + TestActionBeforeCommand handles the BeforeTest method of a single + TestActionItem, relying on the item to remember it has been run. + + + + + Initializes a new instance of the class. + + The inner command. + The TestActionItem to run before the inner command. + + + + BeforeTestCommand is a DelegatingTestCommand that performs some + specific action before the inner command is run. + + + + + Construct a BeforeCommand + + + + + Execute the command + + + + + Action to perform before the inner command. + + + + + ConstructFixtureCommand constructs the user test object if necessary. + + + + + Constructs a OneTimeSetUpCommand for a suite + + The inner command to which the command applies + + + + DelegatingTestCommand wraps an inner TestCommand. + Derived classes may do what they like before or + after running the inner command. + + + + TODO: Documentation needed for field + + + + TODO: Documentation needed for constructor + + + + + + OneTimeTearDownCommand performs any teardown actions + specified for a suite and calls Dispose on the user + test object, if any. + + + + + Construct a OneTimeTearDownCommand + + The command wrapped by this command + + + + EmptyTestCommand is a TestCommand that does nothing. It simply + returns the current result from the context when executed. We + use it to avoid testing for null when executing a chain of + DelegatingTestCommands. + + + + + Construct a NullCommand for a test + + + + + Execute the command + + + + + TODO: Documentation needed for class + + + + + Initializes a new instance of the class. + + The inner command. + The max time allowed in milliseconds + + + + OneTimeSetUpCommand runs any one-time setup methods for a suite, + constructing the user test object if necessary. + + + + + Constructs a OneTimeSetUpCommand for a suite + + The inner command to which the command applies + A SetUpTearDownList for use by the command + + + + OneTimeTearDownCommand performs any teardown actions + specified for a suite and calls Dispose on the user + test object, if any. + + + + + Construct a OneTimeTearDownCommand + + The command wrapped by this command + A SetUpTearDownList for use by the command + + + + SetUpTearDownCommand runs SetUp methods for a suite, + runs the test and then runs TearDown methods. + + + + + Initializes a new instance of the class. + + The inner command. + List of setup/teardown items + + + + SetUpTearDownItem holds the setup and teardown methods + for a single level of the inheritance hierarchy. + + + + + Construct a SetUpTearDownNode + + A list of setup methods for this level + A list teardown methods for this level + + + + Returns true if this level has any methods at all. + This flag is used to discard levels that do nothing. + + + + + Run SetUp on this level. + + The execution context to use for running. + + + + Run TearDown for this level. + + + + + + TODO: Documentation needed for class + + + + + Initializes a new instance of the class. + + The test being skipped. + + + + Overridden to simply set the CurrentResult to the + appropriate Skipped state. + + The execution context for the test + A TestResult + + + + TestActionCommand handles a single ITestAction applied + to a test. It runs the BeforeTest method, then runs the + test and finally runs the AfterTest method. + + + + + Initializes a new instance of the class. + + The inner command. + The TestAction with which to wrap the inner command. + + + + TestActionItem wraps a single execution of an ITestAction. + Its primary purpose is to track whether the BeforeTest + method has been called and suppress calling the + AfterTest method if it has not. This is necessary when + ITestActions are used before and after a CompositeWorkItem, + since the OneTimeSetUpCommand and OneTimeTearDownCommand + are separate command chains. By sharing a TestActionItem + between the setup and teardown chains, the two calls can + be coordinated. + + + + + Construct a TestActionItem + + The ITestAction to be included + + + + Get flag indicating if the BeforeTest entry was already called. + + + + + Run the BeforeTest method of the action and remember that it has been run. + + The test to which the action applies + + + + Run the AfterTest action, but only if the BeforeTest + action was actually run. + + The test to which the action applies + + + + TestCommand is the abstract base class for all test commands + in the framework. A TestCommand represents a single stage in + the execution of a test, e.g.: SetUp/TearDown, checking for + Timeout, verifying the returned result from a method, etc. + + TestCommands may decorate other test commands so that the + execution of a lower-level command is nested within that + of a higher level command. All nested commands are executed + synchronously, as a single unit. Scheduling test execution + on separate threads is handled at a higher level, using the + task dispatcher. + + + + + Construct a TestCommand for a test. + + The test to be executed + + + + Gets the test associated with this command. + + + + + Runs the test in a specified context, returning a TestResult. + + The TestExecutionContext to be used for running the test. + A TestResult + + + + TestMethodCommand is the lowest level concrete command + used to run actual test cases. + + + + + Initializes a new instance of the class. + + The test. + + + + Runs the test, saving a TestResult in the execution context, as + well as returning it. If the test has an expected result, it + is asserts on that value. Since failed tests and errors throw + an exception, this command must be wrapped in an outer command, + will handle that exception and records the failure. This role + is usually played by the SetUpTearDown command. + + The execution context + + + + TheoryResultCommand adjusts the result of a Theory so that + it fails if all the results were inconclusive. + + + + + Constructs a TheoryResultCommand + + The command to be wrapped by this one + + + + TimeoutCommand creates a timer in order to cancel + a test if it exceeds a specified time and adjusts + the test result if it did time out. + + + + + Initializes a new instance of the class. + + The inner command + Timeout value + + + + Provides methods to support consistent checking in constraints. + + + + + Requires that the provided object is actually of the type required. + + The object to verify. + Name of the parameter as passed into the checking method. + + If and can be null, returns null rather than throwing when is null. + If cannot be null, this parameter is ignored. + The type to require. + + + + CultureDetector is a helper class used by NUnit to determine + whether a test should be run based on the current culture. + + + + + Default constructor uses the current culture. + + + + + Construct a CultureDetector for a particular culture for testing. + + The culture to be used + + + + Test to determine if one of a collection of cultures + is being used currently. + + + + + + + Tests to determine if the current culture is supported + based on a culture attribute. + + The attribute to examine + + + + + Test to determine if the a particular culture or comma- + delimited set of cultures is in use. + + Name of the culture or comma-separated list of culture ids + True if the culture is in use on the system + + + + Return the last failure reason. Results are not + defined if called before IsSupported( Attribute ) + is called. + + + + + ExceptionHelper provides static methods for working with exceptions + + + + + Rethrows an exception, preserving its stack trace + + The exception to rethrow + + + + Builds up a message, using the Message field of the specified exception + as well as any InnerExceptions. Optionally excludes exception names, + creating a more readable message. + + The exception. + Flag indicating whether exception names should be excluded. + A combined message string. + + + + Builds up a message, using the Message field of the specified exception + as well as any InnerExceptions. + + The exception. + A combined stack trace. + + + + Gets the stack trace of the exception. If no stack trace + is provided, returns "No stack trace available". + + The exception. + A string representation of the stack trace. + + + + A CompositeWorkItem represents a test suite and + encapsulates the execution of the suite as well + as all its child tests. + + + + + List of Child WorkItems + + + + + Indicates whether this work item should use a separate dispatcher. + + + + + Construct a CompositeWorkItem for executing a test suite + using a filter to select child tests. + + The TestSuite to be executed + A filter used to select child tests + + + + Method that actually performs the work. Overridden + in CompositeWorkItem to do one-time setup, run all child + items and then dispatch the one-time teardown work item. + + + + + + + + + + Cancel (abort or stop) a CompositeWorkItem and all of its children + + true if the CompositeWorkItem and all of its children should be aborted, false if it should allow all currently running tests to complete + + + + OneTimeTearDownWorkItem represents the cleanup + and one-time teardown phase of a CompositeWorkItem + + + + + Construct a OneTimeTearDownWOrkItem wrapping a CompositeWorkItem + + The CompositeWorkItem being wrapped + + + + The WorkItem name, overridden to indicate this is the teardown. + + + + + The ExecutionStrategy for use in running this work item + + + + + + + + + + PerformWork is not used in CompositeWorkItem + + + + + EventListenerTextWriter sends text output to the currently active + ITestEventListener in the form of a TestOutput object. If no event + listener is active in the context, or if there is no context, + the output is forwarded to the supplied default writer. + + + + + Construct an EventListenerTextWriter + + The name of the stream to use for events + The default writer to use if no listener is available + + + + Get the Encoding for this TextWriter + + + + + Write formatted string + + + + + Write formatted string + + + + + Write formatted string + + + + + Write an object + + + + + Write a string + + + + + Write a decimal + + + + + Write a double + + + + + Write formatted string + + + + + Write a ulong + + + + + Write a long + + + + + Write a uint + + + + + Write an int + + + + + Write a char + + + + + Write a boolean + + + + + Write chars + + + + + Write chars + + + + + Write a float + + + + + Write a string with newline + + + + + Write an object with newline + + + + + Write formatted string with newline + + + + + Write formatted string with newline + + + + + Write formatted string with newline + + + + + Write a decimal with newline + + + + + Write a formatted string with newline + + + + + Write a double with newline + + + + + Write a uint with newline + + + + + Write a ulong with newline + + + + + Write a long with newline + + + + + Write an int with newline + + + + + Write a bool with newline + + + + + Write chars with newline + + + + + Write chars with newline + + + + + Write a char with newline + + + + + Write a float with newline + + + + + Write newline + + + + + The EventPumpState enum represents the state of an + EventPump. + + + + + The pump is stopped + + + + + The pump is pumping events with no stop requested + + + + + The pump is pumping events but a stop has been requested + + + + + EventPump pulls events out of an EventQueue and sends + them to a listener. It is used to send events back to + the client without using the CallContext of the test + runner thread. + + + + + The downstream listener to which we send events + + + + + The queue that holds our events + + + + + Thread to do the pumping + + + + + The current state of the event pump + + + + + Constructor + + The EventListener to receive events + The event queue to pull events from + + + + Gets or sets the current state of the pump + + + + + Gets or sets the name of this EventPump + (used only internally and for testing). + + + + + Dispose stops the pump + Disposes the used WaitHandle, too. + + + + + Start the pump + + + + + Tell the pump to stop after emptying the queue. + + + + + Our thread proc for removing items from the event + queue and sending them on. Note that this would + need to do more locking if any other thread were + removing events from the queue. + + + + + NUnit.Core.Event is the abstract base for all stored events. + An Event is the stored representation of a call to the + ITestListener interface and is used to record such calls + or to queue them for forwarding on another thread or at + a later time. + + + + + The Send method is implemented by derived classes to send the event to the specified listener. + + The listener. + + + + TestStartedEvent holds information needed to call the TestStarted method. + + + + + Initializes a new instance of the class. + + The test. + + + + Calls TestStarted on the specified listener. + + The listener. + + + + TestFinishedEvent holds information needed to call the TestFinished method. + + + + + Initializes a new instance of the class. + + The result. + + + + Calls TestFinished on the specified listener. + + The listener. + + + + TestOutputEvent holds information needed to call the TestOutput method. + + + + + Initializes a new instance of the class. + + The output object. + + + + Calls TestOutput on the specified listener. + + The listener. + + + + TestMessageEvent holds information needed to call the SendMessage method. + + + + + Initializes a new instance of the class. + + The test message object. + + + + Calls on the specified listener. + + The listener. + + + + Holds object for sending to all listeners + + + + + Implements a queue of work items each of which + is queued as a WaitCallback. + + + + + Gets the count of items in the queue. + + + + + Enqueues the specified event + + The event to enqueue. + + + + Removes the first element from the queue and returns it (or null). + + + If true and the queue is empty, the calling thread is blocked until + either an element is enqueued, or is called. + + + + + If the queue not empty + the first element. + + + otherwise, if ==false + or has been called + null. + + + + + + + Stop processing of the queue + + + + + An IWorkItemDispatcher handles execution of work items. + + + + + The level of parallelism supported. Zero if not supported. + + + + + Start execution, performing any initialization. Sets + the top level work item and dispatches it. + + + + + Dispatch a single work item for execution. The first + work item dispatched is saved as the top-level + work item and used when stopping the run. + + The item to dispatch + + + + Cancel the ongoing run completely. + If no run is in process, the call has no effect. + + true if the IWorkItemDispatcher should abort all currently running WorkItems, false if it should allow all currently running WorkItems to complete + + + + MainThreadWorkItemDispatcher handles execution of WorkItems by + directly executing them on the main thread. This is different + from the SimpleWorkItemDispatcher where the work item is dispatched + onto its own thread. + + + + + The level of parallelism supported + + + + + Start execution, dispatching the top level + work into the main thread. + + + + + Dispatch a single work item for execution by + executing it directly. + The item to dispatch + + + + + This method is not supported for + this dispatcher. Using it will throw a + NotSupportedException. + + Not used + If used, it will always throw this. + + + + Enumeration representing the strategy to follow in executing a work item. + The value is only relevant when running under the parallel dispatcher. + + + + + Run directly on same thread + + + + + Enqueue for parallel execution + + + + + Enqueue for non-parallel execution + + + + + ParallelWorkItemDispatcher handles execution of work items by + queuing them for worker threads to process. + + + + + Event raised whenever a shift is starting. + + + + + Event raised whenever a shift has ended. + + + + + Construct a ParallelWorkItemDispatcher + + Number of workers to use + + + + Number of parallel worker threads + + + + + Enumerates all the shifts supported by the dispatcher + + + + + Enumerates all the Queues supported by the dispatcher + + + + + Start execution, setting the top level work, + enqueuing it and starting a shift to execute it. + + + + + Dispatch a single work item for execution. The first + work item dispatched is saved as the top-level + work item and used when stopping the run. + + The item to dispatch + + + + Cancel the ongoing run completely. + If no run is in process, the call has no effect. + + + + + Save the state of the queues and create a new isolated set + + + + + Remove isolated queues and restore old ones + + + + + QueuingEventListener uses an EventQueue to store any + events received on its EventListener interface. + + + + + The EventQueue created and filled by this listener + + + + + Construct a QueuingEventListener + + + + + A test has started + + The test that is starting + + + + A test case finished + + Result of the test case + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + A SimpleWorkItem represents a single test case and is + marked as completed immediately upon execution. This + class is also used for skipped or ignored test suites. + + + + + Construct a simple work item for a test. + + The test to be executed + The filter used to select this test + + + + Method that performs actually performs the work. + + + + + Creates a test command for use in running this test. + + A TestCommand + + + + SimpleWorkItemDispatcher handles execution of WorkItems by + directly executing them. It is provided so that a dispatcher + is always available in the context, thereby simplifying the + code needed to run child tests. + + + + + The level of parallelism supported + + + + + Start execution, creating the execution thread, + setting the top level work and dispatching it. + + + + + Dispatch a single work item for execution by + executing it directly. + The item to dispatch + + + + + Cancel (abort or stop) the ongoing run. + If no run is in process, the call has no effect. + + true if the run should be aborted, false if it should allow its currently running test to complete + + + + A TestWorker pulls work items from a queue + and executes them. + + + + + Event handler for TestWorker events + + The TestWorker sending the event + The WorkItem that caused the event + + + + Event signaled immediately before executing a WorkItem + + + + + Event signaled immediately after executing a WorkItem + + + + + Construct a new TestWorker. + + The queue from which to pull work items + The name of this worker + + + + The WorkItemQueue from which this worker pulls WorkItems + + + + + The name of this worker - also used for the thread + + + + + Indicates whether the worker thread is running + + + + + Our ThreadProc, which pulls and runs tests in a loop + + + + + Create thread and start processing work items. + + + + + Stop the thread, either immediately or after finishing the current WorkItem + + true if the thread should be aborted, false if it should allow the currently running test to complete + + + + The TextCapture class intercepts console output and writes it + to the current execution context, if one is present on the thread. + If no execution context is found, the output is written to a + default destination, normally the original destination of the + intercepted output. + + + + + Construct a TextCapture object + + The default destination for non-intercepted output + + + + Gets the Encoding in use by this TextWriter + + + + + Writes a single character + + The char to write + + + + Writes a string + + The string to write + + + + Writes a string followed by a line terminator + + The string to write + + + + A WorkItem may be an individual test case, a fixture or + a higher level grouping of tests. All WorkItems inherit + from the abstract WorkItem class, which uses the template + pattern to allow derived classes to perform work in + whatever way is needed. + + A WorkItem is created with a particular TestExecutionContext + and is responsible for re-establishing that context in the + current thread before it begins or resumes execution. + + + + + Construct a WorkItem for a particular test. + + The test that the WorkItem will run + Filter used to include or exclude child items + + + + Construct a work Item that wraps another work Item. + Wrapper items are used to represent independently + dispatched tasks, which form part of the execution + of a single test, such as OneTimeTearDown. + + The WorkItem being wrapped + + + + Initialize the TestExecutionContext. This must be done + before executing the WorkItem. + + + Originally, the context was provided in the constructor + but delaying initialization of the context until the item + is about to be dispatched allows changes in the parent + context during OneTimeSetUp to be reflected in the child. + + The TestExecutionContext to use + + + + Event triggered when the item is complete + + + + + Gets the current state of the WorkItem + + + + + The test being executed by the work item + + + + + The name of the work item - defaults to the Test name. + + + + + Filter used to include or exclude child tests + + + + + The execution context + + + + + The worker executing this item. + + + + + The ParallelExecutionStrategy to use for this work item + + + + + Indicates whether this work item should use a separate dispatcher. + + + + + The test result + + + + + Gets the ParallelScope associated with the test, if any, + otherwise returning ParallelScope.Default; + + + + + Execute the current work item, including any + child work items. + + + + + Wait until the execution of this item is complete + + + + + Marks the WorkItem as NotRunnable. + + Reason for test being NotRunnable. + + + + Cancel (abort or stop) a WorkItem + + true if the WorkItem should be aborted, false if it should run to completion + + + + Standard Dispose + + + + + Method that performs actually performs the work. It should + set the State to WorkItemState.Complete when done. + + + + + Method called by the derived class when all work is complete + + + + + Builds the set up tear down list. + + Unsorted array of setup MethodInfos. + Unsorted array of teardown MethodInfos. + A list of SetUpTearDownItems + + + + Changes the result of the test, logging the old and new states + + The new ResultState + The new message + + + + Recursively walks up the test hierarchy to see if the + has been set on any of the parent tests. + + + + + WorkItemBuilder class knows how to build a tree of work items from a tree of tests + + + + + Creates a work item. + + The test for which this WorkItem is being created. + The filter to be used in selecting any child Tests. + True if child work items should be created and added. + + + + + Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. + + + A signed integer that indicates the relative values of and , as shown in the following table.Value Meaning Less than zero is less than .Zero equals .Greater than zero is greater than . + + The first object to compare.The second object to compare. + + + + WorkItemQueueState indicates the current state of a WorkItemQueue + + + + + The queue is paused + + + + + The queue is running + + + + + The queue is stopped + + + + + A WorkItemQueue holds work items that are ready to + be run, either initially or after some dependency + has been satisfied. + + + + + Initializes a new instance of the class. + + The name of the queue. + Flag indicating whether this is a parallel queue + ApartmentState to use for items on this queue + + + + Gets the name of the work item queue. + + + + + Gets a flag indicating whether this queue is used for parallel execution + + + + + Gets the target ApartmentState for work items on this queue + + + + + Gets the total number of items processed so far + + + + + Gets the current state of the queue + + + + + Get a bool indicating whether the queue is empty. + + + + + Enqueue a WorkItem to be processed + + The WorkItem to process + + + + Enqueue a WorkItem to be processed - internal for testing + + The WorkItem to process + The priority at which to process the item + + + + Dequeue a WorkItem for processing + + A WorkItem or null if the queue has stopped + + + + Start or restart processing of items from the queue + + + + + Signal the queue to stop + + + + + Pause the queue for restarting later + + + + + Save the current inner queue and create new ones for use by + a non-parallel fixture with parallel children. + + + + + Restore the inner queue that was previously saved + + + + + The current state of a work item + + + + + Ready to run or continue + + + + + Work Item is executing + + + + + Complete + + + + + Handler for ShiftChange events. + + The shift that is starting or ending. + + + + The dispatcher needs to do different things at different, + non-overlapped times. For example, non-parallel tests may + not be run at the same time as parallel tests. We model + this using the metaphor of a working shift. The WorkShift + class associates one or more WorkItemQueues with one or + more TestWorkers. + + Work in the queues is processed until all queues are empty + and all workers are idle. Both tests are needed because a + worker that is busy may end up adding more work to one of + the queues. At that point, the shift is over and another + shift may begin. This cycle continues until all the tests + have been run. + + + + + Construct a WorkShift + + + + + Event that fires when the shift has ended + + + + + The Name of this shift + + + + + Gets a flag indicating whether the shift is currently active + + + + + Gets a bool indicating whether this shift has any work to do + + + + + Gets a list of the queues associated with this shift. + + Internal for testing - immutable once initialized + + + + Gets the list of workers associated with this shift. + + Internal for testing - immutable once initialized + + + + Add a WorkItemQueue to the shift, starting it if the + shift is currently active. + + + + + Assign a worker to the shift. + + + + + + Start or restart processing for the shift + + + + + End the shift, pausing all queues and raising + the EndOfShift event. + + + + + Shut down the shift. + + + + + Cancel (abort or stop) the shift without completing all work + + true if the WorkShift should be aborted, false if it should allow its currently running tests to complete + + + + 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. + + + + + + + Gets or sets the maximum line length for this writer + + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a given + 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 result of the constraint that failed + + + + Gets the unique type name between expected and actual. + + The expected value + The actual value causing the failure + Output of the unique type name for expected + Output of the unique type name for actual + + + + 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 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 ConstraintResult for which the actual value is to be written + + + + Write the generic 'Actual' line for a given value + + The actual value causing a failure + + + + Combines multiple filters so that a test must pass all + of them in order to pass this filter. + + + + + Constructs an empty AndFilter + + + + + Constructs an AndFilter from an array of filters + + + + + + Checks whether the AndFilter is matched by a test + + The test to be matched + True if all the component filters pass, otherwise false + + + + Checks whether the AndFilter is matched by a test + + The test to be matched + True if all the component filters match, otherwise false + + + + Checks whether the AndFilter is explicit matched by a test. + + The test to be matched + True if all the component filters explicit match, otherwise false + + + + Gets the element name + + Element name + + + + CategoryFilter is able to select or exclude tests + based on their categories. + + + + + Construct a CategoryFilter using a single category name + + A category name + + + + Check whether the filter matches a test + + The test to be matched + + + + + Gets the element name + + Element name + + + + ClassName filter selects tests based on the class FullName + + + + + Construct a FullNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + A base class for multi-part filters + + + + + Constructs an empty CompositeFilter + + + + + Constructs a CompositeFilter from an array of filters + + + + + + Adds a filter to the list of filters + + The filter to be added + + + + Return a list of the composing filters. + + + + + Checks whether the CompositeFilter is matched by a test. + + The test to be matched + + + + Checks whether the CompositeFilter is matched by a test. + + The test to be matched + + + + Checks whether the CompositeFilter is explicit matched by a test. + + The test to be matched + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + FullName filter selects tests based on their FullName + + + + + Construct a FullNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + IdFilter selects tests based on their id + + + + + Construct an IdFilter for a single value + + The id the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + FullName filter selects tests based on their FullName + + + + + Construct a MethodNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + ClassName filter selects tests based on the class FullName + + + + + Construct a NamespaceFilter for a single namespace + + The namespace the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + NotFilter negates the operation of another filter + + + + + Construct a not filter on another filter + + The filter to be negated + + + + Gets the base filter + + + + + Determine if a particular test passes the filter criteria. The default + implementation checks the test itself, its parents and any descendants. + + Derived classes may override this method or any of the Match methods + to change the behavior of the filter. + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Check whether the filter matches a test + + The test to be matched + True if it matches, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Combines multiple filters so that a test must pass one + of them in order to pass this filter. + + + + + Constructs an empty OrFilter + + + + + Constructs an AndFilter from an array of filters + + + + + + Checks whether the OrFilter is matched by a test + + The test to be matched + True if any of the component filters pass, otherwise false + + + + Checks whether the OrFilter is matched by a test + + The test to be matched + True if any of the component filters match, otherwise false + + + + Checks whether the OrFilter is explicit matched by a test + + The test to be matched + True if any of the component filters explicit match, otherwise false + + + + Gets the element name + + Element name + + + + PropertyFilter is able to select or exclude tests + based on their properties. + + + + + Construct a PropertyFilter using a property name and expected value + + A property name + The expected value of the property + + + + Check whether the filter matches a test + + The test to be matched + + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + TestName filter selects tests based on their Name + + + + + Construct a TestNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + ValueMatchFilter selects tests based on some value, which + is expected to be contained in the test. + + + + + Returns the value matched by the filter - used for testing + + + + + Indicates whether the value is a regular expression + + + + + Construct a ValueMatchFilter for a single value. + + The value to be included. + + + + Match the input provided by the derived class + + The value to be matchedT + True for a match, false otherwise. + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + GenericMethodHelper is able to deduce the Type arguments for + a generic method from the actual arguments provided. + + + + + A special value, which is used to indicate that BestCommonType() method + was unable to find a common type for the specified arguments. + + + + + Construct a GenericMethodHelper for a method + + MethodInfo for the method to examine + + + + Return the type arguments for the method, deducing them + from the arguments actually provided. + + The arguments to the method + If successful, an array of type arguments. + + + + InvalidTestFixtureException is thrown when an appropriate test + fixture constructor using the provided arguments cannot be found. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + InvalidPlatformException is thrown when the platform name supplied + to a test is not recognized. + + + + + Instantiates a new instance of the class. + + + + + Instantiates a new instance of the class + + The message. + + + + Instantiates a new instance of the class + + The message. + The inner. + + + + Serialization constructor for the class + + + + + InvalidTestFixtureException is thrown when an appropriate test + fixture constructor using the provided arguments cannot be found. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + Interface for logging within the engine + + + + + Logs the specified message at the error level. + + The message. + + + + Logs the specified message at the error level. + + The message. + The arguments. + + + + Logs the specified message at the warning level. + + The message. + + + + Logs the specified message at the warning level. + + The message. + The arguments. + + + + Logs the specified message at the info level. + + The message. + + + + Logs the specified message at the info level. + + The message. + The arguments. + + + + Logs the specified message at the debug level. + + The message. + + + + Logs the specified message at the debug level. + + The message. + The arguments. + + + + InternalTrace provides facilities for tracing the execution + of the NUnit framework. Tests and classes under test may make use + of Console writes, System.Diagnostics.Trace or various loggers and + NUnit itself traps and processes each of them. For that reason, a + separate internal trace is needed. + + Note: + InternalTrace uses a global lock to allow multiple threads to write + trace messages. This can easily make it a bottleneck so it must be + used sparingly. Keep the trace Level as low as possible and only + insert InternalTrace writes where they are needed. + TODO: add some buffering and a separate writer thread as an option. + TODO: figure out a way to turn on trace in specific classes only. + + + + + Gets a flag indicating whether the InternalTrace is initialized + + + + + Initialize the internal trace facility using the name of the log + to be written to and the trace level. + + The log name + The trace level + + + + Initialize the internal trace using a provided TextWriter and level + + A TextWriter + The InternalTraceLevel + + + + Get a named Logger + + + + + + Get a logger named for a particular Type. + + + + + InternalTraceLevel is an enumeration controlling the + level of detailed presented in the internal log. + + + + + Use the default settings as specified by the user. + + + + + Do not display any trace messages + + + + + Display Error messages only + + + + + Display Warning level and higher messages + + + + + Display informational and higher messages + + + + + Display debug messages and higher - i.e. all messages + + + + + Display debug messages and higher - i.e. all messages + + + + + A trace listener that writes to a separate file per domain + and process using it. + + + + + Construct an InternalTraceWriter that writes to a file. + + Path to the file to use + + + + Construct an InternalTraceWriter that writes to a + TextWriter provided by the caller. + + + + + + Returns the character encoding in which the output is written. + + The character encoding in which the output is written. + + + + Writes a character to the text string or stream. + + The character to write to the text stream. + + + + Writes a string to the text string or stream. + + The string to write. + + + + Writes a string followed by a line terminator to the text string or stream. + + The string to write. If is null, only the line terminator is written. + + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Clears all buffers for the current writer and causes any buffered data to be written to the underlying device. + + + + + Provides internal logging to the NUnit framework + + + + + Initializes a new instance of the class. + + The name. + The log level. + The writer where logs are sent. + + + + Logs the message at error level. + + The message. + + + + Logs the message at error level. + + The message. + The message arguments. + + + + Logs the message at warm level. + + The message. + + + + Logs the message at warning level. + + The message. + The message arguments. + + + + Logs the message at info level. + + The message. + + + + Logs the message at info level. + + The message. + The message arguments. + + + + Logs the message at debug level. + + The message. + + + + Logs the message at debug level. + + The message. + The message arguments. + + + + The MethodWrapper class wraps a MethodInfo so that it may + be used in a platform-independent manner. + + + + + Construct a MethodWrapper for a Type and a MethodInfo. + + + + + Construct a MethodInfo for a given Type and method name. + + + + + Gets the Type from which this method was reflected. + + + + + Gets the MethodInfo for this method. + + + + + Gets the name of the method. + + + + + Gets a value indicating whether the method is abstract. + + + + + Gets a value indicating whether the method is public. + + + + + Gets a value indicating whether the method contains unassigned generic type parameters. + + + + + Gets a value indicating whether the method is a generic method. + + + + + Gets a value indicating whether the MethodInfo represents the definition of a generic method. + + + + + Gets the return Type of the method. + + + + + Gets the parameters of the method. + + + + + + Returns the Type arguments of a generic method or the Type parameters of a generic method definition. + + + + + Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo. + + The type arguments to be used + A new IMethodInfo with the type arguments replaced + + + + Returns an array of custom attributes of the specified type applied to this method + + + + + Gets a value indicating whether one or more attributes of the specified type are defined on the method. + + + + + Invokes the method, converting any TargetInvocationException to an NUnitException. + + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + Override ToString() so that error messages in NUnit's own tests make sense + + + + + Thrown when an assertion failed. Here to preserve the inner + exception and hence its stack trace. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The error message that explains + the reason for the exception + + + + Initializes a new instance of the class. + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Enables the syntax. + + + + + Wraps an action so that it is executed when the returned object is disposed. + This disposal is thread-safe and the action will be executed at most once. + + + + + OSPlatform represents a particular operating system platform + + + + + Platform ID for Unix as defined by Microsoft .NET 2.0 and greater + + + + + Platform ID for Unix as defined by Mono + + + + + Platform ID for XBox as defined by .NET and Mono + + + + + Platform ID for MacOSX as defined by .NET and Mono + + + + + Get the OSPlatform under which we are currently running + + + + + Gets the actual OS Version, not the incorrect value that might be + returned for Win 8.1 and Win 10 + + + If an application is not manifested as Windows 8.1 or Windows 10, + the version returned from Environment.OSVersion will not be 6.3 and 10.0 + respectively, but will be 6.2 and 6.3. The correct value can be found in + the registry. + + The original version + The correct OS version + + + + Product Type Enumeration used for Windows + + + + + Product type is unknown or unspecified + + + + + Product type is Workstation + + + + + Product type is Domain Controller + + + + + Product type is Server + + + + + Construct from a platform ID and version + + + + + Construct from a platform ID, version and product type + + + + + Get the platform ID of this instance + + + + + Implemented to use in place of Environment.OSVersion.ToString() + + A representation of the platform ID and version in an approximation of the format used by Environment.OSVersion.ToString() + + + + Get the Version of this instance + + + + + Get the Product Type of this instance + + + + + Return true if this is a windows platform + + + + + Return true if this is a Unix or Linux platform + + + + + Return true if the platform is Win32S + + + + + Return true if the platform is Win32Windows + + + + + Return true if the platform is Win32NT + + + + + Return true if the platform is Windows CE + + + + + Return true if the platform is Xbox + + + + + Return true if the platform is MacOSX + + + + + Return true if the platform is Windows 95 + + + + + Return true if the platform is Windows 98 + + + + + Return true if the platform is Windows ME + + + + + Return true if the platform is NT 3 + + + + + Return true if the platform is NT 4 + + + + + Return true if the platform is NT 5 + + + + + Return true if the platform is Windows 2000 + + + + + Return true if the platform is Windows XP + + + + + Return true if the platform is Windows 2003 Server + + + + + Return true if the platform is NT 6 + + + + + Return true if the platform is NT 6.0 + + + + + Return true if the platform is NT 6.1 + + + + + Return true if the platform is NT 6.2 + + + + + Return true if the platform is NT 6.3 + + + + + Return true if the platform is Vista + + + + + Return true if the platform is Windows 2008 Server (original or R2) + + + + + Return true if the platform is Windows 2008 Server (original) + + + + + Return true if the platform is Windows 2008 Server R2 + + + + + Return true if the platform is Windows 2012 Server (original or R2) + + + + + Return true if the platform is Windows 2012 Server (original) + + + + + Return true if the platform is Windows 2012 Server R2 + + + + + Return true if the platform is Windows 7 + + + + + Return true if the platform is Windows 8 + + + + + Return true if the platform is Windows 8.1 + + + + + Return true if the platform is Windows 10 + + + + + Return true if the platform is Windows Server. This is named Windows + Server 10 to distinguish it from previous versions of Windows Server. + + + + + + Examines an attribute argument and tries to simulate what that value would have been if the literal syntax + which might have defined the value in C# had instead been used as an argument to a given method parameter in a direct call. + + + For example, since you can’t apply attributes using arguments, we allow the C# syntax + 10 ( value) or 0.1 ( value) to be specified. + NUnit then converts it to match the method’s parameters, just as if you were actually + using the syntax TestMethod(10) or TestMethod(0.1). + + + For another example, you might have written the syntax 10 and picked up the attribute + constructor overload; however, the test method for which this value is intended only has a + signature. Again, NUnit simulates what would have happened if the inferred C# syntax was transplanted + and you were actually using the syntax TestMethod(10). + + + + + + Converts an array of objects to the , if it is supported. + + + + + Converts a single value to the , if it is supported. + + + + + Converts a single value to the , if it is supported. + + + + + The ParameterWrapper class wraps a ParameterInfo so that it may + be used in a platform-independent manner. + + + + + Construct a ParameterWrapper for a given method and parameter + + + + + + + Gets a value indicating whether the parameter is optional + + + + + Gets an IMethodInfo representing the method for which this is a parameter. + + + + + Gets the underlying ParameterInfo + + + + + Gets the Type of the parameter + + + + + Returns an array of custom attributes of the specified type applied to this method + + + + + Gets a value indicating whether one or more attributes of the specified type are defined on the parameter. + + + + + PlatformHelper class is used by the PlatformAttribute class to + determine whether a platform is supported. + + + + + Comma-delimited list of all supported OS platform constants + + + + + Comma-delimited list of all supported Runtime platform constants + + + + + Default constructor uses the operating system and + common language runtime of the system. + + + + + Construct a PlatformHelper for a particular operating + system and common language runtime. Used in testing. + + RuntimeFramework to be used + OperatingSystem to be used + + + + Test to determine if one of a collection of platforms + is being used currently. + + + + + + + Tests to determine if the current platform is supported + based on a platform attribute. + + The attribute to examine + + + + + Tests to determine if the current platform is supported + based on a platform attribute. + + The attribute to examine + + + + + Test to determine if a particular platform or comma-delimited set of platforms is in use. + + Name of the platform or comma-separated list of platform ids + True if the platform is in use on the system + + + + Return the last failure reason. Results are not + defined if called before IsSupported( Attribute ) + is called. + + + + + Implements a simplified filter for use in deciding which + Types and Methods should be used to generate tests. It is consructed with a + list of strings, each of which may end up being interpreted in various ways. + + + + + Return a new PreFilter, without elements, which is considered + empty and always matches. + + + + + Return true if the filter is empty, in which case it + always succeeds. Technically, this is just a filter and + you can add elements but it's best to use Empty when + you need an empty filter and new when you plan to add. + + + + + Add a new filter element to the filter + + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + A PropertyBag represents a collection of name value pairs + that allows duplicate entries with the same key. Methods + are provided for adding a new pair as well as for setting + a key to a single value. All keys are strings but values + may be of any type. Null values are not permitted, since + a null entry represents the absence of the key. + + + + + Adds a key/value pair to the property set + + The key + The value + + + + Sets the value for a key, removing any other + values that are already in the property set. + + + + + + + Gets a single value for a key, using the first + one if multiple values are present and returning + null if the value is not found. + + + + + + + Gets a flag indicating whether the specified key has + any entries in the property set. + + The key to be checked + + True if their are values present, otherwise false + + + + + Gets a collection containing all the keys in the property set + + + + + + Gets or sets the list of values for a particular key + + + + + Returns an XmlNode representing the current PropertyBag. + + Not used + An XmlNode representing the PropertyBag + + + + Returns an XmlNode representing the PropertyBag after + adding it as a child of the supplied parent node. + + The parent node. + Not used + + + + + The PropertyNames class provides static constants for the + standard property ids that NUnit uses on tests. + + + + + The FriendlyName of the AppDomain in which the assembly is running + + + + + The selected strategy for joining parameter data into test cases + + + + + The process ID of the executing assembly + + + + + The stack trace from any data provider that threw + an exception. + + + + + The reason a test was not run + + + + + The author of the tests + + + + + The ApartmentState required for running the test + + + + + The categories applying to a test + + + + + The Description of a test + + + + + The number of threads to be used in running tests + + + + + The maximum time in ms, above which the test is considered to have failed + + + + + The ParallelScope associated with a test + + + + + The number of times the test should be repeated + + + + + Indicates that the test should be run on a separate thread + + + + + The culture to be set for a test + + + + + The UI culture to be set for a test + + + + + The type that is under test + + + + + The timeout value for the test + + + + + The test will be ignored until the given date + + + + + The optional Order the test will run in + + + + + Randomizer returns a set of random values in a repeatable + way, to allow re-running of tests if necessary. It extends + the .NET Random class, providing random values for a much + wider range of types. + + The class is used internally by the framework to generate + test case data and is also exposed for use by users through + the TestContext.Random property. + + + For consistency with the underlying Random Type, methods + returning a single value use the prefix "Next..." Those + without an argument return a non-negative value up to + the full positive range of the Type. Overloads are provided + for specifying a maximum or a range. Methods that return + arrays or strings use the prefix "Get..." to avoid + confusion with the single-value methods. + + + + + Initial seed used to create randomizers for this run + + + + + 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. + + + + + Create a new Randomizer using the next seed + available to ensure that each randomizer gives + a unique sequence of values. + + + + + + Default constructor + + + + + Construct based on seed value + + + + + + Returns a random unsigned int. + + + + + Returns a random unsigned int less than the specified maximum. + + + + + Returns a random unsigned int within a specified range. + + + + + Returns a non-negative random short. + + + + + Returns a non-negative random short less than the specified maximum. + + + + + Returns a non-negative random short within a specified range. + + + + + Returns a random unsigned short. + + + + + Returns a random unsigned short less than the specified maximum. + + + + + Returns a random unsigned short within a specified range. + + + + + Returns a random long. + + + + + Returns a random long less than the specified maximum. + + + + + Returns a non-negative random long within a specified range. + + + + + Returns a random ulong. + + + + + Returns a random ulong less than the specified maximum. + + + + + Returns a non-negative random long within a specified range. + + + + + Returns a random Byte + + + + + Returns a random Byte less than the specified maximum. + + + + + Returns a random Byte within a specified range + + + + + Returns a random SByte + + + + + Returns a random sbyte less than the specified maximum. + + + + + Returns a random sbyte within a specified range + + + + + Returns a random bool + + + + + Returns a random bool based on the probability a true result + + + + + Returns a random double between 0.0 and the specified maximum. + + + + + Returns a random double within a specified range. + + + + + Returns a random float. + + + + + Returns a random float between 0.0 and the specified maximum. + + + + + Returns a random float within a specified range. + + + + + Returns a random enum value of the specified Type as an object. + + + + + Returns a random enum value of the specified Type. + + + + + Default characters for random functions. + + Default characters are the English alphabet (uppercase & lowercase), Arabic numerals, and underscore + + + + Generate a random string based on the characters from the input string. + + desired length of output string. + string representing the set of characters from which to construct the resulting string + A random string of arbitrary length + + + + Generate a random string based on the characters from the input string. + + desired length of output string. + A random string of arbitrary length + Uses DefaultStringChars as the input character set + + + + Generate a random string based on the characters from the input string. + + A random string of the default length + Uses DefaultStringChars as the input character set + + + + Returns a random decimal. + + + + + Returns a random decimal between positive zero and the specified maximum. + + + + + Returns a random decimal within a specified range, which is not + permitted to exceed decimal.MaxVal in the current implementation. + + + A limitation of this implementation is that the range from min + to max must not exceed decimal.MaxVal. + + + + + Generates a valid version 4 . + + + + + Helper methods for inspecting a type by reflection. + + Many of these methods take ICustomAttributeProvider as an + argument to avoid duplication, even though certain attributes can + only appear on specific types of members, like MethodInfo or Type. + + In the case where a type is being examined for the presence of + an attribute, interface or named member, the Reflect methods + operate with the full name of the member being sought. This + removes the necessity of the caller having a reference to the + assembly that defines the item being sought and allows the + NUnit core to inspect assemblies that reference an older + version of the NUnit framework. + + + + + Examine a fixture type and return an array of methods having a + particular attribute. The array is order with base methods first. + + The type to examine + The attribute Type to look for + Specifies whether to search the fixture type inheritance chain + The array of methods found + + + + Examine a fixture type and return true if it has a method with + a particular attribute. + + The type to examine + The attribute Type to look for + True if found, otherwise false + + + + Invoke the default constructor on a Type + + The Type to be constructed + An instance of the Type + + + + Invoke a constructor on a Type with arguments + + The Type to be constructed + Arguments to the constructor + An instance of the Type + + + + Returns an array of types from an array of objects. + Differs from by returning + for null elements rather than throwing . + + + + + Gets the constructors to which the specified argument types can be coerced. + + + + + Determines if the given types can be coerced to match the given parameters. + + + + + Determines whether the current type can be implicitly converted to the specified type. + + + + + Invoke a parameterless method returning void on an object. + + A MethodInfo for the method to be invoked + The object on which to invoke the method + + + + Invoke a method, converting any TargetInvocationException to an NUnitException. + + A MethodInfo for the method to be invoked + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + + Selects the ultimate shadowing property just like would, + rather than throwing + for properties that shadow properties of a different property type + which is what does. + + + If you request both public and nonpublic properties, every public property is preferred + over every nonpublic property. It would violate the principle of least surprise for a + derived class’s implementation detail to be chosen over the public API for a type. + + + See . + See . + See . + + + + Represents the result of running a single test case. + + + + + Construct a TestCaseResult based on a TestMethod + + A TestMethod to which the result applies. + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + The TestResult class represents the result of a test. + + + + + Error message for when child tests have errors + + + + + Error message for when child tests have warnings + + + + + Error message for when child tests are ignored + + + + + The minimum duration for tests + + + + + Aggregate assertion count + + + + + ReaderWriterLock + + + + + Construct a test result given a Test + + The test to be used + + + + Gets the test with which this result is associated. + + + + + Gets the ResultState of the test result, which + indicates the success or failure of the test. + + + + + Gets the name of the test result + + + + + Gets the full name of the test result + + + + + Gets or sets the elapsed time for running the test in seconds + + + + + Gets or sets the time the test started running. + + + + + Gets or sets the time the test finished running. + + + + + Adds a test attachment to the test result + + The TestAttachment object to attach + + + + Gets the collection of files attached to the test + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + + Gets or sets the count of asserts executed + when running the test. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + Gets a TextWriter, which will write output to be included in the result. + + + + + Gets any text output written to this result. + + + + + Gets a list of assertion results associated with the test. + + + + + Returns the XML representation of the result. + + If true, descendant results are included + An XmlNode representing the result + + + + Adds the XML representation of the result as a child of the + supplied parent node.. + + The parent node. + If true, descendant results are included + + + + + Gets a count of pending failures (from Multiple Assert) + + + + + Gets the worst assertion status (highest enum) in all the assertion results + + + + + Set the result of the test + + The ResultState to use in the result + + + + Set the result of the test + + The ResultState to use in the result + A message associated with the result state + + + + Set the result of the test + + The ResultState to use in the result + A message associated with the result state + Stack trace giving the location of the command + + + + Set the test result based on the type of exception thrown + + The exception that was thrown + + + + Set the test result based on the type of exception thrown + + The exception that was thrown + The FailureSite to use in the result + + + + RecordTearDownException appends the message and stack trace + from an exception arising during teardown of the test + to any previously recorded information, so that any + earlier failure information is not lost. Note that + calling Assert.Ignore, Assert.Inconclusive, etc. during + teardown is treated as an error. If the current result + represents a suite, it may show a teardown error even + though all contained tests passed. + + The Exception to be recorded + + + + Update overall test result, including legacy Message, based + on AssertionResults that have been saved to this point. + + + + + Record an assertion result + + + + + Record an assertion result + + + + + Record an assertion result + + + + + Creates a failure message incorporating failures + from a Multiple Assert block for use by runners + that don't know about AssertionResults. + + Message as a string + + + + Adds a reason element to a node and returns it. + + The target node. + The new reason element. + + + + Adds a failure element to a node and returns it. + + The target node. + The new failure element. + + + + Adds an attachments element to a node and returns it. + + The target node. + The new attachments element. + + + + Represents the result of running a test suite + + + + + Construct a TestSuiteResult base on a TestSuite + + The TestSuite to which the result applies + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + Adds a child result to this result, setting this result's + ResultState to Failure if the child result failed. + + The result to be added + + + + Enumeration identifying a common language + runtime implementation. + + + + Any supported runtime framework + + + Microsoft .NET Framework + + + Microsoft Shared Source CLI + + + Mono + + + MonoTouch + + + Microsoft .NET Core + + + + RuntimeFramework represents a particular version + of a common language runtime implementation. + + + + + DefaultVersion is an empty Version, used to indicate that + NUnit should select the CLR version to use for the test. + + + + + Construct from a runtime type and version. If the version has + two parts, it is taken as a framework version. If it has three + or more, it is taken as a CLR version. In either case, the other + version is deduced based on the runtime type and provided version. + + The runtime type of the framework + The version of the framework + + + + Static method to return a RuntimeFramework object + for the framework that is currently in use. + + + + + The type of this runtime framework + + + + + The framework version for this runtime framework + + + + + The CLR version for this runtime framework + + + + + Return true if any CLR version may be used in + matching this RuntimeFramework object. + + + + + Returns the Display name for this framework + + + + + Parses a string representing a RuntimeFramework. + The string may be just a RuntimeType name or just + a Version or a hyphenated RuntimeType-Version or + a Version prefixed by 'versionString'. + + + + + + + Overridden to return the short name of the framework + + + + + + Returns true if the current framework matches the + one supplied as an argument. Two frameworks match + if their runtime types are the same or either one + is RuntimeType.Any and all specified version components + are equal. Negative (i.e. unspecified) version + components are ignored. + + The RuntimeFramework to be matched. + True on match, otherwise false + + + + Holds thread state which is captured and restored in order to sandbox user code. + + + + + Captures a snapshot of the tracked state of the current thread to be restored later. + + + + + Restores the tracked state of the current thread to the previously captured state. + + + + + Returns a copy with the specified culture. + + + + + Returns a copy with the specified UI culture. + + + + + Returns a copy with the specified principal. + + + + + May be called from any thread. + + + + + May be called from any thread. + + + + + May be called from any thread. + + + + + May be called from any thread, but may only be called once. + + + + + StackFilter class is used to remove internal NUnit + entries from a stack trace so that the resulting + trace provides better information about the test. + + + + + Single instance of our default filter + + + + + Construct a stack filter instance + + Regex pattern used to delete lines from the top of the stack + Regex pattern used to delete lines from the bottom of the stack + + + + Construct a stack filter instance + + Regex pattern used to delete lines from the top of the stack + + + + Construct a stack filter instance + + + + + Filters a raw stack trace and returns the result. + + The original stack trace + A filtered stack trace + + + + Provides methods to support legacy string comparison methods. + + + + + Compares two strings for equality, ignoring case if requested. + + The first string. + The second string.. + if set to true, the case of the letters in the strings is ignored. + Zero if the strings are equivalent, a negative number if strA is sorted first, a positive number if + strB is sorted first + + + + Compares two strings for equality, ignoring case if requested. + + The first string. + The second string.. + if set to true, the case of the letters in the strings is ignored. + True if the strings are equivalent, false if not. + + + + The TestCaseParameters class encapsulates method arguments and + other selected parameters needed for constructing + a parameterized test case. + + + + + The expected result to be returned + + + + + Default Constructor creates an empty parameter set + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a ParameterSet from an object implementing ITestCaseData + + + + + + The expected result of the test, which + must match the method return type. + + + + + Gets a value indicating whether an expected result was specified. + + + + + TestCaseTimeoutException is thrown when a test running directly + on a TestWorker thread is cancelled due to timeout. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + Helper class used to save and restore certain static or + singleton settings in the environment that affect tests + or which might be changed by the user tests. + + + + + Link to a prior saved context + + + + + Indicates that a stop has been requested + + + + + The event listener currently receiving notifications + + + + + The number of assertions for the current test + + + + + The current test result + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + An existing instance of TestExecutionContext. + + + + Gets and sets the current context. + + + + + Gets or sets the current test + + + + + The time the current test started execution + + + + + The time the current test started in Ticks + + + + + Gets or sets the current test result + + + + + Gets a TextWriter that will send output to the current test result. + + + + + The current test object - that is the user fixture + object on which tests are being executed. + + + + + Get or set indicator that run should stop on the first error + + + + + Gets an enum indicating whether a stop has been requested. + + + + + The current test event listener + + + + + The current WorkItemDispatcher. Made public for + use by nunitlite.tests + + + + + The ParallelScope to be used by tests running in this context. + For builds with out the parallel feature, it has no effect. + + + + + Default tolerance value used for floating point equality + when no other tolerance is specified. + + + + + The worker that spawned the context. + For builds without the parallel feature, it is null. + + + + + Gets the RandomGenerator specific to this Test + + + + + Gets the assert count. + + The assert count. + + + + The current nesting level of multiple assert blocks + + + + + Gets or sets the test case timeout value + + + + + Gets a list of ITestActions set by upstream tests + + + + + Saves or restores the CurrentCulture + + + + + Saves or restores the CurrentUICulture + + + + + Gets or sets the current for the Thread. + + + + + The current head of the ValueFormatter chain, copied from MsgUtils.ValueFormatter + + + + + If true, all tests must run on the same thread. No new thread may be spawned. + + + + + The number of times the current test has been scheduled for execution. + Currently only being executed in a test using the + + + + + Record any changes in the environment made by + the test code in the execution context so it + will be passed on to lower level tests. + + + + + Set up the execution environment to match a context. + Note that we may be running on the same thread where the + context was initially created or on a different thread. + + + + + Increments the assert count by one. + + + + + Increments the assert count by a specified amount. + + + + + Adds a new ValueFormatterFactory to the chain of formatters + + The new factory + + + + Sends a message from test to listeners. This message is not kind of test output and doesn't go to test result. + + A name recognized by the intended listeners. + A message to be sent + + + + Obtain lifetime service object + + + + + + An IsolatedContext is used when running code + that may effect the current result in ways that + should not impact the final result of the test. + A new TestExecutionContext is created with an + initially clear result, which is discarded on + exiting the context. + + + using (new TestExecutionContext.IsolatedContext()) + { + // Code that should not impact the result + } + + + + + Save the original current TestExecutionContext and + make a new isolated context current. + + + + + Restore the original TestExecutionContext. + + + + + An AdhocTestExecutionContext is created whenever a context is needed + but not available in CurrentContext. This happens when tests are run + on an ad-hoc basis or Asserts are used outside of tests. + + + + + Construct an AdhocTestExecutionContext, which is used + whenever the current TestExecutionContext is found to be null. + + + + + Enumeration indicating whether the tests are + running normally or being cancelled. + + + + + Running normally with no stop requested + + + + + A graceful stop has been requested + + + + + A forced stop has been requested + + + + + Interface to be implemented by filters applied to tests. + The filter applies when running the test, after it has been + loaded, since this is the only time an ITest exists. + + + + + Unique Empty filter. + + + + + Indicates whether this is the EmptyFilter + + + + + Indicates whether this is a top-level filter, + not contained in any other filter. + + + + + Determine if a particular test passes the filter criteria. The default + implementation checks the test itself, its parents and any descendants. + + Derived classes may override this method or any of the Match methods + to change the behavior of the filter. + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + Determine whether the test itself matches the filter criteria, without + examining either parents or descendants. This is overridden by each + different type of filter to perform the necessary tests. + + The test to which the filter is applied + True if the filter matches the any parent of the test + + + + Determine whether any ancestor of the test matches the filter criteria + + The test to which the filter is applied + True if the filter matches the an ancestor of the test + + + + Determine whether any descendant of the test matches the filter criteria. + + The test to be matched + True if at least one descendant matches the filter criteria + + + + Create a TestFilter instance from an XML representation. + + + + + Create a TestFilter from its TNode representation + + + + + Nested class provides an empty filter - one that always + returns true when called. It never matches explicitly. + + + + + Adds an XML node + + True if recursive + The added XML node + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + The TestCaseParameters class encapsulates method arguments and + other selected parameters needed for constructing + a parameterized test case. + + + + + Default Constructor creates an empty parameter set + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a ParameterSet from an object implementing ITestCaseData + + + + + + Type arguments used to create a generic fixture instance + + + + + TestListener provides an implementation of ITestListener that + does nothing. It is used only through its NULL property. + + + + + Called when a test has just started + + The test that is starting + + + + Called when a test case has finished + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the message to send + + + + Construct a new TestListener - private so it may not be used. + + + + + Get a listener that does nothing + + + + + TestNameGenerator is able to create test names according to + a coded pattern. + + + + + Default pattern used to generate names + + + + + Construct a TestNameGenerator + + + + + Construct a TestNameGenerator + + The pattern used by this generator. + + + + Get the display name for a TestMethod and its arguments + + A TestMethod + The display name + + + + Get the display name for a TestMethod and its arguments + + A TestMethod + Arguments to be used + The display name + + + + TestParameters is the abstract base class for all classes + that know how to provide data for constructing a test. + + + + + Default Constructor creates an empty parameter set + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a ParameterSet from an object implementing ITestData + + + + + + The RunState for this set of parameters. + + + + + The arguments to be used in running the test, + which must match the method signature. + + + + + A name to be used for this test case in lieu + of the standard generated name containing + the argument list. + + + + + Gets the property dictionary for this test + + + + + Applies ParameterSet values to the test itself. + + A test. + + + + The original arguments provided by the user, + used for display purposes. + + + + + The list of display names to use as the parameters in the test name. + + + + + TestProgressReporter translates ITestListener events into + the async callbacks that are used to inform the client + software about the progress of a test run. + + + + + Initializes a new instance of the class. + + The callback handler to be used for reporting progress. + + + + Called when a test has just started + + The test that is starting + + + + Called when a test has finished. Sends a result summary to the callback. + to + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + Returns the parent test item for the target test item if it exists + + + parent test item + + + + Makes a string safe for use as an attribute, replacing + characters that can't be used with their + corresponding XML representations. + + The string to be used + A new string with the values replaced + + + + ParameterizedFixtureSuite serves as a container for the set of test + fixtures created from a given Type using various parameters. + + + + + Initializes a new instance of the class. + + The ITypeInfo for the type that represents the suite. + + + + Gets a string representing the type of test + + + + + ParameterizedMethodSuite holds a collection of individual + TestMethods with their arguments applied. + + + + + Initializes a new instance of the class. + + + + + Gets a string representing the type of test + + + + + SetUpFixture extends TestSuite and supports + Setup and TearDown methods. + + + + + Initializes a new instance of the class. + + + + + The Test abstract class represents a test within the framework. + + + + + Static value to seed ids. It's started at 1000 so any + uninitialized ids will stand out. + + + + + Used to cache the declaring type for this MethodInfo + + + + + Method property backing field + + + + + Constructs a test given its name + + The name of the test + + + + Constructs a test given the path through the + test hierarchy to its parent and a name. + + The parent tests full name + The name of the test + + + + Constructs a test for a specific type. + + + + + Constructs a test for a specific method. + + + + + Gets or sets the id of the test + + + + + + Gets or sets the name of the test + + + + + Gets or sets the fully qualified name of the test + + + + + + Gets the name of the class where this test was declared. + Returns null if the test is not associated with a class. + + + + + Gets the name of the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + The arguments to use in creating the test or empty array if none required. + + + + + Gets the TypeInfo of the fixture used in running this test + or null if no fixture type is associated with it. + + + + + Gets a MethodInfo for the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + Whether or not the test should be run + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Gets a string representing the type of test. Used as an attribute + value in the XML representation of a test and has no other + function in the framework. + + + + + Gets a count of test cases represented by + or contained under this test. + + + + + Gets the properties for this test + + + + + Returns true if this is a TestSuite + + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets the parent as a Test object. + Used by the core to set the parent. + + + + + Gets this test's child tests + + A list of child tests + + + + Gets or sets a fixture object for running this test. + + + + + Static prefix used for ids in this AppDomain. + Set by FrameworkController. + + + + + Gets or Sets the Int value representing the seed for the RandomGenerator + + + + + + The SetUp methods. + + + + + The teardown methods + + + + + Creates a TestResult for this test. + + A TestResult suitable for this type of test. + + + + Modify a newly constructed test by applying any of NUnit's common + attributes, based on a supplied , which is + usually the reflection element from which the test was constructed, + but may not be in some instances. The attributes retrieved are + saved for use in subsequent operations. + + + + + Mark the test as Invalid (not runnable) specifying a reason + + The reason the test is not runnable + + + + Get custom attributes applied to a test + + + + + Add standard attributes and members to a test node. + + + + + + + Returns the XML representation of the test + + If true, include child tests recursively + + + + + Returns an XmlNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Compares this test to another test for sorting purposes + + The other test + Value of -1, 0 or +1 depending on whether the current test is less than, equal to or greater than the other test + + + + TestAssembly is a TestSuite that represents the execution + of tests in a managed assembly. + + + + + Initializes a new instance of the class + specifying the Assembly and the suite name. + + The assembly this test represents. + The desired name for the test suite. + + + + Initializes a new instance of the class + specifying the suite name for an assembly that could not be loaded. + + The desired name for the test suite. + + + + Copy-constructor style to create a filtered copy of the test assemblies + test cases + + + + + + + Gets the Assembly represented by this instance. + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Get custom attributes specified on the assembly + + + + + TestFixture is a surrogate for a user test fixture class, + containing one or more tests. + + + + + Initializes a new instance of the class. + + Type of the fixture. + Arguments used to instantiate the test fixture, or null if none used + + + + The TestMethod class represents a Test implemented as a method. + + + + + The ParameterSet used to create this test method + + + + + Initializes a new instance of the class. + + The method to be used as a test. + + + + Initializes a new instance of the class. + + The method to be used as a test. + The suite or fixture to which the new test will be added + + + + The arguments to use in executing the test method, or empty array if none are provided. + + + + + Overridden to return a TestCaseResult. + + A TestResult for this test. + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Returns a TNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Gets this test's child tests + + A list of child tests + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Returns the name of the method + + + + + TestSuite represents a composite test, which contains other tests. + + + + + Our collection of child tests + + + + + Initializes a new instance of the class. + + The name of the suite. + + + + Initializes a new instance of the class. + + Name of the parent suite. + The name of the suite. + + + + Initializes a new instance of the class. + + Type of the fixture. + Arguments used to instantiate the test fixture, or null if none used. + + + + Initializes a new instance of the class. + + Type of the fixture. + + + + Copy constructor style to create a filtered copy of the given test suite + + Test Suite to copy + Filter to be applied + + + + Sorts tests under this suite. + + + + + Adds a test to the suite. + + The test. + + + + Gets this test's child tests + + The list of child tests + + + + Gets a count of test cases represented by + or contained under this test. + + + + + + The arguments to use in creating the fixture, or empty array if none are provided. + + + + + Set to true to suppress sorting this suite's contents + + + + + OneTimeSetUp methods for this suite + + + + + OneTimeTearDown methods for this suite + + + + + Overridden to return a TestSuiteResult. + + A TestResult for this test. + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Returns an XmlNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Check that setup and teardown methods marked by certain attributes + meet NUnit's requirements and mark the tests not runnable otherwise. + + A list of methodinfos to check + + + + ThreadUtility provides a set of static methods convenient + for working with threads. + + + + + Pre-Task compatibility + + + + + Abort a thread, helping to dislodging it if it is blocked in native code + + The thread to abort + The native thread id (if known), otherwise 0. + If provided, allows the thread to be killed if it's in a message pump native blocking wait. + This must have previously been captured by calling from the running thread itself. + + + + Do our best to kill a thread + + The thread to kill + The native thread id (if known), otherwise 0. + If provided, allows the thread to be killed if it's in a message pump native blocking wait. + This must have previously been captured by calling from the running thread itself. + + + + Do our best to kill a thread, passing state info + + The thread to kill + Info for the ThreadAbortException handler + The native thread id (if known), otherwise 0. + If provided, allows the thread to be killed if it's in a message pump native blocking wait. + This must have previously been captured by calling from the running thread itself. + + + + Schedule a threadpool thread to check on the aborting thread in case it's in a message pump native blocking wait + + + + + Captures the current thread's native id. If provided to later, allows the thread to be killed if it's in a message pump native blocking wait. + + + + + Sends a message to the thread to dislodge it from native code and allow a return to managed code, where a ThreadAbortException can be generated. + The message is meaningless (WM_CLOSE without a window handle) but it will end any blocking message wait. + + + + + TypeHelper provides static methods that operate on Types. + + + + + Gets the display name for a Type as used by NUnit. + + The Type for which a display name is needed. + The display name for the Type + + + + Gets the display name for a Type as used by NUnit. + + The Type for which a display name is needed. + The arglist provided. + The display name for the Type + + + + Returns the best fit for a common type to be used in + matching actual arguments to a methods Type parameters. + + + + + Determines whether the specified type is numeric. + + The type to be examined. + + true if the specified type is numeric; otherwise, false. + + + + + Convert an argument list to the required parameter types. + Currently, only widening numeric conversions are performed. + + An array of args to be converted + A ParameterInfo[] whose types will be used as targets + + + + Determines whether this instance can deduce type args for a generic type from the supplied arguments. + + The type to be examined. + The arglist. + The type args to be used. + + true if this the provided args give sufficient information to determine the type args to be used; otherwise, false. + + + + + Return the interfaces implemented by a Type. + + The Type to be examined. + An array of Types for the interfaces. + + + + Return whether or not the given type is a ValueTuple. + + Type. + Whether or not the given type is a ValueTuple. + + + + Return whether or not the given type is a Tuple. + + Type. + Whether or not the given type is a Tuple. + + + + Determines whether the cast to the given type would succeed. + If is and + can be , the cast succeeds just like the C# language feature. + + The object to cast. + + + + Casts to a value of the given type if possible. + If is and + can be , the cast succeeds just like the C# language feature. + + The object to cast. + The value of the object, if the cast succeeded. + + + + Used for resolving the type difference between objects. + + + + + Gets the shortened type name difference between and . + + The expected object. + The actual object. + Output of the unique type name for the expected object. + Output of the unique type name for actual object. + + + + Gets the shortened type name difference between and . + + The expected object . + The actual object . + Output of the unique type name for the expected object. + Output of the unique type name for actual object. + + + + Obtain the shortened generic template parameters of the given and , + if they are generic. + + The expected . + The actual . + Shortened generic parameters of the expected . + Shortened generic parameters of the actual . + + + + Obtain a shortened name of the given . + + + + + Shorten the given names by only including the relevant differing namespaces/types, if they differ. + + The expected . + The actual . + The shortened expected name. + The shortened actual name. + + + + Returns whether or not the is generic. + + + + + Returns the fully qualified generic name of a given . + + + + + Reconstruct a generic type name using the provided generic type name, and a + of the template parameters. + + The name of the generic type, including the number of template parameters expected. + A of names of the template parameters of the provided generic type. + + + + Obtain the shortened generic names of the given expected and actual s. + + The expected . + The actual . + The shortened expected generic name. + The shortened actual generic name. + + + + The TypeWrapper class wraps a Type so it may be used in + a platform-independent manner. + + + + + Construct a TypeWrapper for a specified Type. + + + + + Gets the underlying Type on which this TypeWrapper is based. + + + + + Gets the base type of this type as an ITypeInfo + + + + + Gets the Name of the Type + + + + + Gets the FullName of the Type + + + + + Gets the assembly in which the type is declared + + + + + Gets the namespace of the Type + + + + + Gets a value indicating whether the type is abstract. + + + + + Gets a value indicating whether the Type is a generic Type + + + + + Returns true if the Type wrapped is T + + + + + Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types. + + + + + Gets a value indicating whether the Type is a generic Type definition + + + + + Gets a value indicating whether the type is sealed. + + + + + Gets a value indicating whether this type represents a static class. + + + + + Get the display name for this type + + + + + Get the display name for an object of this type, constructed with the specified args. + + + + + Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments + + + + + Returns a Type representing a generic type definition from which this Type can be constructed. + + + + + Returns an array of custom attributes of the specified type applied to this type + + + + + Returns a value indicating whether the type has an attribute of the specified type. + + + + + + + + Returns a flag indicating whether this type has a method with an attribute of the specified type. + + + + + + + Returns an array of IMethodInfos for methods of this Type + that match the specified flags. + + + + + Gets the public constructor taking the specified argument Types + + + + + Returns a value indicating whether this Type has a public constructor taking the specified argument Types. + + + + + Construct an object of this Type, using the specified arguments. + + + + + Override ToString() so that error messages in NUnit's own tests make sense + + + + + Encapsulates the ability to increment a value by an amount which may be of a different type. + + + + + Creates a from the specified value if the current instance is able to + use it to increment the on values which it operates. If the creation fails, + is thrown. + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values on which it operates. A return value indicates + whether the creation succeeded. + + + + + Provides a convenient shorthand when is + and the default value of represents zero. + + + + + Initializes a new instance of the class. + + The amount by which to increment each time this step is applied. + + Must increment the given value and return the result. + If the result is outside the range representable by , + must throw . If the result does not change due to lack + of precision representable by , must throw . + + + + + Increments the given value and returns the result. + If the result is outside the range representable by , + throws . If the result does not change due to lack + of precision representable by , throws . + + + + + + + Encapsulates the ability to increment a value by an amount + which may be of a different type. + + + + + Increments the given value and returns the result. + If the result is outside the range representable by , + throws . If the result does not change due to lack + of precision representable by , throws . + + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values of type . If the creation fails, + is thrown. + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values of type . A return value indicates + whether the creation succeeded. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + 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 equality with zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 to the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable to 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + 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 a subpath of the 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 + inclusively within a specified range. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + + Returns a constraint that tests if an item is equal to any of parameters + + Expected values + + + + When implemented by an attribute, this interface implemented to provide actions to execute before and after tests. + + + + + Executed before each test is run + + The test that is going to be run. + + + + Executed after each test is run + + The test that has just been run. + + + + Provides the target for the action attribute + + The target for the action attribute + + + + 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 + + + + + Basic Asserts on strings. + + + + + DO NOT USE! Use StringAssert.AreEqualIgnoringCase(...) or Assert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 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 + + + + 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 TestCaseData class represents a set of arguments + and other parameter info to be used for a parameterized + test case. It is derived from TestCaseParameters and adds a + fluent syntax for use in initializing the 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 name of the test case + + The modified TestCaseData instance + + + + Sets the list of display names to use as the parameters in the test name. + + + + + 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 + + + + + + + + Marks the test case as explicit. + + + + + Marks the test case as explicit, specifying the reason. + + + + + Ignores this TestCase, specifying the reason. + + The reason. + + + + + Provide the context information of the current test. + This is an adapter for the internal ExecutionContext + class, hiding the internals from the user test. + + + + + Construct a TestContext for an ExecutionContext + + The ExecutionContext to adapt + + + + 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 TextWriter that will send output to the current test result. + + + + + Gets a TextWriter that will send output directly to Console.Error + + + + + Gets a TextWriter for use in displaying immediate progress messages + + + + + TestParameters object holds parameters for the test run, if any are specified + + + + + Static DefaultWorkDirectory is now used as the source + of the public instance property WorkDirectory. This is + a bit odd but necessary to avoid breaking user tests. + + + + + Get a representation of the current test. + + + + + Gets a Representation of the TestResult for the current test. + + + + + Gets the unique name of the Worker that is executing this test. + + + + + Gets the directory containing the current test assembly. + + + + + Gets the directory to be used for outputting files created + by this test run. + + + + + Gets the random generator. + + + The random generator. + + + + + Gets the number of assertions executed + up to this point in the test. + + + + + Get the number of times the current Test has been repeated. This is currently only + set when using the . + TODO: add this to the RepeatAttribute as well + + + + Write the string representation of a boolean value to the current result + + + Write a char to the current result + + + Write a char array to the current result + + + Write the string representation of a double to the current result + + + Write the string representation of an Int32 value to the current result + + + Write the string representation of an Int64 value to the current result + + + Write the string representation of a decimal value to the current result + + + Write the string representation of an object to the current result + + + Write the string representation of a Single value to the current result + + + Write a string to the current result + + + Write the string representation of a UInt32 value to the current result + + + Write the string representation of a UInt64 value to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a line terminator to the current result + + + Write the string representation of a boolean value to the current result followed by a line terminator + + + Write a char to the current result followed by a line terminator + + + Write a char array to the current result followed by a line terminator + + + Write the string representation of a double to the current result followed by a line terminator + + + Write the string representation of an Int32 value to the current result followed by a line terminator + + + Write the string representation of an Int64 value to the current result followed by a line terminator + + + Write the string representation of a decimal value to the current result followed by a line terminator + + + Write the string representation of an object to the current result followed by a line terminator + + + Write the string representation of a Single value to the current result followed by a line terminator + + + Write a string to the current result followed by a line terminator + + + Write the string representation of a UInt32 value to the current result followed by a line terminator + + + Write the string representation of a UInt64 value to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + + This method adds the a new ValueFormatterFactory to the + chain of responsibility used for formatting values in messages. + The scope of the change is the current TestContext. + + The factory delegate + + + + Attach a file to the current test result + + Relative or absolute file path to attachment + Optional description of attachment + + + + This method provides a simplified way to add a ValueFormatter + delegate to the chain of responsibility, creating the factory + delegate internally. It is useful when the Type of the object + is the only criterion for selection of the formatter, since + it can be used without getting involved with a compound function. + + The type supported by this formatter + The ValueFormatter delegate + + + + TestAdapter adapts a Test for consumption by + the user test code. + + + + + Construct a TestAdapter for a Test + + The Test to be adapted + + + + Gets the unique Id of a test + + + + + The name of the test, which may or may not be + the same as the method name. + + + + + The name of the method representing the test. + + + + + The FullName of the test + + + + + The ClassName of the test + + + + + A shallow copy of the properties of the test. + + + + + The arguments to use in creating the test or empty array if none are required. + + + + + ResultAdapter adapts a TestResult for consumption by + the user test code. + + + + + Construct a ResultAdapter for a TestResult + + The TestResult to be adapted + + + + Gets a ResultState representing the outcome of the test + up to this point in its execution. + + + + + Gets a list of the assertion results generated + up to this point in the test. + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + adapts an + for consumption by the user. + + + + + Construct a from a source + . + + + + + Get the first property with the given , if it can be found, otherwise + returns null. + + + + + Indicates whether is found in this + . + + + + + Returns a collection of properties + with the given . + + + + + Returns the count of elements with the given . + + + + + Returns a collection of the property keys. + + + + + The TestFixtureData class represents a set of arguments + and other parameter info to be used for a parameterized + fixture. It is derived from TestFixtureParameters and adds a + fluent syntax for use in initializing the fixture. + + + + + 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 name of the test fixture + + The modified TestFixtureData instance + + + + Sets the list of display names to use as the parameters in the test name. + + + + + Marks the test fixture as explicit. + + + + + Marks the test fixture as explicit, specifying the reason. + + + + + Ignores this TestFixture, specifying the reason. + + The reason. + + + + + TestParameters class holds any named parameters supplied to the test run + + + + + Gets the number of test parameters + + + + + Gets a collection of the test parameter names + + + + + Gets a flag indicating whether a parameter with the specified name exists. + + Name of the parameter + True if it exists, otherwise false + + + + Indexer provides access to the internal dictionary + + Name of the parameter + Value of the parameter or null if not present + + + + Get method is a simple alternative to the indexer + + Name of the parameter + Value of the parameter or null if not present + + + + Get the value of a parameter or a default string + + Name of the parameter + Default value of the parameter + Value of the parameter or default value if not present + + + + Get the value of a parameter or return a default + + The return Type + Name of the parameter + Default value of the parameter + Value of the parameter or default value if not present + + + + Adds a parameter to the list + + Name of the parameter + Value of the parameter + + + + Helper class with properties and methods that supply + constraints that operate on exceptions. + + + + + 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 ArgumentException + + + + + Creates a constraint specifying an expected ArgumentNullException + + + + + Creates a constraint specifying an expected InvalidOperationException + + + + + Creates a constraint specifying that no exception is thrown + + + + + 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 + + + + + Provides static methods to express conditions + that must be met for the test to succeed. If + any test fails, a warning is issued. + + + + + DO NOT USE! + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + Not applicable + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + 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 a warning is issued. + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning on success. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning on success. + + The Type being compared. + 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 an actual value, succeeding if the constraint + fails and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + 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 a warning is issued. + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + The message to display if the condition is true + Arguments to be used in formatting the message + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning if it succeeds. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning if it succeeds. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + FrameworkPackageSettings is a static class containing constant values that + are used as keys in setting up a TestPackage. These values are used in + the framework, and set in the runner. Setting values may be a string, int or bool. + + + + + Flag (bool) indicating whether tests are being debugged. + + + + + Flag (bool) indicating whether to pause execution of tests to allow + the user to attach a debugger. + + + + + The InternalTraceLevel for this run. Values are: "Default", + "Off", "Error", "Warning", "Info", "Debug", "Verbose". + Default is "Off". "Debug" and "Verbose" are synonyms. + + + + + Full path of the directory to be used for work and result files. + This path is provided to tests by the framework TestContext. + + + + + Integer value in milliseconds for the default timeout value + for test cases. If not specified, there is no timeout except + as specified by attributes on the tests themselves. + + + + + A TextWriter to which the internal trace will be sent. + + + + + A list of tests to be loaded. + + + + + The number of test threads to run for the assembly. If set to + 1, a single queue is used. If set to 0, tests are executed + directly, without queuing. + + + + + The random seed to be used for this assembly. If specified + as the value reported from a prior run, the framework should + generate identical random values for tests as were used for + that run, provided that no change has been made to the test + assembly. Default is a random value itself. + + + + + If true, execution stops after the first error or failure. + + + + + If true, use of the event queue is suppressed and test events are synchronous. + + + + + The default naming pattern used in generating test names + + + + + Parameters to be passed on to the tests, serialized to a single string which needs parsing. Obsoleted by ; kept for backward compatibility. + + + + + Parameters to be passed on to the tests, already parsed into an IDictionary<string, string>. Replaces . + + + + + If true, the tests will run on the same thread as the NUnit runner itself + + + + + Provides a platform-independent methods for getting attributes + for use by AttributeConstraint and AttributeExistsConstraint. + + + + + Gets the custom attributes from the given object. + + The actual. + Type of the attribute. + if set to true [inherit]. + A list of the given attribute on the given object. + + + + A MarshalByRefObject that lives forever + + + + + Obtains a lifetime service object to control the lifetime policy for this instance. + + + + diff --git a/packages/NUnit.3.11.0/lib/netstandard1.4/nunit.framework.dll b/packages/NUnit.3.11.0/lib/netstandard1.4/nunit.framework.dll new file mode 100644 index 0000000000000000000000000000000000000000..58cad3bdf11307001e6f033c10cbe0fbaf7f840b Binary files /dev/null and b/packages/NUnit.3.11.0/lib/netstandard1.4/nunit.framework.dll differ diff --git a/packages/NUnit.3.11.0/lib/netstandard1.4/nunit.framework.pdb b/packages/NUnit.3.11.0/lib/netstandard1.4/nunit.framework.pdb new file mode 100644 index 0000000000000000000000000000000000000000..7d6095fb1d1d11ac0a17a8dff6119353afabb57e Binary files /dev/null and b/packages/NUnit.3.11.0/lib/netstandard1.4/nunit.framework.pdb differ diff --git a/packages/NUnit.3.11.0/lib/netstandard1.4/nunit.framework.xml b/packages/NUnit.3.11.0/lib/netstandard1.4/nunit.framework.xml new file mode 100644 index 0000000000000000000000000000000000000000..96d4e968f3554128496c7723f80d929666af7400 --- /dev/null +++ b/packages/NUnit.3.11.0/lib/netstandard1.4/nunit.framework.xml @@ -0,0 +1,19094 @@ + + + + nunit.framework + + + + + 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 + + + + + DefaultTestAssemblyBuilder loads a single assembly and builds a TestSuite + containing test fixtures present in the assembly. + + + + + The default suite builder used by the test assembly builder. + + + + + Initializes a new instance of the class. + + + + + Build a suite of tests from a provided assembly + + The assembly from which tests are to be built + A dictionary of options to use in building the suite + + A TestSuite containing the tests found in the assembly + + + + + Build a suite of tests given the name or the location of an assembly + + The name or the location of the assembly. + A dictionary of options to use in building the suite + + A TestSuite containing the tests found in the assembly + + + + + FrameworkController provides a facade for use in loading, browsing + and running tests without requiring a reference to the NUnit + framework. All calls are encapsulated in constructors for + this class and its nested classes, which only require the + types of the Common Type System as arguments. + + The controller supports four actions: Load, Explore, Count and Run. + They are intended to be called by a driver, which should allow for + proper sequencing of calls. Load must be called before any of the + other actions. The driver may support other actions, such as + reload on run, by combining these calls. + + + + + Construct a FrameworkController using the default builder and runner. + + The AssemblyName or path to the test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + + + + Construct a FrameworkController using the default builder and runner. + + The test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + + + + Construct a FrameworkController, specifying the types to be used + for the runner and builder. This constructor is provided for + purposes of development. + + The full AssemblyName or the path to the test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + The Type of the test runner + The Type of the test builder + + + + Construct a FrameworkController, specifying the types to be used + for the runner and builder. This constructor is provided for + purposes of development. + + The test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + The Type of the test runner + The Type of the test builder + + + + Gets the ITestAssemblyBuilder used by this controller instance. + + The builder. + + + + Gets the ITestAssemblyRunner used by this controller instance. + + The runner. + + + + Gets the AssemblyName or the path for which this FrameworkController was created + + + + + Gets the Assembly for which this + + + + + Gets a dictionary of settings for the FrameworkController + + + + + Loads the tests in the assembly + + + + + + Returns info about the tests in an assembly + + A string containing the XML representation of the filter to use + The XML result of exploring the tests + + + + Runs the tests in an assembly + + A string containing the XML representation of the filter to use + The XML result of the test run + + + + Runs the tests in an assembly synchronously reporting back the test results through the callback + or through the return value + + The callback that receives the test results + A string containing the XML representation of the filter to use + The XML result of the test run + + + + Runs the tests in an assembly asynchronously reporting back the test results through the callback + + The callback that receives the test results + A string containing the XML representation of the filter to use + + + + Stops the test run + + True to force the stop, false for a cooperative stop + + + + Counts the number of test cases in the loaded TestSuite + + A string containing the XML representation of the filter to use + The number of tests + + + + Inserts environment element + + Target node + The new node + + + + Inserts settings element + + Target node + Settings dictionary + The new node + + + + FrameworkControllerAction is the base class for all actions + performed against a FrameworkController. + + + + + LoadTestsAction loads a test into the FrameworkController + + + + + LoadTestsAction loads the tests in an assembly. + + The controller. + The callback handler. + + + + ExploreTestsAction returns info about the tests in an assembly + + + + + Initializes a new instance of the class. + + The controller for which this action is being performed. + Filter used to control which tests are included (NYI) + The callback handler. + + + + CountTestsAction counts the number of test cases in the loaded TestSuite + held by the FrameworkController. + + + + + Construct a CountsTestAction and perform the count of test cases. + + A FrameworkController holding the TestSuite whose cases are to be counted + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + RunTestsAction runs the loaded TestSuite held by the FrameworkController. + + + + + Construct a RunTestsAction and run all tests in the loaded TestSuite. + + A FrameworkController holding the TestSuite to run + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + RunAsyncAction initiates an asynchronous test run, returning immediately + + + + + Construct a RunAsyncAction and run all tests in the loaded TestSuite. + + A FrameworkController holding the TestSuite to run + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + StopRunAction stops an ongoing run. + + + + + Construct a StopRunAction and stop any ongoing run. If no + run is in process, no error is raised. + + The FrameworkController for which a run is to be stopped. + True the stop should be forced, false for a cooperative stop. + >A callback handler used to report results + A forced stop will cause threads and processes to be killed as needed. + + + + The ITestAssemblyBuilder interface is implemented by a class + that is able to build a suite of tests given an assembly or + an assembly filename. + + + + + Build a suite of tests from a provided assembly + + The assembly from which tests are to be built + A dictionary of options to use in building the suite + A TestSuite containing the tests found in the assembly + + + + Build a suite of tests given the filename of an assembly + + The filename of the assembly from which tests are to be built + A dictionary of options to use in building the suite + A TestSuite containing the tests found in the assembly + + + + The ITestAssemblyRunner interface is implemented by classes + that are able to execute a suite of tests loaded + from an assembly. + + + + + Gets the tree of loaded tests, or null if + no tests have been loaded. + + + + + Gets the tree of test results, if the test + run is completed, otherwise null. + + + + + Indicates whether a test has been loaded + + + + + Indicates whether a test is currently running + + + + + Indicates whether a test run is complete + + + + + Loads the tests found in an Assembly, returning an + indication of whether or not the load succeeded. + + File name of the assembly to load + Dictionary of options to use in loading the test + An ITest representing the loaded tests + + + + Loads the tests found in an Assembly, returning an + indication of whether or not the load succeeded. + + The assembly to load + Dictionary of options to use in loading the test + An ITest representing the loaded tests + + + + Count Test Cases using a filter + + The filter to apply + The number of test cases found + + + + Explore the test cases using a filter + + The filter to apply + Test Assembly with test cases that matches the filter + + + + Run selected tests and return a test result. The test is run synchronously, + and the listener interface is notified as it progresses. + + Interface to receive ITestListener notifications. + A test filter used to select tests to be run + + + + Run selected tests asynchronously, notifying the listener interface as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + + + Wait for the ongoing run to complete. + + Time to wait in milliseconds + True if the run completed, otherwise false + + + + Signal any test run that is in process to stop. Return without error if no test is running. + + If true, kill any test-running threads + + + + Implementation of ITestAssemblyRunner + + + + + Initializes a new instance of the class. + + The builder. + + + + The tree of tests that was loaded by the builder + + + + + The test result, if a run has completed + + + + + Indicates whether a test is loaded + + + + + Indicates whether a test is running + + + + + Indicates whether a test run is complete + + + + + Our settings, specified when loading the assembly + + + + + The top level WorkItem created for the assembly as a whole + + + + + The TestExecutionContext for the top level WorkItem + + + + + Loads the tests found in an Assembly + + File name or path of the assembly to load + Dictionary of option settings for loading the assembly + True if the load was successful + + + + Loads the tests found in an Assembly + + The assembly to load + Dictionary of option settings for loading the assembly + True if the load was successful + + + + Count Test Cases using a filter + + The filter to apply + The number of test cases found + + + + Explore the test cases using a filter + + The filter to apply + Test Assembly with test cases that matches the filter + + + + Run selected tests and return a test result. The test is run synchronously, + and the listener interface is notified as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + + + + Run selected tests asynchronously, notifying the listener interface as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + RunAsync is a template method, calling various abstract and + virtual methods to be overridden by derived classes. + + + + + Wait for the ongoing run to complete. + + Time to wait in milliseconds + True if the run completed, otherwise false + + + + Signal any test run that is in process to stop. Return without error if no test is running. + + If true, kill any tests that are currently running + + + + Initiate the test run. + + + + + Create the initial TestExecutionContext used to run tests + + The ITestListener specified in the RunAsync call + + + + Handle the Completed event for the top level work item + + + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + + + Verifies that the first int is greater than the second + int. 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 int is greater than the second + int. 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Verifies that the first value is greater than or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Asserts that an int is zero. + + The number to be examined + + + + Asserts that an int is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is zero. + + The number to be examined + + + + Asserts that an unsigned int is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is zero. + + The number to be examined + + + + Asserts that a Long is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is zero. + + The number to be examined + + + + Asserts that an unsigned Long is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is zero. + + The number to be examined + + + + Asserts that a decimal is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is zero. + + The number to be examined + + + + Asserts that a double is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is zero. + + The number to be examined + + + + Asserts that a float is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is not zero. + + The number to be examined + + + + Asserts that an int is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is not zero. + + The number to be examined + + + + Asserts that an unsigned int is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is not zero. + + The number to be examined + + + + Asserts that a Long is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is not zero. + + The number to be examined + + + + Asserts that an unsigned Long is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is zero. + + The number to be examined + + + + Asserts that a decimal is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is zero. + + The number to be examined + + + + Asserts that a double is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is zero. + + The number to be examined + + + + Asserts that a float is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is positive. + + The number to be examined + + + + Asserts that an int is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is positive. + + The number to be examined + + + + Asserts that an unsigned int is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is positive. + + The number to be examined + + + + Asserts that a Long is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is positive. + + The number to be examined + + + + Asserts that an unsigned Long is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is positive. + + The number to be examined + + + + Asserts that a decimal is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is positive. + + The number to be examined + + + + Asserts that a double is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is positive. + + The number to be examined + + + + Asserts that a float is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is negative. + + The number to be examined + + + + Asserts that an int is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is negative. + + The number to be examined + + + + Asserts that an unsigned int is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is negative. + + The number to be examined + + + + Asserts that a Long is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is negative. + + The number to be examined + + + + Asserts that an unsigned Long is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is negative. + + The number to be examined + + + + Asserts that a decimal is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is negative. + + The number to be examined + + + + Asserts that a double is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is negative. + + The number to be examined + + + + Asserts that a float is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + DO NOT USE! Use Assert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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. + + + + + Issues a warning using the message and arguments provided. + + The message to display. + Arguments to be used in formatting the message + + + + Issues a warning using the message provided. + + The message to display. + + + + 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. + + + + + Asserts that an object is contained in a collection. + + The expected object + The collection 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 collection. + + The expected object + The collection to be examined + + + + Wraps code containing a series of assertions, which should all + be executed, even if they fail. Failed results are saved and + reported at the end of the code block. + + A TestDelegate to be executed in Multiple Assertion mode. + + + + Wraps code containing a series of assertions, which should all + be executed, even if they fail. Failed results are saved and + reported at the end of the code block. + + A TestDelegate to be executed in Multiple Assertion mode. + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Verifies that an async 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 an async delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + + + + Verifies that an async delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that an async delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + + + + Verifies that an async delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that an async delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + + + + Verifies that an async 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 an async delegate throws an exception when called + and returns it. + + A TestDelegate + + + + Verifies that an async 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 an async 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 an async delegate throws an exception of a certain Type + or one derived from it 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 an async delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + A TestDelegate + + + + Verifies that an async delegate does not throw an exception + + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that an async delegate does not throw an exception. + + A TestDelegate + + + + 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 + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + 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 TestDelegate + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + 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 TestDelegate + + + + 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 + + + + 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 + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it 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 of a certain Type + or one derived from it when called and returns it. + + A TestDelegate + + + + Verifies that a delegate does not throw an exception + + A TestDelegate + 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 TestDelegate + + + + 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 + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + 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. + + The actual value to test + A Constraint expression to be applied + + + + 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. + + The actual value to test + A Constraint expression to be applied + The message that will be displayed on failure + Arguments 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 + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Delegate used by tests that execute code and + capture any thrown exception. + + + + + Delegate used by tests that execute async code and + capture any thrown exception. + + + + + AssertionHelper is an optional base class for user tests, + allowing the use of shorter names in making asserts. + + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to + . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to . + + The evaluated condition + + + + 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. + + 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 + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + 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 + + + + 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 + + + + Returns a ListMapper based on a collection. + + The original collection + + + + + 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 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 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 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 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 equality with zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new 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 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 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 regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression 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 a subpath of the 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. + + + + + 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. + + + + + DO NOT USE! + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + Not applicable + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + 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 + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + 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 InconclusiveException on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Provides the author of a test or test fixture. + + + + + Initializes a new instance of the class. + + The name of the author. + + + + Initializes a new instance of the class. + + The name of the author. + The email address of the author. + + + + Applies 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 + + + + + Modifies a test by adding a category to it. + + The test to modify + + + + Marks a test to use a combinatorial join of any argument data provided. + Since this is the default, the attribute is optional. + + + + + Default constructor + + + + + Marks a test as using a particular CombiningStrategy to join any supplied parameter data. + Since this is the default, the attribute is optional. + + + + + Construct a CombiningStrategyAttribute incorporating an + ICombiningStrategy and an IParameterDataProvider. + + Combining strategy to be used in combining data + An IParameterDataProvider to supply data + + + + Construct a CombiningStrategyAttribute incorporating an object + that implements ICombiningStrategy and an IParameterDataProvider. + This constructor is provided for CLS compliance. + + Combining strategy to be used in combining data + An IParameterDataProvider to supply data + + + + Builds any number of tests from the specified method and context. + + The MethodInfo for which tests are to be constructed. + The suite to which the tests will be added. + + + + Modify the test by adding the name of the combining strategy + to the properties. + + The test to modify + + + + Marks an assembly, test fixture or test method as applying to a specific Culture. + + + + + Constructor with no cultures specified, for use + with named property syntax. + + + + + Constructor taking one or more cultures + + Comma-delimited list of cultures + + + + Causes a test to be skipped if this CultureAttribute is not satisfied. + + The test to modify + + + + Tests to determine if the current culture is supported + based on the properties of this attribute. + + True, if the current culture is supported + + + + Test to determine if the a particular culture or comma- + delimited set of cultures is in use. + + Name of the culture or comma-separated list of culture ids + True if the culture is in use on the system + + + + Test to determine if one of a collection of cultures + is being used currently. + + + + + + + Abstract base class for all data-providing attributes defined by NUnit. + Used to select all data sources for a method, class or parameter. + + + + + Default constructor + + + + + Marks a field for use as a datapoint when executing a theory within + the same fixture that requires an argument of the field's Type. + + + + + Marks a field, property or method as providing a set of datapoints for use + in executing any theories within the same fixture that require an argument of + the provided Type. The data source may provide an array of the required Type + or an . Synonymous with . + + + + + Marks a field, property or method as providing a set of datapoints for use + in executing any theories within the same fixture that require an argument + of the provided type. The data source may provide an array of the required + Type or an . Synonymous with . + + + + + Sets the tolerance used by default when checking the equality of floating point values + within the test assembly, fixture or method. + + + + + Construct specifying an amount + + + + + + Apply changes to the TestExecutionContext + + The TestExecutionContext + + + + Provides the descriptive text relating to the assembly, test fixture or test method. + + + + + Construct a description Attribute + + The text of the description + + + + Marks an assembly, test fixture or test method such that it will only run if explicitly + executed from the GUI, command line or included within a test 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 + + + + Modifies a test by marking it as explicit. + + The test to modify + + + + Marks an assembly, test fixture or test method as being ignored. Ignored tests result in a warning message when the tests are run. + + + + + Constructs the attribute giving a reason for ignoring the test + + The reason for ignoring the test + + + + The date in the future to stop ignoring the test as a string in UTC time. + For example for a date and time, "2014-12-25 08:10:00Z" or for just a date, + "2014-12-25". If just a date is given, the Ignore will expire at midnight UTC. + + + Once the ignore until date has passed, the test will be marked + as runnable. Tests with an ignore until date will have an IgnoreUntilDate + property set which will appear in the test results. + + The string does not contain a valid string representation of a date and time. + + + + Modifies a test by marking it as Ignored. + + The test to modify + + + + 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 items 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 + + + + + Sets the number of worker threads that may be allocated by the framework + for running tests. + + + + + Construct a LevelOfParallelismAttribute. + + The number of worker threads to be created by the framework. + + + + Specifies the maximum time (in milliseconds) for a test case to succeed. + + + + + Construct a MaxTimeAttribute, given a time in milliseconds. + + The maximum elapsed time in milliseconds + + + + Marks tests that should NOT be run in parallel. + + + + + Construct a NonParallelizableAttribute. + + + + + Used by third-party frameworks, or other software, that reference + the NUnit framework but do not contain any tests. Applying the + attribute indicates that the assembly is not a test assembly and + may prevent errors if certain runners attempt to load the assembly. + Note that recognition of the attribute depends on each individual runner. + + + + + Abstract base class for all custom attributes defined by NUnit. + + + + + Default constructor + + + + + Identifies a method that is called once to perform setup before any child tests are run. + + + + + Identifies a method to be called once after all the child tests have run. + The method is guaranteed to be called, even if an exception is thrown. + + + + + Defines the order that the test will run in + + + + + Defines the order that the test will run in + + + + + Defines the order that the test will run in + + + + + + Modifies a test as defined for the specific attribute. + + The test to modify + + + + Marks a test as using a pairwise join of any supplied argument data. Arguments will be + combined in such a way that all possible pairs of arguments are used. + + + + + Default constructor + + + + + Marks a test assembly, fixture or method that may be run in parallel. + + + + + Construct a ParallelizableAttribute using default ParallelScope.Self. + + + + + Construct a ParallelizableAttribute with a specified scope. + + The ParallelScope associated with this attribute. + + + + Defines the degree to which this test and its descendants may be run in parallel + + + + + Overridden to check for invalid combinations of settings + + + + + + Modify the context to be used for child tests + + The current TestExecutionContext + + + + Specifies the degree to which a test, and its descendants, + may be run in parallel. + + + + + No ParallelScope was specified on the test + + + + + The test may be run in parallel with others at the same level. + Valid on classes and methods but not assemblies. + + + + + Test may not be run in parallel with any others. Valid on + classes and methods but not assemblies. + + + + + Mask used to extract the flags that apply to the item on which a + ParallelizableAttribute has been placed, as opposed to descendants. + + + + + Descendants of the test may be run in parallel with one another. + Valid on assemblies and classes but not on methods. + + + + + Descendants of the test down to the level of TestFixtures may be + run in parallel with one another. Valid on assemblies and classes + but not on methods. + + + + + Mask used to extract all the flags that impact descendants of a + test and place them in the TestExecutionContext. + + + + + The test and its descendants may be run in parallel with others at + the same level. Valid on classes and methods but not assemblies. + + + + + Attaches information to a test assembly, fixture or method 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 + + + + + Modifies a test by adding properties to it. + + The test to modify + + + + Supplies a set of random values to a single parameter of a parameterized test. + + + + + If true, no value will be repeated. + + + + + Construct a random set of values appropriate for the Type of the + parameter on which the attribute appears, specifying only the count. + + + + + + Construct a set of ints within a specified range + + + + + Construct a set of unsigned ints within a specified range + + + + + Construct a set of longs within a specified range + + + + + Construct a set of unsigned longs within a specified range + + + + + Construct a set of shorts within a specified range + + + + + Construct a set of unsigned shorts within a specified range + + + + + Construct a set of doubles within a specified range + + + + + Construct a set of floats within a specified range + + + + + Construct a set of bytes within a specified range + + + + + Construct a set of sbytes within a specified range + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + Supplies 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 unsigned ints using default step of 1 + + + + + Construct a range of unsigned ints specifying the step size + + + + + Construct a range of longs using a default step of 1 + + + + + Construct a range of longs + + + + + Construct a range of unsigned longs using default step of 1 + + + + + Construct a range of unsigned longs specifying the step size + + + + + Construct a range of doubles + + + + + Construct a range of floats + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + Returns a string that represents the current object. + + + + Specifies that a test should be run multiple times. + + + + + Construct a RepeatAttribute + + The number of times to run the test + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + The test command for the RepeatAttribute + + + + + Initializes a new instance of the class. + + The inner command. + The number of repetitions + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Specifies that a test method should be rerun on failure up to the specified + maximum number of times. + + + + + Construct a + + The maximum number of times the test should be run if it fails + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + The test command for the + + + + + Initializes a new instance of the class. + + The inner command. + The maximum number of repetitions + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Marks a test to use a sequential join of any provided argument data. + Arguments will be combined into test cases, taking the next value of + each argument until all are used. + + + + + Default constructor + + + + + Sets the current Culture on an assembly, test fixture or test method for + the duration of a test. The culture remains set until the test or fixture + completes and is then reset to its original value. + + + + + + Construct given the name of a culture + + + + + + Sets the current UI Culture on an assembly, test fixture or test method + for the duration of a test. The UI culture remains set until the test or + fixture completes and is then reset to its original value. + + + + + + Construct given the name of a culture + + + + + + Identifies a method to be called immediately before each test is run. + + + + + Identifies a class as containing or + methods for all the test fixtures + under a given namespace. + + + + + Builds a from the specified type. + + The type info of the fixture to be used. + + + + Marks a test fixture as requiring all child tests to be run on the + same thread as the OneTimeSetUp and OneTimeTearDown. A flag in the + is set forcing all child tests + to be run sequentially on the current thread. + Any setting is ignored. + + + + + Apply changes to the TestExecutionContext + + The TestExecutionContext + + + + Identifies a method to be called immediately after each test is run. + The method is guaranteed to be called, even if an exception is thrown. + + + + + Abstract attribute providing actions to execute before and after tests. + + + + + Executed before each test is run + + The test that is going to be run. + + + + Executed after each test is run + + The test that has just been run. + + + + Provides the target for the action attribute + + + + + Marks a test assembly as needing a special assembly resolution hook that will + explicitly search the test assembly's directory for dependent assemblies. + This works around a conflict between mixed-mode assembly initialization and + tests running in their own AppDomain in some cases. + + + + + Marks the method as callable from the NUnit test runner. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + public void TestDescriptionMethod() + {} + } + + + + + + Descriptive text for this test + + + + + The author of this test + + + + + The type that this test is testing + + + + + Gets or sets the expected result. Not valid if the test + method has parameters. + + The result. + + + + Modifies a test by adding a description, if not already set. + + The test to modify + + + + Builds a single test from the specified method and context. + + The method for which a test is to be constructed. + The suite to which the test will be added. + + + + Marks a method as a parameterized test suite and provides arguments for each test case. + + + + + 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 or sets the name of the test. + + The name of the test. + + + + Gets or sets the RunState of this test case. + + + + + Gets the list of arguments to a test case + + + + + Gets the properties of the test case + + + + + Gets or sets the expected result. + + The result. + + + + Returns true if the expected result has been set + + + + + Gets or sets the description. + + The description. + + + + The author of this test + + + + + The type that this test is testing + + + + + Gets or sets the reason for ignoring the test + + + + + Gets or sets a value indicating whether this is explicit. + + + true if explicit; otherwise, false. + + + + + Gets or sets the reason for not running the test. + + The reason. + + + + Gets or sets the ignore reason. When set to a non-null + non-empty value, the test is marked as ignored. + + The ignore reason. + + + + Gets and sets the category for this test case. + May be a comma-separated list of categories. + + + + + Performs several special conversions allowed by NUnit in order to + permit arguments with types that cannot be used in the constructor + of an Attribute such as TestCaseAttribute or to simplify their use. + + The arguments to be converted + The ParameterInfo array for the method + + + + Performs several special conversions allowed by NUnit in order to + permit arguments with types that cannot be used in the constructor + of an Attribute such as TestCaseAttribute or to simplify their use. + + The argument to be converted + The target in which the should be converted + If conversion was successfully applied, the converted into + + true if was converted and should be used; + false is no conversion was applied and should be ignored + + + + + Builds a single test from the specified method and context. + + The MethodInfo for which tests are to be constructed. + The suite to which the tests will be added. + + + + Indicates the source to be used to provide test fixture instances for a test class. + + + + + Construct with the name of the method, property or field that will provide data + + The name of a static method, property or field that will provide data. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + + + + Construct with a name + + The name of a static method, property or field that will provide data. + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + Construct with a Type + + The type that will provide data + + + + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + + 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 every fixture created from + this attribute. May be a single category or a comma-separated list. + + + + + Builds any number of tests from the specified method and context. + + The IMethod for which tests are to be constructed. + The suite to which the tests will be added. + + + + Marks the class as a TestFixture. + + + + + 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. + + + + + + Gets or sets the name of the test. + + The name of the test. + + + + Gets or sets the RunState of this test fixture. + + + + + The arguments originally provided to the attribute + + + + + Properties pertaining to this fixture + + + + + Get or set the type arguments. If not set + explicitly, any leading arguments that are + Types are taken as type arguments. + + + + + Descriptive text for this fixture + + + + + The author of this fixture + + + + + The type that this fixture is testing + + + + + Gets or sets the ignore reason. May set RunState as a side effect. + + The ignore reason. + + + + Gets or sets the reason for not running the fixture. + + The reason. + + + + Gets or sets the ignore reason. When set to a non-null + non-empty value, the test is marked as ignored. + + The ignore reason. + + + + Gets or sets a value indicating whether this is explicit. + + + true if explicit; otherwise, false. + + + + + Gets and sets the category for this fixture. + May be a comma-separated list of categories. + + + + + Builds a single test fixture from the specified type. + + + + + Builds a single test fixture from the specified type. + + The type info of the fixture to be used. + Filter used to select methods as tests. + + + + Identifies the source used to provide test fixture instances for a test class. + + + + + Error message string is public so the tests can use it + + + + + Construct with the name of the method, property or field that will provide data + + The name of a static method, property or field that will provide data. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + + + + Construct with a Type + + The type 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 every fixture created from + this attribute. May be a single category or a comma-separated list. + + + + + Builds any number of test fixtures from the specified type. + + The TypeInfo for which fixtures are to be constructed. + + + + Builds any number of test fixtures from the specified type. + + The TypeInfo for which fixtures are to be constructed. + PreFilter used to select methods as tests. + + + + Returns a set of ITestFixtureData items for use as arguments + to a parameterized test fixture. + + The type for which data is needed. + + + + + Indicates the method or class the assembly, test fixture or test method is testing. + + + + + Initializes a new instance of the class. + + The type that is being tested. + + + + Initializes a new instance of the class. + + The type that is being tested. + + + + 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")] + public void TestDescriptionMethod() + {} + } + + + + + + Construct the attribute, specifying a combining strategy and source of parameter data. + + + + + Provides literal arguments for an individual parameter of a test. + + + + + 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 + + + + + Constructs for use with an Enum parameter. Will pass every enum + value in to the test. + + + + + Construct with one argument + + + + + + Construct with two arguments + + + + + + + Construct with three arguments + + + + + + + + Construct with an array of arguments + + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + To generate data for Values attribute, in case no data is provided. + + + + + To Check if type is nullable enum. + + + + + Indicates the source 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 a static method, property or field 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 a static 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 + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + A set of Assert methods operating on one or more collections + + + + + DO NOT USE! Use CollectionAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + 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 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 + 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 + 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 + 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 + 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 + 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 + 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 + Arguments to be used in formatting the message + + + + Asserts that the superset does not contain the subset + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + + + + Asserts that the superset does not contain the subset + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the superset contains the subset. + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + + + + Asserts that the superset contains the subset. + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the subset does not contain the superset + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that the subset does not contain the superset + + 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 the subset contains the superset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that the subset contains the superset. + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + AllItemsConstraint applies another constraint to each + item in a collection, succeeding if they all succeed. + + + + + Construct an AllItemsConstraint on top of an existing 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. + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + AndConstraint succeeds only if both members succeed. + + + + + Create an AndConstraint from two other constraints + + The first constraint + The second constraint + + + + Gets text describing a 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 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 + + + + is used to determine whether the value is equal to any of the expected values. + + + + + Construct a + + Collection of expected values + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether item is present in expected collection + + Actual item type + Actual item + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IEqualityComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + AssignableFromConstraint is used to test that an object + can be assigned from a given Type. + + + + + Construct an AssignableFromConstraint for the type provided + + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + AssignableToConstraint is used to test that an object + can be assigned to a given Type. + + + + + Construct an AssignableToConstraint for the type provided + + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + 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. + + + + + Constructs an AttributeConstraint for a specified attribute + Type and base constraint. + + + + + + + Determines whether the Type or other provider has the + expected attribute and if its value matches the + additional constraint specified. + + + + + Returns a string representation of the constraint. + + + + + AttributeExistsConstraint tests for the presence of a + specified attribute on a Type. + + + + + Constructs an AttributeExistsConstraint for a specific attribute Type + + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Tests whether the object provides the expected attribute. + + A Type, MethodInfo, or other ICustomAttributeProvider + True if the expected attribute is present, otherwise false + + + + 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 + + + + 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 + + + + + + + CollectionContainsConstraint is used to test whether a collection + contains an expected object as a member. + + + + + Construct a CollectionContainsConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Test whether the expected item is contained in the collection + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + CollectionEquivalentConstraint is used to determine whether two + collections are equivalent. + + + + The result of the from the collections + under comparison. + + + Construct a CollectionEquivalentConstraint + Expected collection. + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether two collections are equivalent + + + + + + + Test whether the collection is equivalent to the expected. + + + Actual collection type. + + + Actual collection to compare. + + + A indicating whether or not + the two collections are equivalent. + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + Provides a for the . + + + Result of a of the collections to compare for equivalence. + + + Maximum amount of elements to write to the if there are + extra/missing elements from the collection. + + + Construct a using a . + Source . + Result of the collection comparison. + Actual collection to compare. + Whether or not the succeeded. + + + Write any additional lines (following Expected: and But was:) for a failing constraint. + The to write the failure message to. + + + + CollectionItemsEqualConstraint is the abstract base class for all + collection constraints that apply some notion of item equality + as a part of their operation. + + + + + The NUnitEqualityComparer in use for this constraint + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Get a flag indicating whether the user requested us to ignore case. + + + + + Get a flag indicating whether any external comparers are in use. + + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + Compares two collection members for equality + + + + + Return a new CollectionTally for use in making tests + + The collection to be included in the tally + + + + CollectionOrderedConstraint is used to test whether a collection is ordered. + + + + + Construct a CollectionOrderedConstraint + + + + + 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. + + + + + If used performs a default ascending comparison + + + + + If used performs a reverse comparison + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use a and returns self. + + + + + Modifies the constraint to test ordering by the value of + a specified property and returns self. + + + + + Then signals a break between two ordering steps + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Test whether the collection is ordered + + + + + Returns the string representation of the constraint. + + + + + + An OrderingStep represents one stage of the sort + + + + + Constructor for success result. + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + + + + Constructor for failure result. + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + Index at which collection order breaks. + Value at which collection order breaks. + + + + 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 + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the actual collection is a subset of + the expected collection provided. + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + CollectionSupersetConstraint is used to determine whether + one collection is a superset of another + + + + + Construct a CollectionSupersetConstraint + + The collection that the actual value is expected to be a superset of + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the actual collection is a superset of + the expected collection provided. + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + counts (tallies) the number of occurrences + of each object in one or more enumerations. + + + The result of a . + + + Items that were not in the expected collection. + + + Items that were not accounted for in the expected collection. + + + Initializes a new instance of the class with the given fields. + + + The result of the comparison between the two collections. + + + Construct a CollectionTally object from a comparer and a collection. + The comparer to use for equality. + The expected collection to compare against. + + + Try to remove an object from the tally. + The object to remove. + + + Try to remove a set of objects from the tally. + The objects to remove. + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two types related by . + + + + + Interface for comparing two s. + + + + + Method for comparing two objects with a tolerance. + + The first object to compare. + The second object to compare. + The tolerance to use when comparing the objects. + Flag indicating whether or not this is the top level comparison. + + null if the objects cannot be compared using the method. + Otherwise the result of the comparison is returned. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s or s. + + + + + Comparator for two Tuples. + + + + + Base class for comparators for tuples (both regular Tuples and ValueTuples). + + + + + Comparator for two ValueTuples. + + + + + ComparisonAdapter class centralizes all comparisons of + values in NUnit, adapting to the use of any provided + , + or . + + + + + Gets the default ComparisonAdapter, which wraps an + NUnitComparer object. + + + + + Returns a ComparisonAdapter that wraps an + + + + + Returns a ComparisonAdapter that wraps an + + + + + Returns a ComparisonAdapter that wraps a + + + + + Compares two objects + + + + + Construct a default ComparisonAdapter + + + + + Construct a ComparisonAdapter for an + + + + + Compares two objects + + + + + + + + ComparerAdapter extends and + allows use of an or + to actually perform the comparison. + + + + + Construct a ComparisonAdapter for an + + + + + Compare a Type T to an object + + + + + Construct a ComparisonAdapter for a + + + + + Compare a Type T to an object + + + + + Abstract base class for constraints that compare values to + determine if one is greater than, equal to or less than + the other. + + + + + The value against which a comparison is to be made + + + + + Tolerance used in making the comparison + + + + + ComparisonAdapter to be used in making the comparison + + + + + Initializes a new instance of the class. + + The value against which to make a comparison. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + A ConstraintResult + + + + Protected function overridden by derived class to actually perform the comparison + + + + + Modifies the constraint to use an and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Modifies the constraint to use an and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Modifies the constraint to use a and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Set the tolerance for use in this comparison + + + + + Switches the .Within() modifier to interpret its tolerance as + a percentage that the actual values is allowed to deviate from + the expected value. + + Self + + + + Delegate used to delay evaluation of the actual value + to be used in evaluating a constraint + + + + + The Constraint class is the base of all built-in constraints + within NUnit. It provides the operator overloads used to combine + constraints. + + + + + Construct a constraint with optional arguments + + Arguments to be saved + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Arguments provided to this Constraint, for use in + formatting the description. + + + + + The ConstraintBuilder holding this constraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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 + A ConstraintResult + + + + Retrieves the value to be tested from an ActualValueDelegate. + The default implementation simply evaluates the delegate but derived + classes may override it to provide for delayed processing. + + An ActualValueDelegate + Delegate evaluation result + + + + 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 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. + + + + + Returns a DelayedConstraint.WithRawDelayInterval with the specified delay time. + + The delay, which defaults to milliseconds. + + + + + Returns a DelayedConstraint with the specified delay time + and polling interval. + + The delay in milliseconds. + The interval at which to test the constraint. + + + + + Resolves any pending operators and returns the resolved 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 reorganized. a ConstraintStack holds + input constraints as well as the results of each + operator applied. + + + + + OperatorStack is a type-safe stack for holding ConstraintOperators + + + + + Initializes a new instance of the class. + + The ConstraintBuilder using this stack. + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost operator without modifying the stack. + + + + + Pushes the specified operator onto the stack. + + The operator to put onto the stack. + + + + Pops the topmost operator from the stack. + + The topmost operator on the stack + + + + ConstraintStack is a type-safe stack for holding Constraints + + + + + Initializes a new instance of the class. + + The ConstraintBuilder using this stack. + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Pushes the specified constraint. As a side effect, + the constraint's Builder field is set to the + ConstraintBuilder owning this stack. + + The constraint to put onto the stack + + + + Pops this topmost constraint from the stack. + As a side effect, the constraint's Builder + field is set to null. + + The topmost constraint on the stack + + + + 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 expression 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. + + + + + 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 + reorganized. When a constraint is appended, it is returned as the + value of the operation so that modifiers may be applied. However, + any partially built expression is attached to the constraint for + later resolution. When an operator is appended, the partial + expression is returned. If it's a self-resolving operator, then + a ResolvableConstraintExpression is returned. + + + + + 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. Note that the constraint + is not reduced at this time. For example, if there + is a NotOperator on the stack we don't reduce and + return a NotConstraint. The original constraint must + be returned because it may support modifiers that + are yet to be applied. + + + + + 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 ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a , which will + apply the following constraint to a collection of length one, succeeding + only if exactly one of them succeeds. + + + + + 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 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 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. + + + + + With is currently a NOP - reserved for future use. + + + + + 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 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 if item is equal to zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new 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 new 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 new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the Dictionary key collection. + + The key to be matched in the Dictionary key collection + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the Dictionary value collection. + + The value to be matched in the Dictionary value collection + + + + 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 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 ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression 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 a subpath of the 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 + inclusively within a specified range. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + Returns a constraint that succeeds if the value + is a file or directory and it exists. + + + + + Returns a constraint that tests if an item is equal to any of parameters + + Expected values + + + + ConstraintStatus represents the status of a ConstraintResult + returned by a Constraint being applied to an actual value. + + + + + The status has not yet been set + + + + + The constraint succeeded + + + + + The constraint failed + + + + + An error occurred in applying the constraint (reserved for future use) + + + + + Contains the result of matching a against an actual value. + + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + The status of the new ConstraintResult. + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + If true, applies a status of Success to the result, otherwise Failure. + + + + The actual value that was passed to the method. + + + + + Gets and sets the ResultStatus for this result. + + + + + True if actual value meets the Constraint criteria otherwise false. + + + + + Display friendly name of the constraint. + + + + + Description of the constraint may be affected by the state the constraint had + when was performed against the actual value. + + + + + Write the failure message to the MessageWriter provided + as an argument. The default implementation simply passes + the result 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 occurred, can override this. + + The MessageWriter on which to display the message + + + + Write some additional failure message. + + The MessageWriter on which to display the message + + + + 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 + + + + 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 value contained within the string/collection. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Flag the constraint to ignore case and return self. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Applies a delay to the match so that a match can be evaluated in the future. + + + + + Allows only changing the time dimension of delay interval and setting a polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithRawDelayInterval + + Parent DelayedConstraint on which delay interval dimension is required to be set + + + + Changes delay interval dimension to minutes + + + + + Changes delay interval dimension to seconds + + + + + Changes delay interval dimension to milliseconds + + + + + Set polling interval, in milliseconds + + A time interval, in milliseconds + + + + + Allows only setting the polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithDimensionedDelayInterval + + Parent DelayedConstraint on which polling interval is required to be set + + + + Set polling interval, in milliseconds + + A time interval, in milliseconds + + + + + Allows only changing the time dimension of the polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithRawPollingInterval + + Parent DelayedConstraint on which polling dimension is required to be set + + + + Changes polling interval dimension to minutes + + + + + Changes polling interval dimension to seconds + + + + + Changes polling interval dimension to milliseconds + + + + + Delay value store as an Interval object + + + + + Polling value stored as an Interval object + + + + + Creates a new DelayedConstraint + + The inner constraint to 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 to decorate + The time interval after which the match is performed, in milliseconds + The time interval used for polling, in milliseconds + If the value of is less than 0 + + + + Gets text describing a constraint + + + + + 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 + A ConstraintResult + + + + 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 + + + + Returns the string representation of the constraint. + + + + + Adjusts a Timestamp by a given TimeSpan + + + + + + + + Returns the difference between two Timestamps as a TimeSpan + + + + + + + + DictionaryContainsKeyConstraint is used to test whether a dictionary + contains an expected object as a key. + + + + + Construct a DictionaryContainsKeyConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Flag the constraint to ignore case and return self. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + + + + Test whether the expected key is contained in the dictionary + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + DictionaryContainsValueConstraint is used to test whether a dictionary + contains an expected object as a value. + + + + + Construct a DictionaryContainsValueConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Test whether the expected value is contained in the dictionary + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + Provides a for the constraints + that are applied to each item in the collection + + + + + Constructs a for a particular + Only used for Failure + + The Constraint to which this result applies + The actual value to which the Constraint was applied + Actual item that does not match expected condition + Non matching item index + + + + Write constraint description, actual items, and non-matching item + + The MessageWriter on which to display the message + + + + EmptyCollectionConstraint tests whether a collection is empty. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Check that the collection is empty + + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + EmptyDirectoryConstraint is used to test that a directory is empty + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + EmptyStringConstraint tests whether a string is empty. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + 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. + + + + + + + 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. + + + + + NUnitEqualityComparer used to test equality. + + + + + Initializes a new instance of the class. + + The expected value. + + + + Gets the tolerance for this comparison. + + + The tolerance. + + + + + Gets a value indicating whether to compare case insensitive. + + + true if comparing case insensitive; otherwise, false. + + + + + Gets a value indicating whether or not to clip strings. + + + true if set to clip strings otherwise, false. + + + + + Gets the failure points. + + + The failure points. + + + + + 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. + + + + + Flag the constraint to use a tolerance when determining equality. + + Tolerance value to be used + Self. + + + + Flags the constraint to include + property in comparison of two values. + + + Using this modifier does not allow to use the + constraint modifier. + + + + + 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 + + + + 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 boolean-returning delegate. + + The boolean-returning delegate 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 use the supplied predicate function + + The comparison function to use. + Self. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + The EqualConstraintResult class is tailored for formatting + and displaying the result of an EqualConstraint. + + + + + Construct an EqualConstraintResult + + + + + Write a failure message. Overridden to provide custom + failure messages for EqualConstraint. + + The MessageWriter to write to + + + + Display the failure information for two collections that did not match. + + The MessageWriter on which to display + The expected collection. + The actual collection + The depth of this failure in a set of nested collections + + + + Displays a single line showing the types and sizes of the expected + and actual collections or arrays. If both are identical, the value is + only shown once. + + The MessageWriter on which to display + The expected collection or array + The actual collection or array + The indentation level for the message line + + + + Displays a single line showing the point in the expected and actual + arrays at which the comparison failed. If the arrays have different + structures or dimensions, both values are shown. + + The MessageWriter on which to display + The expected array + The actual array + Index of the failure point in the underlying collections + The indentation level for the message line + + + + 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 + + + + EqualityAdapter class handles all equality comparisons + that use an , + or a . + + + + + 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 that wraps an . + + + + + that wraps an . + + + + + Returns an that wraps an . + + + + + Returns an EqualityAdapter that uses a predicate function for items comparison. + + + + + + + + + Returns true if the two objects can be compared by this adapter. + The base adapter cannot handle IEnumerables except for strings. + + + + + Compares two objects, returning true if they are equal + + + + + Returns true if the two objects can be compared by this adapter. + Generic adapter requires objects of the specified type. + + + + + Returns an that wraps an . + + + + + Returns an that wraps an . + + + + + that wraps an . + + + + + Returns an that wraps a . + + + + + ExactCountConstraint applies another constraint to each + item in a collection, succeeding only if a specified + number of items succeed. + + + + + Construct a standalone ExactCountConstraint + + + + + + 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. + + The value to be tested + A ConstraintResult + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Contain the result of matching a against an actual value. + + + + + The maximum count of list elements that are shown on the constraint result + + + + + The count of matched items of the + + + + + A list with maximum count (+1) of items of the + (The maximum count is set in ) + + + + + Constructs a for a . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + If true, applies a status of Success to the result, otherwise Failure. + Count of matched items of the + A list with maximum count (+1) of items of the + + + + Write the actual value for a failing constraint test to a MessageWriter. + + 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. + + + + 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. + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + ExceptionTypeConstraint is a special version of ExactTypeConstraint + used to provided detailed info about the exception thrown in + an error message. + + + + + Constructs an ExceptionTypeConstraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + FalseConstraint tests that the actual value is false + + + + + Initializes a new instance of the class. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + FileExistsConstraint is used to determine if a file exists + + + + + Initializes a new instance of the class. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + FileOrDirectoryExistsConstraint is used to determine if a file or directory exists + + + + + If true, the constraint will only check if files exist, not directories + + + + + If true, the constraint will only check if directories exist, not files + + + + + Initializes a new instance of the class that + will check files and directories. + + + + + Initializes a new instance of the class that + will only check files if ignoreDirectories is true. + + if set to true [ignore directories]. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + 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. + + + + + 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 + + + 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 between 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 between 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/ + + + + + + Tests whether a value is greater than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Tests whether a value is greater than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Interface for all constraints + + + + + The display name of this Constraint for use by ToString(). + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Arguments provided to this Constraint, for use in + formatting the description. + + + + + The ConstraintBuilder holding this constraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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 + A ConstraintResult + + + + 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 + + + + 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. + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + Keeps track of an interval time which can be represented in + Minutes, Seconds or Milliseconds + + + + + Constructs a interval given an value in milliseconds + + + + + Gets Interval value represented as a TimeSpan object + + + + + Returns the interval with the current value as a number of minutes. + + + + + Returns the interval with the current value as a number of seconds. + + + + + Returns the interval with the current value as a number of milliseconds. + + + + + Is true for intervals created with a non-zero value + + + + + Returns a string that represents the current object. + + + A string that represents the current object. + + + + + IntervalUnit provides the semantics to the value stored in Interval class. + + + + + Unit representing an Interval in minutes + + + + + Unit representing an Interval in seconds + + + + + Unit representing an Interval in milliseconds + + + + + The IResolveConstraint interface is implemented by all + complete and resolvable constraints and expressions. + + + + + Return the top-level constraint for this expression + + + + + + An extension of ResolvableConstraintExpression that adds a no-op Items property for readability. + + + + + Create a new instance of ItemsConstraintExpression + + + + + Create a new instance of ResolvableConstraintExpression, + passing in a pre-populated ConstraintBuilder. + + + + + + No-op property for readability. + + + + + Tests whether a value is less than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Tests whether a value is less than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + 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 + + + + + Abstract method to get the max line length + + + + + 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 given + 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 failing constraint result + + + + 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 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 + + + + Custom value formatter function + + The value + + + + + Custom value formatter factory function + + The next formatter function + ValueFormatter + If the given formatter is unable to handle a certain format, it must call the next formatter in the chain + + + + Static methods used in creating messages + + + + + Static string used when strings are clipped + + + + + Formatting strings used for expected and actual values + + + + + Current head of chain of value formatters. Public for testing. + + + + + Add a formatter to the chain of responsibility. + + + + + + Formats text to represent a generalized value. + + The value + The formatted text + + + + Formats 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 + + + + 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 + + + + Converts any null characters in a string + to their escaped representation. + + The string to be converted + The converted string + + + + Return the a string representation for a set of indices into an array + + Array of indices for which a string is needed + + + + Get an array of indices representing the point in a collection or + array corresponding to a single int index into the collection. + + The collection to which the indices apply + Index in the collection + Array of indices + + + + Clip a string to a given length, starting at a particular offset, returning the clipped + string with ellipses representing the removed parts + + The string to be clipped + The maximum permitted length of the result string + The point at which to start clipping + The clipped string + + + + Clip the expected and actual strings in a coordinated fashion, + so that they may be displayed together. + + + + + + + + + Shows the position two strings start to differ. Comparison + starts at the start index. + + The expected string + The actual string + The index in the strings at which comparison should start + Boolean indicating whether case should be ignored + -1 if no mismatch found, or the index where mismatch found + + + + NaNConstraint tests that the actual value is a double or float NaN + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test that the actual value is an NaN + + + + + + + NoItemConstraint applies another constraint to each + item in a collection, failing if any of them succeeds. + + + + + Construct a SomeItemsConstraint on top of an existing constraint + + + + + + 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. + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + 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 + + + + NullConstraint tests that the actual value is null + + + + + Initializes a new instance of the class. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + 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. + + + + + Returns the default NUnitComparer. + + + + + Compares two objects + + + + + + + + NUnitEqualityComparer encapsulates NUnit's handling of + equality tests between objects. + + + + + If true, all string comparisons will ignore case + + + + + If true, arrays will be treated as collections, allowing + those of different dimensions to be compared + + + + + Comparison objects used in comparisons for some constraints. + + + + + List of points at which a failure occurred. + + + + + List of comparers used to compare pairs of objects. + + + + + Initializes a new instance of the class. + + + + + 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 the list of external comparers to be used to + test for equality. They are applied to members of + collections, in place of NUnit's own logic. + + + + + Gets the list of failure points for the last Match performed. + The list consists of objects to be interpreted by the caller. + This generally means that the caller may only make use of + objects it has placed on the list at a particular depth. + + + + + Flags the comparer to include + property in comparison of two values. + + + Using this modifier does not allow to use the + modifier. + + + + + Compares two objects for equality within a tolerance. + + + + + 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 + + + + + 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. + + + + + Operator that requires both its arguments to succeed + + + + + Construct an AndOperator + + + + + Apply the operator to produce an AndConstraint + + + + + 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. + + + + + 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. + + + + + + Gets the left precedence of the operator + + + + + Gets the right precedence of the operator + + + + + Abstract method that produces a constraint by applying + the operator to its left and right constraint arguments. + + + + + Abstract base for operators that indicate how to + apply a constraint to items in a collection. + + + + + Constructs a CollectionOperator + + + + + 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. + + + + + The syntax element preceding this operator + + + + + The syntax element following 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. + + + + + 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. + + + + + + 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 + + + + 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. + + + + + + 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. + + + + + Negates the test of the constraint it wraps. + + + + + Constructs a new NotOperator + + + + + Returns a NotConstraint applied to its argument. + + + + + Operator that requires at least one of its arguments to succeed + + + + + Construct an OrOperator + + + + + Apply the operator to produce an OrConstraint + + + + + PrefixOperator takes a single constraint and modifies + its 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. + + + + + + + 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. + + + + + Gets the name of the property to which the operator applies + + + + + 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. + + + + + + Abstract base class for operators that are able to reduce to a + constraint whether or not another syntactic element follows. + + + + + 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. + + + + + 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. + + + + + Represents a constraint that simply wraps the + constraint provided as an argument, without any + further functionality, but which modifies the + order of evaluation because of its precedence. + + + + + Constructor for the WithOperator + + + + + Returns a constraint that wraps its argument + + + + + OrConstraint succeeds if either member succeeds + + + + + Create an OrConstraint from two other constraints + + The first constraint + The second constraint + + + + Gets text describing a 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 + + + + PathConstraint serves as the abstract base of constraints + that operate on paths and provides several helper methods. + + + + + Construct a PathConstraint for a give expected path + + The expected path + + + + Modifies the current instance to be case-sensitive + and returns it. + + + + + Returns the string representation of this constraint + + + + + Canonicalize the provided path + + + The path in standardized form + + + + Test whether one path in canonical form is a subpath of another path + + The first path - supposed to be the parent path + The second path - supposed to be the child path + + + + + Predicate constraint wraps a Predicate in a constraint, + returning success if the predicate is true. + + + + + Construct a PredicateConstraint from a predicate + + + + + Gets text describing a constraint + + + + + Determines whether the predicate succeeds when applied + to the actual value. + + + + + Abstract base class used for prefixes + + + + + The base constraint + + + + + Prefix used in forming the constraint description + + + + + Construct given a base constraint + + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Formats a prefix constraint's description. + + + + + 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 + + + + Returns the string representation of the constraint. + + + + + Contains the result of matching a against an actual value. + + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The base result with actual value to which the Constraint was applied. + + + + Write the additional failure message for a failing constraint to a + MessageWriter. + + The writer on which the actual value is displayed + + + + 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 value + of the property. The two constraints are now separate. + + + + + Initializes a new instance of the class. + + The name of the property. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the property exists for a given object + + The object to be tested + True for success, false for failure + + + + Returns the string representation of the constraint. + + + + + + RangeConstraint tests whether two values are within a + specified range. + + + + + Initializes a new instance of the class. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use a and returns self. + + + + + 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 + + + + 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. + + + + + Appends an And Operator to the expression + + + + + Appends an Or operator to the expression. + + + + + Resolve the current expression to a Constraint + + + + + ReusableConstraint wraps a constraint expression after + resolving it so that it can be reused consistently. + + + + + Construct a ReusableConstraint from a constraint expression + + The expression to be resolved and reused + + + + Converts a constraint to a ReusableConstraint + + The constraint to be converted + A ReusableConstraint + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Return the top-level constraint for this expression + + + + + + SameAsConstraint tests whether an object is identical to + the object passed to its constructor + + + + + Initializes a new instance of the class. + + The expected object. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Summary description for SamePathConstraint. + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + SamePathOrUnderConstraint tests that one path is under another + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + 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 + + + + + + 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. + + + + + Apply the item constraint to each item in the collection, + succeeding if any item succeeds. + + + + + + + Flag the constraint to use the supplied object. + + The type of the elements in the collection. + The type of the member. + The comparison function to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + 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. + + + + + + + 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 + + + + + Description of this constraint + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Constructs a StringConstraint without an expected value + + + + + Constructs a StringConstraint given an expected value + + The expected value + + + + Modify the constraint to ignore case in matching. + + + + + 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 a given string + + The string to be tested + True for success, false for failure + + + + SubPathConstraint tests that the actual path is under the expected path + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + SubstringConstraint can test whether a string contains + the expected substring. + + + + + Initializes a new instance of the class. + + The expected. + + + + Modify the constraint to ignore case in matching. + This will call Using(StringComparison.CurrentCultureIgnoreCase). + + Thrown when a comparison type different + than was already set. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Modify the constraint to the specified comparison. + + Thrown when a comparison type different + than was already set. + + + + 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. + + + + Get the actual exception thrown - used by Assert.Throws. + + + + + Gets text describing a constraint + + + + + 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 actual value for a failing constraint test to a + MessageWriter. This override only handles the special message + used when an exception is expected but none is thrown. + + The writer on which the actual value is displayed + + + + ThrowsExceptionConstraint tests that an exception has + been thrown, without any further tests. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Executes the code and returns success if an exception is thrown. + + A delegate representing the code to be tested + True if an exception is thrown, otherwise false + + + + Applies the constraint to 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. + + + + + ThrowsNothingConstraint tests that a delegate does not + throw an exception. + + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True if no exception is thrown, otherwise false + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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. + + + + + Returns a default Tolerance object, equivalent to an exact match. + + + + + Returns an empty Tolerance object, equivalent to an exact match. + + + + + Constructs a linear tolerance of a specified amount + + + + + Constructs a tolerance given an amount and + + + + + 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 as the amount, using + the current amount as a number of days. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of hours. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of minutes. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of seconds. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of milliseconds. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of clock ticks. + + + + + Gets the for the current Tolerance + + + + + Gets the magnitude of the current Tolerance instance. + + + + + Returns true if the current tolerance has not been set or is using the . + + + + + Apply the tolerance to an expected value and return + a Tolerance.Range that represents the acceptable values. + + + + + Tests that the current Tolerance is linear with a + numeric value, throwing an exception if it is not. + + + + + Tolerance.Range represents the range of values that match + a specific tolerance, when applied to a specific value. + + + + + The lower bound of the range + + + + + The upper bound of the range + + + + + Constructs a range + + + + + 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. + + + + + TrueConstraint tests that the actual value is true + + + + + Initializes a new instance of the class. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + TypeConstraint is the abstract base for constraints + that take a Type as their expected value. + + + + + The expected Type used by the constraint + + + + + The type of the actual argument to which the constraint was applied + + + + + Construct a TypeConstraint for a given Type + + The expected type for the constraint + Prefix used in forming the constraint description + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + UniqueItemsConstraint tests whether all the items in a + collection are unique. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Check that all items are unique. + + + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the dictionary. + + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the dictionary. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Asserts on Directories + + + + + DO NOT USE! Use DirectoryAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both point to the same directory. + 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 the 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 point to the same directory. + If they are not 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 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 + + + + Asserts that the directory exists. If it does not exist + an is thrown. + + 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 the directory exists. If it does not exist + an is thrown. + + A directory containing the actual value + + + + Asserts that the directory exists. If it does not exist + an is thrown. + + The path to 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 the directory exists. If it does not exist + an is thrown. + + The path to a directory containing the actual value + + + + Asserts that the directory does not exist. If it does exist + an is thrown. + + 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 the directory does not exist. If it does exist + an is thrown. + + A directory containing the actual value + + + + Asserts that the directory does not exist. If it does exist + an is thrown. + + The path to 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 the directory does not exist. If it does exist + an is thrown. + + The path to a directory containing the actual value + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a constraint that succeeds if the value + is a file or directory and it exists. + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new . 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 new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the Dictionary key collection. + + The key to be matched in the Dictionary key collection + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the Dictionary value collection. + + The value to be matched in the Dictionary value collection + + + + 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 regular expression supplied as an argument. + + + + + 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 + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Gets the ResultState provided by this exception + + + + + 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 + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + Default Constructor + + + + + Construct based on the TestResult so far. This is the constructor + used normally, when exiting the multiple assert block with failures. + Not used internally but provided to facilitate debugging. + + + The current result, up to this point. The result is not used + internally by NUnit but is provided to facilitate debugging. + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Gets the provided by this exception. + + + + + Gets the of this test at the point the exception was thrown, + + + + + Abstract base for Exceptions that terminate a test and provide a ResultState. + + + + 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 + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Gets the ResultState provided by this exception + + + + + Contains extension methods that do not require a special using directive. + + + + + Asserts on Files + + + + + DO NOT USE! Use FileAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Asserts that the file exists. If it does not exist + an is thrown. + + 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 the file exists. If it does not exist + an is thrown. + + A file containing the actual value + + + + Asserts that the file exists. If it does not exist + an is thrown. + + 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 the file exists. If it does not exist + an is thrown. + + The path to a file containing the actual value + + + + Asserts that the file does not exist. If it does exist + an is thrown. + + 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 the file does not exist. If it does exist + an is thrown. + + A file containing the actual value + + + + Asserts that the file does not exist. If it does exist + an is thrown. + + 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 the file does not exist. If it does exist + an is thrown. + + The path to a file containing the actual value + + + + Class used to guard against unexpected argument values + or operations by throwing an appropriate exception. + + + + + Throws an exception if an argument is null + + The value to be tested + The name of the argument + + + + Throws an exception if a string argument is null or empty + + The value to be tested + The name of the argument + + + + Throws an ArgumentOutOfRangeException if the specified condition is not met. + + The condition that must be met + The exception message to be used + The name of the argument + + + + Throws an ArgumentException if the specified condition is not met. + + The condition that must be met + The exception message to be used + The name of the argument + + + + Throws an InvalidOperationException if the specified condition is not met. + + The condition that must be met + The exception message to be used + + + + Throws an if the specified delegate is async void. + + + + + Throws an if the specified delegate is async void. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + 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 ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a which will apply + the following constraint to only one member of the collection, + and fail if none or more than one match occurs. + + + + + 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 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 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 checking for the + presence of a particular object in the collection. + + + + + The AssertionResult class represents the result of a single assertion. + + + + + Construct an AssertionResult + + + + The pass/fail status of the assertion + + + The message produced by the assertion, or null + + + The stack trace associated with the assertion, or null + + + + ToString Override + + + + + Override GetHashCode + + + + + Override Equals + + + + + + AssertionStatus enumeration represents the possible outcomes of an assertion. + The order of definition is significant, higher level values override lower + ones in determining the overall result of a test. + + + + + An assumption failed + + + + + The assertion succeeded + + + + + A warning message was issued + + + + + The assertion failed + + + + + An unexpected exception was thrown + + + + + The IApplyToContext interface is implemented by attributes + that want to make changes to the execution context before + a test is run. + + + + + Apply changes to the execution context + + The execution context + + + + The IApplyToTest interface is implemented by self-applying + attributes that modify the state of a test in some way. + + + + + Modifies a test as defined for the specific attribute. + + The test to modify + + + + CombiningStrategy is the abstract base for classes that + know how to combine values provided for individual test + parameters to create a set of test cases. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + ICommandWrapper is implemented by attributes and other + objects able to wrap a TestCommand with another command. + + + Attributes or other objects should implement one of the + derived interfaces, rather than this one, since they + indicate in which part of the command chain the wrapper + should be applied. + + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + Objects implementing this interface are used to wrap + the TestMethodCommand itself. They apply after SetUp + has been run and before TearDown. + + + + + Objects implementing this interface are used to wrap + the entire test, including SetUp and TearDown. + + + + + Objects implementing this interface are used to wrap + tests that can repeat. The implementing command is run once, + invoking the chained commands any number of times. + + + + + Any ITest that implements this interface is at a level that the implementing + class should be disposed at the end of the test run + + + + + The IFixtureBuilder interface is exposed by a class that knows how to + build test fixtures from a specified type. In general, it is exposed + by an attribute, but it may be implemented in a helper class used by the + attribute in some cases. + + + + + Builds any number of test fixtures from the specified type. + + The type info of the fixture to be used. + + + + The IFixtureBuilder2 interface extends IFixtureBuilder by allowing + use of a PreFilter, which is used to select methods as test cases. + + + + + Builds any number of test fixtures from the specified type. + + The type info of the fixture to be used. + PreFilter to be used to select methods. + + + + IImplyFixture is an empty marker interface used by attributes like + TestAttribute that cause the class where they are used to be treated + as a TestFixture even without a TestFixtureAttribute. + + Marker interfaces are not usually considered a good practice, but + we use it here to avoid cluttering the attribute hierarchy with + classes that don't contain any extra implementation. + + + + + The IMethodInfo class is used to encapsulate information + about a method in a platform-independent manner. + + + + + Gets the Type from which this method was reflected. + + + + + Gets the MethodInfo for this method. + + + + + Gets the name of the method. + + + + + Gets a value indicating whether the method is abstract. + + + + + Gets a value indicating whether the method is public. + + + + + Gets a value indicating whether the method contains unassigned generic type parameters. + + + + + Gets a value indicating whether the method is a generic method. + + + + + Gets a value indicating whether the MethodInfo represents the definition of a generic method. + + + + + Gets the return Type of the method. + + + + + Gets the parameters of the method. + + + + + + Returns the Type arguments of a generic method or the Type parameters of a generic method definition. + + + + + Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo. + + The type arguments to be used + A new IMethodInfo with the type arguments replaced + + + + Invokes the method, converting any TargetInvocationException to an NUnitException. + + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + Provides data for a single test parameter. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test. + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + Provides data for a single test parameter. + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + The IParameterInfo interface is an abstraction of a .NET parameter. + + + + + Gets a value indicating whether the parameter is optional + + + + + Gets an IMethodInfo representing the method for which this is a parameter + + + + + Gets the underlying .NET ParameterInfo + + + + + Gets the Type of the parameter + + + + + Implemented by filters for use in deciding which + Types and Methods should be used to generate tests. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + A PropertyBag represents a collection of name/value pairs + that allows duplicate entries with the same key. Methods + are provided for adding a new pair as well as for setting + a key to a single value. All keys are strings but values + may be of any type. Null values are not permitted, since + a null entry represents the absence of the key. + + The entries in a PropertyBag are of two kinds: those that + take a single value and those that take multiple values. + However, the PropertyBag has no knowledge of which entries + fall into each category and the distinction is entirely + up to the code using the PropertyBag. + + When working with multi-valued properties, client code + should use the Add method to add name/value pairs and + indexing to retrieve a list of all values for a given + key. For example: + + bag.Add("Tag", "one"); + bag.Add("Tag", "two"); + Assert.That(bag["Tag"], + Is.EqualTo(new string[] { "one", "two" })); + + When working with single-valued properties, client code + should use the Set method to set the value and Get to + retrieve the value. The GetSetting methods may also be + used to retrieve the value in a type-safe manner while + also providing default. For example: + + bag.Set("Priority", "low"); + bag.Set("Priority", "high"); // replaces value + Assert.That(bag.Get("Priority"), + Is.EqualTo("high")); + Assert.That(bag.GetSetting("Priority", "low"), + Is.EqualTo("high")); + + + + + Adds a key/value pair to the property bag + + The key + The value + + + + Sets the value for a key, removing any other + values that are already in the property set. + + + + + + + Gets a single value for a key, using the first + one if multiple values are present and returning + null if the value is not found. + + + + + Gets a flag indicating whether the specified key has + any entries in the property set. + + The key to be checked + True if their are values present, otherwise false + + + + Gets or sets the list of values for a particular key + + The key for which the values are to be retrieved or set + + + + Gets a collection containing all the keys in the property set + + + + + The IReflectionInfo interface is implemented by NUnit wrapper objects that perform reflection. + + + + + Returns an array of custom attributes of the specified type applied to this object + + + + + Returns a value indicating whether an attribute of the specified type is defined on this object. + + + + + The ISimpleTestBuilder interface is exposed by a class that knows how to + build a single tests from a specified method. In general, + it is exposed by an attribute, but it may be implemented in a helper class + used by the attribute in some cases. + + + + + Builds a single test from the specified method and context. + + The method to be used as a test + The TestSuite to which the method will be added + + + + The ISuiteBuilder interface is exposed by a class that knows how to + build a single test suite from a specified type. + + + + + Examine the type and determine if it is suitable for + this builder to use in building a TestSuite. + + Note that returning false will cause the type to be ignored + in loading the tests. If it is desired to load the suite + but label it as non-runnable, ignored, etc., then this + method must return true. + + The type of the fixture to be used + + + + Builds a single test suite from the specified type. + + The type of the fixture to be used + + + + Builds a single test suite from the specified type, subject + to a filter that decides which methods are included. + + The type of the fixture to be used + A PreFilter for selecting methods. + + + + Common interface supported by all representations + of a test. Only includes informational fields. + The Run method is specifically excluded to allow + for data-only representations of a test. + + + + + Gets the id of the test + + + + + Gets the name of the test + + + + + Gets the type of the test + + + + + Gets the fully qualified name of the test + + + + + Gets the name of the class containing this test. Returns + null if the test is not associated with a class. + + + + + Gets the name of the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + Gets the Type of the test fixture, if applicable, or + null if no fixture type is associated with this test. + + + + + Gets the method which declares the test, or + if no method is associated with this test. + + + + + Gets the RunState of the test, indicating whether it can be run. + + + + + Count of the test cases ( 1 if this is a test case ) + + + + + Gets the properties of the test + + + + + Gets the parent test, if any. + + The parent test or null if none exists. + + + + Returns true if this is a test suite + + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets this test's child tests + + A list of child tests + + + + Gets a fixture object for running this test. + + + + + The arguments to use in creating the test or empty array if none are required. + + + + + The ITestBuilder interface is exposed by a class that knows how to + build tests from a specified method. In general, it is exposed + by an attribute which has additional information available to provide + the necessary test parameters to distinguish the test cases built. + + + + + Builds any number of tests from the specified method and context. + + The method to be used as a test + The TestSuite to which the method will be added + + + + The ITestCaseBuilder interface is exposed by a class that knows how to + build a test from a specified method, possibly containing child test cases. + + + + + Examine the method and determine if it is suitable for + this builder to use in building a TestCase to be + included in the suite being populated. + + Note that returning false will cause the method to be ignored + in loading the tests. If it is desired to load the method + but label it as non-runnable, ignored, etc., then this + method must return true. + + The test method to examine + The suite being populated + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method to be used as a test case + The test suite being populated, or null + + + + The ITestCaseData interface is implemented by a class + that is able to return complete test cases for use by + a parameterized test method. + + + + + Gets the expected result of the test case + + + + + Returns true if an expected result has been set + + + + + The ITestData interface is implemented by a class that + represents a single instance of a parameterized test. + + + + + Gets the name to be used for the test + + + + + Gets the RunState for this test case. + + + + + Gets the argument list to be provided to the test + + + + + Gets the property dictionary for the test case + + + + + Interface to be implemented by filters applied to tests. + The filter applies when running the test, after it has been + loaded, since this is the only time an ITest exists. + + + + + Determine if a particular test passes the filter criteria. Pass + may examine the parents and/or descendants of a test, depending + on the semantics of the particular filter + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + The ITestCaseData interface is implemented by a class + that is able to return the data required to create an + instance of a parameterized test fixture. + + + + + Get the TypeArgs if separately set + + + + + The ITestListener interface is used internally to receive + notifications of significant events while a test is being + run. The events are propagated to clients by means of an + AsyncCallback. NUnit extensions may also monitor these events. + + + + + Called when a test has just started + + The test that is starting + + + + Called when a test has finished + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + The ITestResult interface represents the result of a test. + + + + + Gets the ResultState of the test result, which + indicates the success or failure of the test. + + + + + Gets the name of the test result + + + + + Gets the full name of the test result + + + + + Gets the elapsed time for running the test in seconds + + + + + Gets or sets the time the test started running. + + + + + Gets or sets the time the test finished running. + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + Gets the number of asserts executed + when running the test and all its children. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + Accessing HasChildren should not force creation of the + Children collection in classes implementing this interface. + + + + + Gets the collection of child results. + + + + + Gets the Test to which this result applies. + + + + + Gets any text output written to this result. + + + + + Gets a list of AssertionResults associated with the test + + + + + Gets the collection of files attached to the test + + + + + The ITypeInfo interface is an abstraction of a .NET Type + + + + + Gets the underlying Type on which this ITypeInfo is based + + + + + Gets the base type of this type as an ITypeInfo + + + + + Returns true if the Type wrapped is equal to the argument + + + + + Gets the name of the Type + + + + + Gets the full name of the Type + + + + + Gets the assembly in which the type is declared + + + + + Gets the namespace of the Type + + + + + Gets a value indicating whether the type is abstract. + + + + + Gets a value indicating whether the Type is a generic Type + + + + + Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types. + + + + + Gets a value indicating whether the Type is a generic Type definition + + + + + Gets a value indicating whether the type is sealed. + + + + + Gets a value indicating whether this type is a static class. + + + + + Get the display name for this typeInfo. + + + + + Get the display name for an object of this type, constructed with specific arguments + + + + + Returns a Type representing a generic type definition from which this Type can be constructed. + + + + + Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments + + + + + Returns a value indicating whether this type has a method with a specified public attribute + + + + + Returns an array of IMethodInfos for methods of this Type + that match the specified flags. + + + + + Gets the public constructor taking the specified argument Types + + + + + Returns a value indicating whether this Type has a public constructor taking the specified argument Types. + + + + + Construct an object of this Type, using the specified arguments. + + + + + An object implementing IXmlNodeBuilder is able to build + an XML representation of itself and any children. + + + + + Returns a TNode representing the current object. + + If true, children are included where applicable + A TNode representing the result + + + + Returns a TNode representing the current object after + adding it as a child of the supplied parent node. + + The parent node. + If true, children are included, where applicable + + + + + The ResultState class represents the outcome of running a test. + It contains two pieces of information. The Status of the test + is an enum indicating whether the test passed, failed, was + skipped or was inconclusive. The Label provides a more + detailed breakdown for use by client runners. + + + + + Initializes a new instance of the class. + + The TestStatus. + + + + Initializes a new instance of the class. + + The TestStatus. + The label. + + + + Initializes a new instance of the class. + + The TestStatus. + The stage at which the result was produced + + + + Initializes a new instance of the class. + + The TestStatus. + The label. + The stage at which the result was produced + + + + The result is inconclusive + + + + + The test has been skipped. + + + + + The test has been ignored. + + + + + The test was skipped because it is explicit + + + + + The test succeeded + + + + + The test issued a warning + + + + + The test failed + + + + + The test encountered an unexpected exception + + + + + The test was cancelled by the user + + + + + The test was not runnable. + + + + + A suite failed because one or more child tests failed or had errors + + + + + A suite failed because one or more child tests had warnings + + + + + A suite is marked ignored because one or more child tests were ignored + + + + + A suite failed in its OneTimeSetUp + + + + + A suite had an unexpected exception in its OneTimeSetUp + + + + + A suite had an unexpected exception in its OneTimeDown + + + + + Gets the TestStatus for the test. + + The status. + + + + Gets the label under which this test result is + categorized, if any. + + + + + Gets the stage of test execution in which + the failure or other result took place. + + + + + Get a new ResultState, which is the same as the current + one but with the FailureSite set to the specified value. + + The FailureSite to use + A new ResultState + + + + Test whether this ResultState has the same Status and Label + as another one. In other words, the whether two are equal + ignoring the Site. + + + + + + + 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. + + + + + Overload == operator for ResultStates + + + + + Overload != operator for ResultStates + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + The FailureSite enum indicates the stage of a test + in which an error or failure occurred. + + + + + Failure in the test itself + + + + + Failure in the SetUp method + + + + + Failure in the TearDown method + + + + + Failure of a parent test + + + + + Failure of a child test + + + + + The RunState enum indicates whether a test can be executed. + + + + + The test is not runnable. + + + + + The test is runnable. + + + + + The test can only be run explicitly + + + + + The test has been skipped. This value may + appear on a Test when certain attributes + are used to skip the test. + + + + + The test has been ignored. May appear on + a Test, when the IgnoreAttribute is used. + + + + + The TestAttachment class represents a file attached to a TestResult, + with an optional description. + + + + + Absolute file path to attachment file + + + + + User specifed description of attachment. May be null. + + + + + Creates a TestAttachment class to represent a file attached to a test result. + + Absolute file path to attachment file + User specifed description of attachment. May be null. + + + + The class holds a message sent by a test to all listeners + + + + + Construct with text, destination type and + the name of the test that produced the message. + + Destination of the message + Text to be sent + ID of the test that produced the message + + + + Converts object to string + + + + + The message to send to listeners + + + + + The Destination of the message. + + + + + The ID of the test that sent the message + + + + + Returns the XML representation of the object. + + + + + The TestOutput class holds a unit of output from + a test to a specific output stream + + + + + Construct with text, output destination type and + the name of the test that produced the output. + + Text to be output + Name of the stream or channel to which the text should be written + Id of the test that produced the output + FullName of test that produced the output + + + + Return string representation of the object for debugging + + + + + + Get the text + + + + + Get the output type + + + + + Get the name of the test that created the output + + + + + Get the id of the test that created the output + + + + + Convert the TestOutput object to an XML string + + + + + The TestStatus enum indicates the result of running a test + + + + + The test was inconclusive + + + + + The test has skipped + + + + + The test succeeded + + + + + There was a warning + + + + + The test failed + + + + + TNode represents a single node in the XML representation + of a Test or TestResult. It replaces System.Xml.XmlNode and + System.Xml.Linq.XElement, providing a minimal set of methods + for operating on the XML in a platform-independent manner. + + + + + Constructs a new instance of TNode + + The name of the node + + + + Constructs a new instance of TNode with a value + + The name of the node + The text content of the node + + + + Constructs a new instance of TNode with a value + + The name of the node + The text content of the node + Flag indicating whether to use CDATA when writing the text + + + + Gets the name of the node + + + + + Gets the value of the node + + + + + Gets a flag indicating whether the value should be output using CDATA. + + + + + Gets the dictionary of attributes + + + + + Gets a list of child nodes + + + + + Gets the first ChildNode + + + + + Gets the XML representation of this node. + + + + + Create a TNode from its XML text representation + + The XML text to be parsed + A TNode + + + + Adds a new element as a child of the current node and returns it. + + The element name. + The newly created child element + + + + Adds a new element with a value as a child of the current node and returns it. + + The element name + The text content of the new element + The newly created child element + + + + Adds a new element with a value as a child of the current node and returns it. + The value will be output using a CDATA section. + + The element name + The text content of the new element + The newly created child element + + + + Adds an attribute with a specified name and value to the XmlNode. + + The name of the attribute. + The value of the attribute. + + + + Finds a single descendant of this node matching an XPath + specification. The format of the specification is + limited to what is needed by NUnit and its tests. + + + + + + + Finds all descendants of this node matching an XPath + specification. The format of the specification is + limited to what is needed by NUnit and its tests. + + + + + Writes the XML representation of the node to an XmlWriter + + + + + + Class used to represent a list of XmlResults + + + + + Class used to represent the attributes of a node + + + + + Gets or sets the value associated with the specified key. + Overridden to return null if attribute is not found. + + The key. + Value of the attribute or null + + + + AssemblyHelper provides static methods for working + with assemblies. + + + + + Gets the path from which an assembly was loaded. + For builds where this is not possible, returns + the name of the assembly. + + The assembly. + The path. + + + + Gets the path to the directory from which an assembly was loaded. + + The assembly. + The path. + + + + Gets the AssemblyName of an assembly. + + The assembly + An AssemblyName + + + + Loads an assembly given a string, which is the AssemblyName + + + + + Gets the assembly path from code base. + + Public for testing purposes + The code base. + + + + + CombinatorialStrategy creates test cases by using all possible + combinations of the parameter data. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + Provides data from fields marked with the DatapointAttribute or the + DatapointsAttribute. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + Built-in SuiteBuilder for all types of test classes. + + + + + Examine the type and determine if it is suitable for + this builder to use in building a TestSuite. + + Note that returning false will cause the type to be ignored + in loading the tests. If it is desired to load the suite + but label it as non-runnable, ignored, etc., then this + method must return true. + + The fixture type to check + + + + Builds a single test suite from the specified type. + + The fixture type to build + + + + Builds a single test suite from the specified type, subject + to a filter that decides which methods are included. + + The fixture type to build + A PreFilter for selecting methods. + + + + We look for attributes implementing IFixtureBuilder at one level + of inheritance at a time. Attributes on base classes are not used + unless there are no fixture builder attributes at all on the derived + class. This is by design. + + The type being examined for attributes + + + + Class to build ether a parameterized or a normal NUnitTestMethod. + There are four cases that the builder must deal with: + 1. The method needs no params and none are provided + 2. The method needs params and they are provided + 3. The method needs no params but they are provided in error + 4. The method needs params but they are not provided + This could have been done using two different builders, but it + turned out to be simpler to have just one. The BuildFrom method + takes a different branch depending on whether any parameters are + provided, but all four cases are dealt with in lower-level methods + + + + + Determines if the method can be used to build an NUnit test + test method of some kind. The method must normally be marked + with an identifying attribute for this to be true. + + Note that this method does not check that the signature + of the method for validity. If we did that here, any + test methods with invalid signatures would be passed + over in silence in the test run. Since we want such + methods to be reported, the check for validity is made + in BuildFrom rather than here. + + An IMethodInfo for the method being used as a test method + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method for which a test is to be built + + + + Determines if the method can be used to build an NUnit test + test method of some kind. The method must normally be marked + with an identifying attribute for this to be true. + + Note that this method does not check that the signature + of the method for validity. If we did that here, any + test methods with invalid signatures would be passed + over in silence in the test run. Since we want such + methods to be reported, the check for validity is made + in BuildFrom rather than here. + + An IMethodInfo for the method being used as a test method + The test suite being built, to which the new test would be added + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method for which a test is to be built + The test fixture being populated, or null + + + + Builds a ParameterizedMethodSuite containing individual test cases. + + The method for which a test is to be built. + The list of test cases to include. + + + + Build a simple, non-parameterized TestMethod for this method. + + The MethodInfo for which a test is to be built + The test suite for which the method is being built + + + + Class that can build a tree of automatic namespace + suites from a group of fixtures. + + + + + NamespaceDictionary of all test suites we have created to represent + namespaces. Used to locate namespace parent suites for fixtures. + + + + + Point in the tree where items in the global namespace are added + + + + + Initializes a new instance of the class. + + The root suite. + + + + Gets the root entry in the tree created by the NamespaceTreeBuilder. + + The root suite. + + + + Adds the specified fixtures to the tree. + + The fixtures to be added. + + + + Adds the specified fixture to the tree. + + The fixture to be added. + + + + NUnitTestCaseBuilder is a utility class used by attributes + that build test cases. + + + + + Constructs an + + + + + Builds a single NUnitTestMethod, either as a child of the fixture + or as one of a set of test cases under a ParameterizedTestMethodSuite. + + The MethodInfo from which to construct the TestMethod + The suite or fixture to which the new test will be added + The ParameterSet to be used, or null + + + + Checks to see if we have valid combinations of attributes. + + The TestMethod to be checked. If it + is found to be non-runnable, it will be modified. + True if the method signature is valid, false if not + + + + Helper method that checks the signature of a TestMethod and + any supplied parameters to determine if the test is valid. + + Currently, NUnitTestMethods are required to be public, + non-abstract methods, either static or instance, + returning void. They may take arguments but the values must + be provided or the TestMethod is not considered runnable. + + Methods not meeting these criteria will be marked as + non-runnable and the method will return false in that case. + + The TestMethod to be checked. If it + is found to be non-runnable, it will be modified. + Parameters to be used for this test, or null + True if the method signature is valid, false if not + + The return value is no longer used internally, but is retained + for testing purposes. + + + + + NUnitTestFixtureBuilder is able to build a fixture given + a class marked with a TestFixtureAttribute or an unmarked + class containing test methods. In the first case, it is + called by the attribute and in the second directly by + NUnitSuiteBuilder. + + + + + Build a TestFixture from type provided. A non-null TestSuite + must always be returned, since the method is generally called + because the user has marked the target class as a fixture. + If something prevents the fixture from being used, it should + be returned nonetheless, labelled as non-runnable. + + An ITypeInfo for the fixture to be used. + Filter used to select methods as tests. + A TestSuite object or one derived from TestSuite. + + + + Overload of BuildFrom called by tests that have arguments. + Builds a fixture using the provided type and information + in the ITestFixtureData object. + + The TypeInfo for which to construct a fixture. + Filter used to select methods as tests. + An object implementing ITestFixtureData or null. + + + + + Method to add test cases to the newly constructed fixture. + + + + + Method to create a test case from a MethodInfo and add + it to the fixture being built. It first checks to see if + any global TestCaseBuilder addin wants to build the + test case. If not, it uses the internal builder + collection maintained by this fixture builder. + + The default implementation has no test case builders. + Derived classes should add builders to the collection + in their constructor. + + The method for which a test is to be created + The test suite being built. + A newly constructed Test + + + + PairwiseStrategy creates test cases by combining the parameter + data so that all possible pairs of data items are used. + + + + The number of test cases that cover all possible pairs of test function + parameters values is significantly less than the number of test cases + that cover all possible combination of test function parameters values. + And because different studies show that most of software failures are + caused by combination of no more than two parameters, pairwise testing + can be an effective ways to test the system when it's impossible to test + all combinations of parameters. + + + The PairwiseStrategy code is based on "jenny" tool by Bob Jenkins: + http://burtleburtle.net/bob/math/jenny.html + + + + + + FleaRand is a pseudo-random number generator developed by Bob Jenkins: + http://burtleburtle.net/bob/rand/talksmall.html#flea + + + + + Initializes a new instance of the FleaRand class. + + The seed. + + + + FeatureInfo represents coverage of a single value of test function + parameter, represented as a pair of indices, Dimension and Feature. In + terms of unit testing, Dimension is the index of the test parameter and + Feature is the index of the supplied value in that parameter's list of + sources. + + + + + Initializes a new instance of FeatureInfo class. + + Index of a dimension. + Index of a feature. + + + + A FeatureTuple represents a combination of features, one per test + parameter, which should be covered by a test case. In the + PairwiseStrategy, we are only trying to cover pairs of features, so the + tuples actually may contain only single feature or pair of features, but + the algorithm itself works with triplets, quadruples and so on. + + + + + Initializes a new instance of FeatureTuple class for a single feature. + + Single feature. + + + + Initializes a new instance of FeatureTuple class for a pair of features. + + First feature. + Second feature. + + + + TestCase represents a single test case covering a list of features. + + + + + Initializes a new instance of TestCaseInfo class. + + A number of features in the test case. + + + + PairwiseTestCaseGenerator class implements an algorithm which generates + a set of test cases which covers all pairs of possible values of test + function. + + + + The algorithm starts with creating a set of all feature tuples which we + will try to cover (see method). This set + includes every single feature and all possible pairs of features. We + store feature tuples in the 3-D collection (where axes are "dimension", + "feature", and "all combinations which includes this feature"), and for + every two feature (e.g. "A" and "B") we generate both ("A", "B") and + ("B", "A") pairs. This data structure extremely reduces the amount of + time needed to calculate coverage for a single test case (this + calculation is the most time-consuming part of the algorithm). + + + Then the algorithm picks one tuple from the uncovered tuple, creates a + test case that covers this tuple, and then removes this tuple and all + other tuples covered by this test case from the collection of uncovered + tuples. + + + Picking a tuple to cover + + + There are no any special rules defined for picking tuples to cover. We + just pick them one by one, in the order they were generated. + + + Test generation + + + Test generation starts from creating a completely random test case which + covers, nevertheless, previously selected tuple. Then the algorithm + tries to maximize number of tuples which this test covers. + + + Test generation and maximization process repeats seven times for every + selected tuple and then the algorithm picks the best test case ("seven" + is a magic number which provides good results in acceptable time). + + Maximizing test coverage + + To maximize tests coverage, the algorithm walks through the list of mutable + dimensions (mutable dimension is a dimension that are not included in + the previously selected tuple). Then for every dimension, the algorithm + walks through the list of features and checks if this feature provides + better coverage than randomly selected feature, and if yes keeps this + feature. + + + This process repeats while it shows progress. If the last iteration + doesn't improve coverage, the process ends. + + + In addition, for better results, before start every iteration, the + algorithm "scrambles" dimensions - so for every iteration dimension + probes in a different order. + + + + + + Creates a set of test cases for specified dimensions. + + + An array which contains information about dimensions. Each element of + this array represents a number of features in the specific dimension. + + + A set of test cases. + + + + + Gets the test cases generated by this strategy instance. + + A set of test cases. + + + + The ParameterDataProvider class implements IParameterDataProvider + and hosts one or more individual providers. + + + + + Construct with a collection of individual providers + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + ParameterDataSourceProvider supplies individual argument values for + single parameters using attributes implementing IParameterDataSource. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + SequentialStrategy creates test cases by using all of the + parameter data sources in parallel, substituting null + when any of them run out of data. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + TestActionAfterCommand handles the AfterTest method of a single + TestActionItem, provided the items BeforeTest has been run. + + + + + Initializes a new instance of the class. + + The inner command. + The TestActionItem to run before the inner command. + + + + AfterCommand is a DelegatingTestCommand that performs some + specific action after the inner command is run. + + + + + Construct an AfterCommand + + + + + Execute the command + + + + + Set this to perform action after the inner command. + + + + + ContextSettingsCommand applies specified changes to the + TestExecutionContext prior to running a test. No special + action is needed after the test runs, since the prior + context will be restored automatically. + + + + + TestActionCommand handles a single ITestAction applied + to a test. It runs the BeforeTest method, then runs the + test and finally runs the AfterTest method. + + + + + Initializes a new instance of the class. + + The inner command. + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Perform the before test action + + + + + Perform the after test action + + + + + TestActionBeforeCommand handles the BeforeTest method of a single + TestActionItem, relying on the item to remember it has been run. + + + + + Initializes a new instance of the class. + + The inner command. + The TestActionItem to run before the inner command. + + + + BeforeTestCommand is a DelegatingTestCommand that performs some + specific action before the inner command is run. + + + + + Construct a BeforeCommand + + + + + Execute the command + + + + + Action to perform before the inner command. + + + + + ConstructFixtureCommand constructs the user test object if necessary. + + + + + Constructs a OneTimeSetUpCommand for a suite + + The inner command to which the command applies + + + + DelegatingTestCommand wraps an inner TestCommand. + Derived classes may do what they like before or + after running the inner command. + + + + TODO: Documentation needed for field + + + + TODO: Documentation needed for constructor + + + + + + OneTimeTearDownCommand performs any teardown actions + specified for a suite and calls Dispose on the user + test object, if any. + + + + + Construct a OneTimeTearDownCommand + + The command wrapped by this command + + + + EmptyTestCommand is a TestCommand that does nothing. It simply + returns the current result from the context when executed. We + use it to avoid testing for null when executing a chain of + DelegatingTestCommands. + + + + + Construct a NullCommand for a test + + + + + Execute the command + + + + + TODO: Documentation needed for class + + + + + Initializes a new instance of the class. + + The inner command. + The max time allowed in milliseconds + + + + OneTimeSetUpCommand runs any one-time setup methods for a suite, + constructing the user test object if necessary. + + + + + Constructs a OneTimeSetUpCommand for a suite + + The inner command to which the command applies + A SetUpTearDownList for use by the command + + + + OneTimeTearDownCommand performs any teardown actions + specified for a suite and calls Dispose on the user + test object, if any. + + + + + Construct a OneTimeTearDownCommand + + The command wrapped by this command + A SetUpTearDownList for use by the command + + + + SetUpTearDownCommand runs SetUp methods for a suite, + runs the test and then runs TearDown methods. + + + + + Initializes a new instance of the class. + + The inner command. + List of setup/teardown items + + + + SetUpTearDownItem holds the setup and teardown methods + for a single level of the inheritance hierarchy. + + + + + Construct a SetUpTearDownNode + + A list of setup methods for this level + A list teardown methods for this level + + + + Returns true if this level has any methods at all. + This flag is used to discard levels that do nothing. + + + + + Run SetUp on this level. + + The execution context to use for running. + + + + Run TearDown for this level. + + + + + + TODO: Documentation needed for class + + + + + Initializes a new instance of the class. + + The test being skipped. + + + + Overridden to simply set the CurrentResult to the + appropriate Skipped state. + + The execution context for the test + A TestResult + + + + TestActionCommand handles a single ITestAction applied + to a test. It runs the BeforeTest method, then runs the + test and finally runs the AfterTest method. + + + + + Initializes a new instance of the class. + + The inner command. + The TestAction with which to wrap the inner command. + + + + TestActionItem wraps a single execution of an ITestAction. + Its primary purpose is to track whether the BeforeTest + method has been called and suppress calling the + AfterTest method if it has not. This is necessary when + ITestActions are used before and after a CompositeWorkItem, + since the OneTimeSetUpCommand and OneTimeTearDownCommand + are separate command chains. By sharing a TestActionItem + between the setup and teardown chains, the two calls can + be coordinated. + + + + + Construct a TestActionItem + + The ITestAction to be included + + + + Get flag indicating if the BeforeTest entry was already called. + + + + + Run the BeforeTest method of the action and remember that it has been run. + + The test to which the action applies + + + + Run the AfterTest action, but only if the BeforeTest + action was actually run. + + The test to which the action applies + + + + TestCommand is the abstract base class for all test commands + in the framework. A TestCommand represents a single stage in + the execution of a test, e.g.: SetUp/TearDown, checking for + Timeout, verifying the returned result from a method, etc. + + TestCommands may decorate other test commands so that the + execution of a lower-level command is nested within that + of a higher level command. All nested commands are executed + synchronously, as a single unit. Scheduling test execution + on separate threads is handled at a higher level, using the + task dispatcher. + + + + + Construct a TestCommand for a test. + + The test to be executed + + + + Gets the test associated with this command. + + + + + Runs the test in a specified context, returning a TestResult. + + The TestExecutionContext to be used for running the test. + A TestResult + + + + TestMethodCommand is the lowest level concrete command + used to run actual test cases. + + + + + Initializes a new instance of the class. + + The test. + + + + Runs the test, saving a TestResult in the execution context, as + well as returning it. If the test has an expected result, it + is asserts on that value. Since failed tests and errors throw + an exception, this command must be wrapped in an outer command, + will handle that exception and records the failure. This role + is usually played by the SetUpTearDown command. + + The execution context + + + + TheoryResultCommand adjusts the result of a Theory so that + it fails if all the results were inconclusive. + + + + + Constructs a TheoryResultCommand + + The command to be wrapped by this one + + + + Provides methods to support consistent checking in constraints. + + + + + Requires that the provided object is actually of the type required. + + The object to verify. + Name of the parameter as passed into the checking method. + + If and can be null, returns null rather than throwing when is null. + If cannot be null, this parameter is ignored. + The type to require. + + + + CultureDetector is a helper class used by NUnit to determine + whether a test should be run based on the current culture. + + + + + Default constructor uses the current culture. + + + + + Construct a CultureDetector for a particular culture for testing. + + The culture to be used + + + + Test to determine if one of a collection of cultures + is being used currently. + + + + + + + Tests to determine if the current culture is supported + based on a culture attribute. + + The attribute to examine + + + + + Test to determine if the a particular culture or comma- + delimited set of cultures is in use. + + Name of the culture or comma-separated list of culture ids + True if the culture is in use on the system + + + + Return the last failure reason. Results are not + defined if called before IsSupported( Attribute ) + is called. + + + + + ExceptionHelper provides static methods for working with exceptions + + + + + Rethrows an exception, preserving its stack trace + + The exception to rethrow + + + + Builds up a message, using the Message field of the specified exception + as well as any InnerExceptions. Optionally excludes exception names, + creating a more readable message. + + The exception. + Flag indicating whether exception names should be excluded. + A combined message string. + + + + Builds up a message, using the Message field of the specified exception + as well as any InnerExceptions. + + The exception. + A combined stack trace. + + + + Gets the stack trace of the exception. If no stack trace + is provided, returns "No stack trace available". + + The exception. + A string representation of the stack trace. + + + + A CompositeWorkItem represents a test suite and + encapsulates the execution of the suite as well + as all its child tests. + + + + + List of Child WorkItems + + + + + Construct a CompositeWorkItem for executing a test suite + using a filter to select child tests. + + The TestSuite to be executed + A filter used to select child tests + + + + Method that actually performs the work. Overridden + in CompositeWorkItem to do one-time setup, run all child + items and then dispatch the one-time teardown work item. + + + + + + + + + + Cancel (abort or stop) a CompositeWorkItem and all of its children + + true if the CompositeWorkItem and all of its children should be aborted, false if it should allow all currently running tests to complete + + + + OneTimeTearDownWorkItem represents the cleanup + and one-time teardown phase of a CompositeWorkItem + + + + + Construct a OneTimeTearDownWOrkItem wrapping a CompositeWorkItem + + The CompositeWorkItem being wrapped + + + + The WorkItem name, overridden to indicate this is the teardown. + + + + + + + + + + PerformWork is not used in CompositeWorkItem + + + + + EventListenerTextWriter sends text output to the currently active + ITestEventListener in the form of a TestOutput object. If no event + listener is active in the context, or if there is no context, + the output is forwarded to the supplied default writer. + + + + + Construct an EventListenerTextWriter + + The name of the stream to use for events + The default writer to use if no listener is available + + + + Get the Encoding for this TextWriter + + + + + Write formatted string + + + + + Write formatted string + + + + + Write formatted string + + + + + Write an object + + + + + Write a string + + + + + Write a decimal + + + + + Write a double + + + + + Write formatted string + + + + + Write a ulong + + + + + Write a long + + + + + Write a uint + + + + + Write an int + + + + + Write a char + + + + + Write a boolean + + + + + Write chars + + + + + Write chars + + + + + Write a float + + + + + Write a string with newline + + + + + Write an object with newline + + + + + Write formatted string with newline + + + + + Write formatted string with newline + + + + + Write formatted string with newline + + + + + Write a decimal with newline + + + + + Write a formatted string with newline + + + + + Write a double with newline + + + + + Write a uint with newline + + + + + Write a ulong with newline + + + + + Write a long with newline + + + + + Write an int with newline + + + + + Write a bool with newline + + + + + Write chars with newline + + + + + Write chars with newline + + + + + Write a char with newline + + + + + Write a float with newline + + + + + Write newline + + + + + An IWorkItemDispatcher handles execution of work items. + + + + + The level of parallelism supported. Zero if not supported. + + + + + Start execution, performing any initialization. Sets + the top level work item and dispatches it. + + + + + Dispatch a single work item for execution. The first + work item dispatched is saved as the top-level + work item and used when stopping the run. + + The item to dispatch + + + + Cancel the ongoing run completely. + If no run is in process, the call has no effect. + + true if the IWorkItemDispatcher should abort all currently running WorkItems, false if it should allow all currently running WorkItems to complete + + + + MainThreadWorkItemDispatcher handles execution of WorkItems by + directly executing them on the main thread. This is different + from the SimpleWorkItemDispatcher where the work item is dispatched + onto its own thread. + + + + + The level of parallelism supported + + + + + Start execution, dispatching the top level + work into the main thread. + + + + + Dispatch a single work item for execution by + executing it directly. + The item to dispatch + + + + + This method is not supported for + this dispatcher. Using it will throw a + NotSupportedException. + + Not used + If used, it will always throw this. + + + + A SimpleWorkItem represents a single test case and is + marked as completed immediately upon execution. This + class is also used for skipped or ignored test suites. + + + + + Construct a simple work item for a test. + + The test to be executed + The filter used to select this test + + + + Method that performs actually performs the work. + + + + + Creates a test command for use in running this test. + + A TestCommand + + + + The TextCapture class intercepts console output and writes it + to the current execution context, if one is present on the thread. + If no execution context is found, the output is written to a + default destination, normally the original destination of the + intercepted output. + + + + + Construct a TextCapture object + + The default destination for non-intercepted output + + + + Gets the Encoding in use by this TextWriter + + + + + Writes a single character + + The char to write + + + + Writes a string + + The string to write + + + + Writes a string followed by a line terminator + + The string to write + + + + A WorkItem may be an individual test case, a fixture or + a higher level grouping of tests. All WorkItems inherit + from the abstract WorkItem class, which uses the template + pattern to allow derived classes to perform work in + whatever way is needed. + + A WorkItem is created with a particular TestExecutionContext + and is responsible for re-establishing that context in the + current thread before it begins or resumes execution. + + + + + Construct a WorkItem for a particular test. + + The test that the WorkItem will run + Filter used to include or exclude child items + + + + Construct a work Item that wraps another work Item. + Wrapper items are used to represent independently + dispatched tasks, which form part of the execution + of a single test, such as OneTimeTearDown. + + The WorkItem being wrapped + + + + Initialize the TestExecutionContext. This must be done + before executing the WorkItem. + + + Originally, the context was provided in the constructor + but delaying initialization of the context until the item + is about to be dispatched allows changes in the parent + context during OneTimeSetUp to be reflected in the child. + + The TestExecutionContext to use + + + + Event triggered when the item is complete + + + + + Gets the current state of the WorkItem + + + + + The test being executed by the work item + + + + + The name of the work item - defaults to the Test name. + + + + + Filter used to include or exclude child tests + + + + + The execution context + + + + + The test result + + + + + Gets the ParallelScope associated with the test, if any, + otherwise returning ParallelScope.Default; + + + + + Execute the current work item, including any + child work items. + + + + + Wait until the execution of this item is complete + + + + + Marks the WorkItem as NotRunnable. + + Reason for test being NotRunnable. + + + + Cancel (abort or stop) a WorkItem + + true if the WorkItem should be aborted, false if it should run to completion + + + + Standard Dispose + + + + + Method that performs actually performs the work. It should + set the State to WorkItemState.Complete when done. + + + + + Method called by the derived class when all work is complete + + + + + Builds the set up tear down list. + + Unsorted array of setup MethodInfos. + Unsorted array of teardown MethodInfos. + A list of SetUpTearDownItems + + + + Changes the result of the test, logging the old and new states + + The new ResultState + The new message + + + + WorkItemBuilder class knows how to build a tree of work items from a tree of tests + + + + + Creates a work item. + + The test for which this WorkItem is being created. + The filter to be used in selecting any child Tests. + True if child work items should be created and added. + + + + + Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. + + + A signed integer that indicates the relative values of and , as shown in the following table.Value Meaning Less than zero is less than .Zero equals .Greater than zero is greater than . + + The first object to compare.The second object to compare. + + + + The current state of a work item + + + + + Ready to run or continue + + + + + Work Item is executing + + + + + Complete + + + + + 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. + + + + + + + Gets or sets the maximum line length for this writer + + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a given + 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 result of the constraint that failed + + + + Gets the unique type name between expected and actual. + + The expected value + The actual value causing the failure + Output of the unique type name for expected + Output of the unique type name for actual + + + + 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 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 ConstraintResult for which the actual value is to be written + + + + Write the generic 'Actual' line for a given value + + The actual value causing a failure + + + + Combines multiple filters so that a test must pass all + of them in order to pass this filter. + + + + + Constructs an empty AndFilter + + + + + Constructs an AndFilter from an array of filters + + + + + + Checks whether the AndFilter is matched by a test + + The test to be matched + True if all the component filters pass, otherwise false + + + + Checks whether the AndFilter is matched by a test + + The test to be matched + True if all the component filters match, otherwise false + + + + Checks whether the AndFilter is explicit matched by a test. + + The test to be matched + True if all the component filters explicit match, otherwise false + + + + Gets the element name + + Element name + + + + CategoryFilter is able to select or exclude tests + based on their categories. + + + + + Construct a CategoryFilter using a single category name + + A category name + + + + Check whether the filter matches a test + + The test to be matched + + + + + Gets the element name + + Element name + + + + ClassName filter selects tests based on the class FullName + + + + + Construct a FullNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + A base class for multi-part filters + + + + + Constructs an empty CompositeFilter + + + + + Constructs a CompositeFilter from an array of filters + + + + + + Adds a filter to the list of filters + + The filter to be added + + + + Return a list of the composing filters. + + + + + Checks whether the CompositeFilter is matched by a test. + + The test to be matched + + + + Checks whether the CompositeFilter is matched by a test. + + The test to be matched + + + + Checks whether the CompositeFilter is explicit matched by a test. + + The test to be matched + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + FullName filter selects tests based on their FullName + + + + + Construct a FullNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + IdFilter selects tests based on their id + + + + + Construct an IdFilter for a single value + + The id the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + FullName filter selects tests based on their FullName + + + + + Construct a MethodNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + ClassName filter selects tests based on the class FullName + + + + + Construct a NamespaceFilter for a single namespace + + The namespace the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + NotFilter negates the operation of another filter + + + + + Construct a not filter on another filter + + The filter to be negated + + + + Gets the base filter + + + + + Determine if a particular test passes the filter criteria. The default + implementation checks the test itself, its parents and any descendants. + + Derived classes may override this method or any of the Match methods + to change the behavior of the filter. + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Check whether the filter matches a test + + The test to be matched + True if it matches, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Combines multiple filters so that a test must pass one + of them in order to pass this filter. + + + + + Constructs an empty OrFilter + + + + + Constructs an AndFilter from an array of filters + + + + + + Checks whether the OrFilter is matched by a test + + The test to be matched + True if any of the component filters pass, otherwise false + + + + Checks whether the OrFilter is matched by a test + + The test to be matched + True if any of the component filters match, otherwise false + + + + Checks whether the OrFilter is explicit matched by a test + + The test to be matched + True if any of the component filters explicit match, otherwise false + + + + Gets the element name + + Element name + + + + PropertyFilter is able to select or exclude tests + based on their properties. + + + + + Construct a PropertyFilter using a property name and expected value + + A property name + The expected value of the property + + + + Check whether the filter matches a test + + The test to be matched + + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + TestName filter selects tests based on their Name + + + + + Construct a TestNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + ValueMatchFilter selects tests based on some value, which + is expected to be contained in the test. + + + + + Returns the value matched by the filter - used for testing + + + + + Indicates whether the value is a regular expression + + + + + Construct a ValueMatchFilter for a single value. + + The value to be included. + + + + Match the input provided by the derived class + + The value to be matchedT + True for a match, false otherwise. + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + GenericMethodHelper is able to deduce the Type arguments for + a generic method from the actual arguments provided. + + + + + A special value, which is used to indicate that BestCommonType() method + was unable to find a common type for the specified arguments. + + + + + Construct a GenericMethodHelper for a method + + MethodInfo for the method to examine + + + + Return the type arguments for the method, deducing them + from the arguments actually provided. + + The arguments to the method + If successful, an array of type arguments. + + + + InvalidTestFixtureException is thrown when an appropriate test + fixture constructor using the provided arguments cannot be found. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + InvalidTestFixtureException is thrown when an appropriate test + fixture constructor using the provided arguments cannot be found. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Interface for logging within the engine + + + + + Logs the specified message at the error level. + + The message. + + + + Logs the specified message at the error level. + + The message. + The arguments. + + + + Logs the specified message at the warning level. + + The message. + + + + Logs the specified message at the warning level. + + The message. + The arguments. + + + + Logs the specified message at the info level. + + The message. + + + + Logs the specified message at the info level. + + The message. + The arguments. + + + + Logs the specified message at the debug level. + + The message. + + + + Logs the specified message at the debug level. + + The message. + The arguments. + + + + InternalTrace provides facilities for tracing the execution + of the NUnit framework. Tests and classes under test may make use + of Console writes, System.Diagnostics.Trace or various loggers and + NUnit itself traps and processes each of them. For that reason, a + separate internal trace is needed. + + Note: + InternalTrace uses a global lock to allow multiple threads to write + trace messages. This can easily make it a bottleneck so it must be + used sparingly. Keep the trace Level as low as possible and only + insert InternalTrace writes where they are needed. + TODO: add some buffering and a separate writer thread as an option. + TODO: figure out a way to turn on trace in specific classes only. + + + + + Gets a flag indicating whether the InternalTrace is initialized + + + + + Initialize the internal trace facility using the name of the log + to be written to and the trace level. + + The log name + The trace level + + + + Initialize the internal trace using a provided TextWriter and level + + A TextWriter + The InternalTraceLevel + + + + Get a named Logger + + + + + + Get a logger named for a particular Type. + + + + + InternalTraceLevel is an enumeration controlling the + level of detailed presented in the internal log. + + + + + Use the default settings as specified by the user. + + + + + Do not display any trace messages + + + + + Display Error messages only + + + + + Display Warning level and higher messages + + + + + Display informational and higher messages + + + + + Display debug messages and higher - i.e. all messages + + + + + Display debug messages and higher - i.e. all messages + + + + + A trace listener that writes to a separate file per domain + and process using it. + + + + + Construct an InternalTraceWriter that writes to a file. + + Path to the file to use + + + + Construct an InternalTraceWriter that writes to a + TextWriter provided by the caller. + + + + + + Returns the character encoding in which the output is written. + + The character encoding in which the output is written. + + + + Writes a character to the text string or stream. + + The character to write to the text stream. + + + + Writes a string to the text string or stream. + + The string to write. + + + + Writes a string followed by a line terminator to the text string or stream. + + The string to write. If is null, only the line terminator is written. + + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Clears all buffers for the current writer and causes any buffered data to be written to the underlying device. + + + + + Provides internal logging to the NUnit framework + + + + + Initializes a new instance of the class. + + The name. + The log level. + The writer where logs are sent. + + + + Logs the message at error level. + + The message. + + + + Logs the message at error level. + + The message. + The message arguments. + + + + Logs the message at warm level. + + The message. + + + + Logs the message at warning level. + + The message. + The message arguments. + + + + Logs the message at info level. + + The message. + + + + Logs the message at info level. + + The message. + The message arguments. + + + + Logs the message at debug level. + + The message. + + + + Logs the message at debug level. + + The message. + The message arguments. + + + + The MethodWrapper class wraps a MethodInfo so that it may + be used in a platform-independent manner. + + + + + Construct a MethodWrapper for a Type and a MethodInfo. + + + + + Construct a MethodInfo for a given Type and method name. + + + + + Gets the Type from which this method was reflected. + + + + + Gets the MethodInfo for this method. + + + + + Gets the name of the method. + + + + + Gets a value indicating whether the method is abstract. + + + + + Gets a value indicating whether the method is public. + + + + + Gets a value indicating whether the method contains unassigned generic type parameters. + + + + + Gets a value indicating whether the method is a generic method. + + + + + Gets a value indicating whether the MethodInfo represents the definition of a generic method. + + + + + Gets the return Type of the method. + + + + + Gets the parameters of the method. + + + + + + Returns the Type arguments of a generic method or the Type parameters of a generic method definition. + + + + + Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo. + + The type arguments to be used + A new IMethodInfo with the type arguments replaced + + + + Returns an array of custom attributes of the specified type applied to this method + + + + + Gets a value indicating whether one or more attributes of the specified type are defined on the method. + + + + + Invokes the method, converting any TargetInvocationException to an NUnitException. + + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + Override ToString() so that error messages in NUnit's own tests make sense + + + + + Thrown when an assertion failed. Here to preserve the inner + exception and hence its stack trace. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The error message that explains + the reason for the exception + + + + Initializes a new instance of the class. + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Enables the syntax. + + + + + Wraps an action so that it is executed when the returned object is disposed. + This disposal is thread-safe and the action will be executed at most once. + + + + + + Examines an attribute argument and tries to simulate what that value would have been if the literal syntax + which might have defined the value in C# had instead been used as an argument to a given method parameter in a direct call. + + + For example, since you can’t apply attributes using arguments, we allow the C# syntax + 10 ( value) or 0.1 ( value) to be specified. + NUnit then converts it to match the method’s parameters, just as if you were actually + using the syntax TestMethod(10) or TestMethod(0.1). + + + For another example, you might have written the syntax 10 and picked up the attribute + constructor overload; however, the test method for which this value is intended only has a + signature. Again, NUnit simulates what would have happened if the inferred C# syntax was transplanted + and you were actually using the syntax TestMethod(10). + + + + + + Converts an array of objects to the , if it is supported. + + + + + Converts a single value to the , if it is supported. + + + + + Converts a single value to the , if it is supported. + + + + + The ParameterWrapper class wraps a ParameterInfo so that it may + be used in a platform-independent manner. + + + + + Construct a ParameterWrapper for a given method and parameter + + + + + + + Gets a value indicating whether the parameter is optional + + + + + Gets an IMethodInfo representing the method for which this is a parameter. + + + + + Gets the underlying ParameterInfo + + + + + Gets the Type of the parameter + + + + + Returns an array of custom attributes of the specified type applied to this method + + + + + Gets a value indicating whether one or more attributes of the specified type are defined on the parameter. + + + + + Implements a simplified filter for use in deciding which + Types and Methods should be used to generate tests. It is consructed with a + list of strings, each of which may end up being interpreted in various ways. + + + + + Return a new PreFilter, without elements, which is considered + empty and always matches. + + + + + Return true if the filter is empty, in which case it + always succeeds. Technically, this is just a filter and + you can add elements but it's best to use Empty when + you need an empty filter and new when you plan to add. + + + + + Add a new filter element to the filter + + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + A PropertyBag represents a collection of name value pairs + that allows duplicate entries with the same key. Methods + are provided for adding a new pair as well as for setting + a key to a single value. All keys are strings but values + may be of any type. Null values are not permitted, since + a null entry represents the absence of the key. + + + + + Adds a key/value pair to the property set + + The key + The value + + + + Sets the value for a key, removing any other + values that are already in the property set. + + + + + + + Gets a single value for a key, using the first + one if multiple values are present and returning + null if the value is not found. + + + + + + + Gets a flag indicating whether the specified key has + any entries in the property set. + + The key to be checked + + True if their are values present, otherwise false + + + + + Gets a collection containing all the keys in the property set + + + + + + Gets or sets the list of values for a particular key + + + + + Returns an XmlNode representing the current PropertyBag. + + Not used + An XmlNode representing the PropertyBag + + + + Returns an XmlNode representing the PropertyBag after + adding it as a child of the supplied parent node. + + The parent node. + Not used + + + + + The PropertyNames class provides static constants for the + standard property ids that NUnit uses on tests. + + + + + The FriendlyName of the AppDomain in which the assembly is running + + + + + The selected strategy for joining parameter data into test cases + + + + + The process ID of the executing assembly + + + + + The stack trace from any data provider that threw + an exception. + + + + + The reason a test was not run + + + + + The author of the tests + + + + + The ApartmentState required for running the test + + + + + The categories applying to a test + + + + + The Description of a test + + + + + The number of threads to be used in running tests + + + + + The maximum time in ms, above which the test is considered to have failed + + + + + The ParallelScope associated with a test + + + + + The number of times the test should be repeated + + + + + Indicates that the test should be run on a separate thread + + + + + The culture to be set for a test + + + + + The UI culture to be set for a test + + + + + The type that is under test + + + + + The timeout value for the test + + + + + The test will be ignored until the given date + + + + + The optional Order the test will run in + + + + + Randomizer returns a set of random values in a repeatable + way, to allow re-running of tests if necessary. It extends + the .NET Random class, providing random values for a much + wider range of types. + + The class is used internally by the framework to generate + test case data and is also exposed for use by users through + the TestContext.Random property. + + + For consistency with the underlying Random Type, methods + returning a single value use the prefix "Next..." Those + without an argument return a non-negative value up to + the full positive range of the Type. Overloads are provided + for specifying a maximum or a range. Methods that return + arrays or strings use the prefix "Get..." to avoid + confusion with the single-value methods. + + + + + Initial seed used to create randomizers for this run + + + + + 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. + + + + + Create a new Randomizer using the next seed + available to ensure that each randomizer gives + a unique sequence of values. + + + + + + Default constructor + + + + + Construct based on seed value + + + + + + Returns a random unsigned int. + + + + + Returns a random unsigned int less than the specified maximum. + + + + + Returns a random unsigned int within a specified range. + + + + + Returns a non-negative random short. + + + + + Returns a non-negative random short less than the specified maximum. + + + + + Returns a non-negative random short within a specified range. + + + + + Returns a random unsigned short. + + + + + Returns a random unsigned short less than the specified maximum. + + + + + Returns a random unsigned short within a specified range. + + + + + Returns a random long. + + + + + Returns a random long less than the specified maximum. + + + + + Returns a non-negative random long within a specified range. + + + + + Returns a random ulong. + + + + + Returns a random ulong less than the specified maximum. + + + + + Returns a non-negative random long within a specified range. + + + + + Returns a random Byte + + + + + Returns a random Byte less than the specified maximum. + + + + + Returns a random Byte within a specified range + + + + + Returns a random SByte + + + + + Returns a random sbyte less than the specified maximum. + + + + + Returns a random sbyte within a specified range + + + + + Returns a random bool + + + + + Returns a random bool based on the probability a true result + + + + + Returns a random double between 0.0 and the specified maximum. + + + + + Returns a random double within a specified range. + + + + + Returns a random float. + + + + + Returns a random float between 0.0 and the specified maximum. + + + + + Returns a random float within a specified range. + + + + + Returns a random enum value of the specified Type as an object. + + + + + Returns a random enum value of the specified Type. + + + + + Default characters for random functions. + + Default characters are the English alphabet (uppercase & lowercase), Arabic numerals, and underscore + + + + Generate a random string based on the characters from the input string. + + desired length of output string. + string representing the set of characters from which to construct the resulting string + A random string of arbitrary length + + + + Generate a random string based on the characters from the input string. + + desired length of output string. + A random string of arbitrary length + Uses DefaultStringChars as the input character set + + + + Generate a random string based on the characters from the input string. + + A random string of the default length + Uses DefaultStringChars as the input character set + + + + Returns a random decimal. + + + + + Returns a random decimal between positive zero and the specified maximum. + + + + + Returns a random decimal within a specified range, which is not + permitted to exceed decimal.MaxVal in the current implementation. + + + A limitation of this implementation is that the range from min + to max must not exceed decimal.MaxVal. + + + + + Generates a valid version 4 . + + + + + Helper methods for inspecting a type by reflection. + + Many of these methods take ICustomAttributeProvider as an + argument to avoid duplication, even though certain attributes can + only appear on specific types of members, like MethodInfo or Type. + + In the case where a type is being examined for the presence of + an attribute, interface or named member, the Reflect methods + operate with the full name of the member being sought. This + removes the necessity of the caller having a reference to the + assembly that defines the item being sought and allows the + NUnit core to inspect assemblies that reference an older + version of the NUnit framework. + + + + + Examine a fixture type and return an array of methods having a + particular attribute. The array is order with base methods first. + + The type to examine + The attribute Type to look for + Specifies whether to search the fixture type inheritance chain + The array of methods found + + + + Examine a fixture type and return true if it has a method with + a particular attribute. + + The type to examine + The attribute Type to look for + True if found, otherwise false + + + + Invoke the default constructor on a Type + + The Type to be constructed + An instance of the Type + + + + Invoke a constructor on a Type with arguments + + The Type to be constructed + Arguments to the constructor + An instance of the Type + + + + Returns an array of types from an array of objects. + Differs from by returning + for null elements rather than throwing . + + + + + Gets the constructors to which the specified argument types can be coerced. + + + + + Determines if the given types can be coerced to match the given parameters. + + + + + Determines whether the current type can be implicitly converted to the specified type. + + + + + Invoke a parameterless method returning void on an object. + + A MethodInfo for the method to be invoked + The object on which to invoke the method + + + + Invoke a method, converting any TargetInvocationException to an NUnitException. + + A MethodInfo for the method to be invoked + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + + Selects the ultimate shadowing property just like would, + rather than throwing + for properties that shadow properties of a different property type + which is what does. + + + If you request both public and nonpublic properties, every public property is preferred + over every nonpublic property. It would violate the principle of least surprise for a + derived class’s implementation detail to be chosen over the public API for a type. + + + See . + See . + See . + + + + Represents the result of running a single test case. + + + + + Construct a TestCaseResult based on a TestMethod + + A TestMethod to which the result applies. + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + The TestResult class represents the result of a test. + + + + + Error message for when child tests have errors + + + + + Error message for when child tests have warnings + + + + + Error message for when child tests are ignored + + + + + The minimum duration for tests + + + + + Aggregate assertion count + + + + + Construct a test result given a Test + + The test to be used + + + + Gets the test with which this result is associated. + + + + + Gets the ResultState of the test result, which + indicates the success or failure of the test. + + + + + Gets the name of the test result + + + + + Gets the full name of the test result + + + + + Gets or sets the elapsed time for running the test in seconds + + + + + Gets or sets the time the test started running. + + + + + Gets or sets the time the test finished running. + + + + + Adds a test attachment to the test result + + The TestAttachment object to attach + + + + Gets the collection of files attached to the test + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + + Gets or sets the count of asserts executed + when running the test. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + Gets a TextWriter, which will write output to be included in the result. + + + + + Gets any text output written to this result. + + + + + Gets a list of assertion results associated with the test. + + + + + Returns the XML representation of the result. + + If true, descendant results are included + An XmlNode representing the result + + + + Adds the XML representation of the result as a child of the + supplied parent node.. + + The parent node. + If true, descendant results are included + + + + + Gets a count of pending failures (from Multiple Assert) + + + + + Gets the worst assertion status (highest enum) in all the assertion results + + + + + Set the result of the test + + The ResultState to use in the result + + + + Set the result of the test + + The ResultState to use in the result + A message associated with the result state + + + + Set the result of the test + + The ResultState to use in the result + A message associated with the result state + Stack trace giving the location of the command + + + + Set the test result based on the type of exception thrown + + The exception that was thrown + + + + Set the test result based on the type of exception thrown + + The exception that was thrown + The FailureSite to use in the result + + + + RecordTearDownException appends the message and stack trace + from an exception arising during teardown of the test + to any previously recorded information, so that any + earlier failure information is not lost. Note that + calling Assert.Ignore, Assert.Inconclusive, etc. during + teardown is treated as an error. If the current result + represents a suite, it may show a teardown error even + though all contained tests passed. + + The Exception to be recorded + + + + Update overall test result, including legacy Message, based + on AssertionResults that have been saved to this point. + + + + + Record an assertion result + + + + + Record an assertion result + + + + + Record an assertion result + + + + + Creates a failure message incorporating failures + from a Multiple Assert block for use by runners + that don't know about AssertionResults. + + Message as a string + + + + Adds a reason element to a node and returns it. + + The target node. + The new reason element. + + + + Adds a failure element to a node and returns it. + + The target node. + The new failure element. + + + + Adds an attachments element to a node and returns it. + + The target node. + The new attachments element. + + + + Represents the result of running a test suite + + + + + Construct a TestSuiteResult base on a TestSuite + + The TestSuite to which the result applies + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + Adds a child result to this result, setting this result's + ResultState to Failure if the child result failed. + + The result to be added + + + + Holds thread state which is captured and restored in order to sandbox user code. + + + + + Captures a snapshot of the tracked state of the current thread to be restored later. + + + + + Restores the tracked state of the current thread to the previously captured state. + + + + + Returns a copy with the specified culture. + + + + + Returns a copy with the specified UI culture. + + + + + May be called from any thread. + + + + + May be called from any thread. + + + + + May be called from any thread. + + + + + May be called from any thread, but may only be called once. + + + + + StackFilter class is used to remove internal NUnit + entries from a stack trace so that the resulting + trace provides better information about the test. + + + + + Single instance of our default filter + + + + + Construct a stack filter instance + + Regex pattern used to delete lines from the top of the stack + Regex pattern used to delete lines from the bottom of the stack + + + + Construct a stack filter instance + + Regex pattern used to delete lines from the top of the stack + + + + Construct a stack filter instance + + + + + Filters a raw stack trace and returns the result. + + The original stack trace + A filtered stack trace + + + + Provides methods to support legacy string comparison methods. + + + + + Compares two strings for equality, ignoring case if requested. + + The first string. + The second string.. + if set to true, the case of the letters in the strings is ignored. + Zero if the strings are equivalent, a negative number if strA is sorted first, a positive number if + strB is sorted first + + + + Compares two strings for equality, ignoring case if requested. + + The first string. + The second string.. + if set to true, the case of the letters in the strings is ignored. + True if the strings are equivalent, false if not. + + + + The TestCaseParameters class encapsulates method arguments and + other selected parameters needed for constructing + a parameterized test case. + + + + + The expected result to be returned + + + + + Default Constructor creates an empty parameter set + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a ParameterSet from an object implementing ITestCaseData + + + + + + The expected result of the test, which + must match the method return type. + + + + + Gets a value indicating whether an expected result was specified. + + + + + TestCaseTimeoutException is thrown when a test running directly + on a TestWorker thread is cancelled due to timeout. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Helper class used to save and restore certain static or + singleton settings in the environment that affect tests + or which might be changed by the user tests. + + + + + Link to a prior saved context + + + + + Indicates that a stop has been requested + + + + + The event listener currently receiving notifications + + + + + The number of assertions for the current test + + + + + The current test result + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + An existing instance of TestExecutionContext. + + + + Gets and sets the current context. + + + + + Gets or sets the current test + + + + + The time the current test started execution + + + + + The time the current test started in Ticks + + + + + Gets or sets the current test result + + + + + Gets a TextWriter that will send output to the current test result. + + + + + The current test object - that is the user fixture + object on which tests are being executed. + + + + + Get or set indicator that run should stop on the first error + + + + + Gets an enum indicating whether a stop has been requested. + + + + + The current test event listener + + + + + The current WorkItemDispatcher. Made public for + use by nunitlite.tests + + + + + The ParallelScope to be used by tests running in this context. + For builds with out the parallel feature, it has no effect. + + + + + Default tolerance value used for floating point equality + when no other tolerance is specified. + + + + + Gets the RandomGenerator specific to this Test + + + + + Gets the assert count. + + The assert count. + + + + The current nesting level of multiple assert blocks + + + + + Gets or sets the test case timeout value + + + + + Gets a list of ITestActions set by upstream tests + + + + + Saves or restores the CurrentCulture + + + + + Saves or restores the CurrentUICulture + + + + + The current head of the ValueFormatter chain, copied from MsgUtils.ValueFormatter + + + + + If true, all tests must run on the same thread. No new thread may be spawned. + + + + + The number of times the current test has been scheduled for execution. + Currently only being executed in a test using the + + + + + Record any changes in the environment made by + the test code in the execution context so it + will be passed on to lower level tests. + + + + + Set up the execution environment to match a context. + Note that we may be running on the same thread where the + context was initially created or on a different thread. + + + + + Increments the assert count by one. + + + + + Increments the assert count by a specified amount. + + + + + Adds a new ValueFormatterFactory to the chain of formatters + + The new factory + + + + Sends a message from test to listeners. This message is not kind of test output and doesn't go to test result. + + A name recognized by the intended listeners. + A message to be sent + + + + An IsolatedContext is used when running code + that may effect the current result in ways that + should not impact the final result of the test. + A new TestExecutionContext is created with an + initially clear result, which is discarded on + exiting the context. + + + using (new TestExecutionContext.IsolatedContext()) + { + // Code that should not impact the result + } + + + + + Save the original current TestExecutionContext and + make a new isolated context current. + + + + + Restore the original TestExecutionContext. + + + + + An AdhocTestExecutionContext is created whenever a context is needed + but not available in CurrentContext. This happens when tests are run + on an ad-hoc basis or Asserts are used outside of tests. + + + + + Construct an AdhocTestExecutionContext, which is used + whenever the current TestExecutionContext is found to be null. + + + + + Enumeration indicating whether the tests are + running normally or being cancelled. + + + + + Running normally with no stop requested + + + + + A graceful stop has been requested + + + + + A forced stop has been requested + + + + + Interface to be implemented by filters applied to tests. + The filter applies when running the test, after it has been + loaded, since this is the only time an ITest exists. + + + + + Unique Empty filter. + + + + + Indicates whether this is the EmptyFilter + + + + + Indicates whether this is a top-level filter, + not contained in any other filter. + + + + + Determine if a particular test passes the filter criteria. The default + implementation checks the test itself, its parents and any descendants. + + Derived classes may override this method or any of the Match methods + to change the behavior of the filter. + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + Determine whether the test itself matches the filter criteria, without + examining either parents or descendants. This is overridden by each + different type of filter to perform the necessary tests. + + The test to which the filter is applied + True if the filter matches the any parent of the test + + + + Determine whether any ancestor of the test matches the filter criteria + + The test to which the filter is applied + True if the filter matches the an ancestor of the test + + + + Determine whether any descendant of the test matches the filter criteria. + + The test to be matched + True if at least one descendant matches the filter criteria + + + + Create a TestFilter instance from an XML representation. + + + + + Create a TestFilter from its TNode representation + + + + + Nested class provides an empty filter - one that always + returns true when called. It never matches explicitly. + + + + + Adds an XML node + + True if recursive + The added XML node + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + The TestCaseParameters class encapsulates method arguments and + other selected parameters needed for constructing + a parameterized test case. + + + + + Default Constructor creates an empty parameter set + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a ParameterSet from an object implementing ITestCaseData + + + + + + Type arguments used to create a generic fixture instance + + + + + TestListener provides an implementation of ITestListener that + does nothing. It is used only through its NULL property. + + + + + Called when a test has just started + + The test that is starting + + + + Called when a test case has finished + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the message to send + + + + Construct a new TestListener - private so it may not be used. + + + + + Get a listener that does nothing + + + + + TestNameGenerator is able to create test names according to + a coded pattern. + + + + + Default pattern used to generate names + + + + + Construct a TestNameGenerator + + + + + Construct a TestNameGenerator + + The pattern used by this generator. + + + + Get the display name for a TestMethod and its arguments + + A TestMethod + The display name + + + + Get the display name for a TestMethod and its arguments + + A TestMethod + Arguments to be used + The display name + + + + TestParameters is the abstract base class for all classes + that know how to provide data for constructing a test. + + + + + Default Constructor creates an empty parameter set + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a ParameterSet from an object implementing ITestData + + + + + + The RunState for this set of parameters. + + + + + The arguments to be used in running the test, + which must match the method signature. + + + + + A name to be used for this test case in lieu + of the standard generated name containing + the argument list. + + + + + Gets the property dictionary for this test + + + + + Applies ParameterSet values to the test itself. + + A test. + + + + The original arguments provided by the user, + used for display purposes. + + + + + The list of display names to use as the parameters in the test name. + + + + + TestProgressReporter translates ITestListener events into + the async callbacks that are used to inform the client + software about the progress of a test run. + + + + + Initializes a new instance of the class. + + The callback handler to be used for reporting progress. + + + + Called when a test has just started + + The test that is starting + + + + Called when a test has finished. Sends a result summary to the callback. + to + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + Returns the parent test item for the target test item if it exists + + + parent test item + + + + Makes a string safe for use as an attribute, replacing + characters that can't be used with their + corresponding XML representations. + + The string to be used + A new string with the values replaced + + + + ParameterizedFixtureSuite serves as a container for the set of test + fixtures created from a given Type using various parameters. + + + + + Initializes a new instance of the class. + + The ITypeInfo for the type that represents the suite. + + + + Gets a string representing the type of test + + + + + ParameterizedMethodSuite holds a collection of individual + TestMethods with their arguments applied. + + + + + Initializes a new instance of the class. + + + + + Gets a string representing the type of test + + + + + SetUpFixture extends TestSuite and supports + Setup and TearDown methods. + + + + + Initializes a new instance of the class. + + + + + The Test abstract class represents a test within the framework. + + + + + Static value to seed ids. It's started at 1000 so any + uninitialized ids will stand out. + + + + + Used to cache the declaring type for this MethodInfo + + + + + Method property backing field + + + + + Constructs a test given its name + + The name of the test + + + + Constructs a test given the path through the + test hierarchy to its parent and a name. + + The parent tests full name + The name of the test + + + + Constructs a test for a specific type. + + + + + Constructs a test for a specific method. + + + + + Gets or sets the id of the test + + + + + + Gets or sets the name of the test + + + + + Gets or sets the fully qualified name of the test + + + + + + Gets the name of the class where this test was declared. + Returns null if the test is not associated with a class. + + + + + Gets the name of the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + The arguments to use in creating the test or empty array if none required. + + + + + Gets the TypeInfo of the fixture used in running this test + or null if no fixture type is associated with it. + + + + + Gets a MethodInfo for the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + Whether or not the test should be run + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Gets a string representing the type of test. Used as an attribute + value in the XML representation of a test and has no other + function in the framework. + + + + + Gets a count of test cases represented by + or contained under this test. + + + + + Gets the properties for this test + + + + + Returns true if this is a TestSuite + + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets the parent as a Test object. + Used by the core to set the parent. + + + + + Gets this test's child tests + + A list of child tests + + + + Gets or sets a fixture object for running this test. + + + + + Static prefix used for ids in this AppDomain. + Set by FrameworkController. + + + + + Gets or Sets the Int value representing the seed for the RandomGenerator + + + + + + The SetUp methods. + + + + + The teardown methods + + + + + Creates a TestResult for this test. + + A TestResult suitable for this type of test. + + + + Modify a newly constructed test by applying any of NUnit's common + attributes, based on a supplied , which is + usually the reflection element from which the test was constructed, + but may not be in some instances. The attributes retrieved are + saved for use in subsequent operations. + + + + + Modify a newly constructed test by applying any of NUnit's common + attributes, based on a supplied , which is + usually the reflection element from which the test was constructed, + but may not be in some instances. The attributes retrieved are + saved for use in subsequent operations. + + + + + Modify a newly constructed test by applying any of NUnit's common + attributes, based on a supplied , which is + usually the reflection element from which the test was constructed, + but may not be in some instances. The attributes retrieved are + saved for use in subsequent operations. + + + + + Mark the test as Invalid (not runnable) specifying a reason + + The reason the test is not runnable + + + + Get custom attributes applied to a test + + + + + Add standard attributes and members to a test node. + + + + + + + Returns the XML representation of the test + + If true, include child tests recursively + + + + + Returns an XmlNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Compares this test to another test for sorting purposes + + The other test + Value of -1, 0 or +1 depending on whether the current test is less than, equal to or greater than the other test + + + + TestAssembly is a TestSuite that represents the execution + of tests in a managed assembly. + + + + + Initializes a new instance of the class + specifying the Assembly and the suite name. + + The assembly this test represents. + The desired name for the test suite. + + + + Initializes a new instance of the class + specifying the suite name for an assembly that could not be loaded. + + The desired name for the test suite. + + + + Copy-constructor style to create a filtered copy of the test assemblies + test cases + + + + + + + Gets the Assembly represented by this instance. + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Get custom attributes specified on the assembly + + + + + TestFixture is a surrogate for a user test fixture class, + containing one or more tests. + + + + + Initializes a new instance of the class. + + Type of the fixture. + Arguments used to instantiate the test fixture, or null if none used + + + + The TestMethod class represents a Test implemented as a method. + + + + + The ParameterSet used to create this test method + + + + + Initializes a new instance of the class. + + The method to be used as a test. + + + + Initializes a new instance of the class. + + The method to be used as a test. + The suite or fixture to which the new test will be added + + + + The arguments to use in executing the test method, or empty array if none are provided. + + + + + Overridden to return a TestCaseResult. + + A TestResult for this test. + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Returns a TNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Gets this test's child tests + + A list of child tests + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Returns the name of the method + + + + + TestSuite represents a composite test, which contains other tests. + + + + + Our collection of child tests + + + + + Initializes a new instance of the class. + + The name of the suite. + + + + Initializes a new instance of the class. + + Name of the parent suite. + The name of the suite. + + + + Initializes a new instance of the class. + + Type of the fixture. + Arguments used to instantiate the test fixture, or null if none used. + + + + Initializes a new instance of the class. + + Type of the fixture. + + + + Copy constructor style to create a filtered copy of the given test suite + + Test Suite to copy + Filter to be applied + + + + Sorts tests under this suite. + + + + + Adds a test to the suite. + + The test. + + + + Gets this test's child tests + + The list of child tests + + + + Gets a count of test cases represented by + or contained under this test. + + + + + + The arguments to use in creating the fixture, or empty array if none are provided. + + + + + Set to true to suppress sorting this suite's contents + + + + + OneTimeSetUp methods for this suite + + + + + OneTimeTearDown methods for this suite + + + + + Overridden to return a TestSuiteResult. + + A TestResult for this test. + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Returns an XmlNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Check that setup and teardown methods marked by certain attributes + meet NUnit's requirements and mark the tests not runnable otherwise. + + A list of methodinfos to check + + + + ThreadUtility provides a set of static methods convenient + for working with threads. + + + + + TypeHelper provides static methods that operate on Types. + + + + + Gets the display name for a Type as used by NUnit. + + The Type for which a display name is needed. + The display name for the Type + + + + Gets the display name for a Type as used by NUnit. + + The Type for which a display name is needed. + The arglist provided. + The display name for the Type + + + + Returns the best fit for a common type to be used in + matching actual arguments to a methods Type parameters. + + + + + Determines whether the specified type is numeric. + + The type to be examined. + + true if the specified type is numeric; otherwise, false. + + + + + Convert an argument list to the required parameter types. + Currently, only widening numeric conversions are performed. + + An array of args to be converted + A ParameterInfo[] whose types will be used as targets + + + + Determines whether this instance can deduce type args for a generic type from the supplied arguments. + + The type to be examined. + The arglist. + The type args to be used. + + true if this the provided args give sufficient information to determine the type args to be used; otherwise, false. + + + + + Return the interfaces implemented by a Type. + + The Type to be examined. + An array of Types for the interfaces. + + + + Return whether or not the given type is a ValueTuple. + + Type. + Whether or not the given type is a ValueTuple. + + + + Return whether or not the given type is a Tuple. + + Type. + Whether or not the given type is a Tuple. + + + + Determines whether the cast to the given type would succeed. + If is and + can be , the cast succeeds just like the C# language feature. + + The object to cast. + + + + Casts to a value of the given type if possible. + If is and + can be , the cast succeeds just like the C# language feature. + + The object to cast. + The value of the object, if the cast succeeded. + + + + Used for resolving the type difference between objects. + + + + + Gets the shortened type name difference between and . + + The expected object. + The actual object. + Output of the unique type name for the expected object. + Output of the unique type name for actual object. + + + + Gets the shortened type name difference between and . + + The expected object . + The actual object . + Output of the unique type name for the expected object. + Output of the unique type name for actual object. + + + + Obtain the shortened generic template parameters of the given and , + if they are generic. + + The expected . + The actual . + Shortened generic parameters of the expected . + Shortened generic parameters of the actual . + + + + Obtain a shortened name of the given . + + + + + Shorten the given names by only including the relevant differing namespaces/types, if they differ. + + The expected . + The actual . + The shortened expected name. + The shortened actual name. + + + + Returns whether or not the is generic. + + + + + Returns the fully qualified generic name of a given . + + + + + Reconstruct a generic type name using the provided generic type name, and a + of the template parameters. + + The name of the generic type, including the number of template parameters expected. + A of names of the template parameters of the provided generic type. + + + + Obtain the shortened generic names of the given expected and actual s. + + The expected . + The actual . + The shortened expected generic name. + The shortened actual generic name. + + + + The TypeWrapper class wraps a Type so it may be used in + a platform-independent manner. + + + + + Construct a TypeWrapper for a specified Type. + + + + + Gets the underlying Type on which this TypeWrapper is based. + + + + + Gets the base type of this type as an ITypeInfo + + + + + Gets the Name of the Type + + + + + Gets the FullName of the Type + + + + + Gets the assembly in which the type is declared + + + + + Gets the namespace of the Type + + + + + Gets a value indicating whether the type is abstract. + + + + + Gets a value indicating whether the Type is a generic Type + + + + + Returns true if the Type wrapped is T + + + + + Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types. + + + + + Gets a value indicating whether the Type is a generic Type definition + + + + + Gets a value indicating whether the type is sealed. + + + + + Gets a value indicating whether this type represents a static class. + + + + + Get the display name for this type + + + + + Get the display name for an object of this type, constructed with the specified args. + + + + + Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments + + + + + Returns a Type representing a generic type definition from which this Type can be constructed. + + + + + Returns an array of custom attributes of the specified type applied to this type + + + + + Returns a value indicating whether the type has an attribute of the specified type. + + + + + + + + Returns a flag indicating whether this type has a method with an attribute of the specified type. + + + + + + + Returns an array of IMethodInfos for methods of this Type + that match the specified flags. + + + + + Gets the public constructor taking the specified argument Types + + + + + Returns a value indicating whether this Type has a public constructor taking the specified argument Types. + + + + + Construct an object of this Type, using the specified arguments. + + + + + Override ToString() so that error messages in NUnit's own tests make sense + + + + + Encapsulates the ability to increment a value by an amount which may be of a different type. + + + + + Creates a from the specified value if the current instance is able to + use it to increment the on values which it operates. If the creation fails, + is thrown. + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values on which it operates. A return value indicates + whether the creation succeeded. + + + + + Provides a convenient shorthand when is + and the default value of represents zero. + + + + + Initializes a new instance of the class. + + The amount by which to increment each time this step is applied. + + Must increment the given value and return the result. + If the result is outside the range representable by , + must throw . If the result does not change due to lack + of precision representable by , must throw . + + + + + Increments the given value and returns the result. + If the result is outside the range representable by , + throws . If the result does not change due to lack + of precision representable by , throws . + + + + + + + Encapsulates the ability to increment a value by an amount + which may be of a different type. + + + + + Increments the given value and returns the result. + If the result is outside the range representable by , + throws . If the result does not change due to lack + of precision representable by , throws . + + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values of type . If the creation fails, + is thrown. + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values of type . A return value indicates + whether the creation succeeded. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + 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 equality with zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 to the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable to 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + 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 a subpath of the 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 + inclusively within a specified range. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + + Returns a constraint that tests if an item is equal to any of parameters + + Expected values + + + + When implemented by an attribute, this interface implemented to provide actions to execute before and after tests. + + + + + Executed before each test is run + + The test that is going to be run. + + + + Executed after each test is run + + The test that has just been run. + + + + Provides the target for the action attribute + + The target for the action attribute + + + + 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 + + + + + Basic Asserts on strings. + + + + + DO NOT USE! Use StringAssert.AreEqualIgnoringCase(...) or Assert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 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 + + + + 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 TestCaseData class represents a set of arguments + and other parameter info to be used for a parameterized + test case. It is derived from TestCaseParameters and adds a + fluent syntax for use in initializing the 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 name of the test case + + The modified TestCaseData instance + + + + Sets the list of display names to use as the parameters in the test name. + + + + + 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 + + + + + + + + Marks the test case as explicit. + + + + + Marks the test case as explicit, specifying the reason. + + + + + Ignores this TestCase, specifying the reason. + + The reason. + + + + + Provide the context information of the current test. + This is an adapter for the internal ExecutionContext + class, hiding the internals from the user test. + + + + + Construct a TestContext for an ExecutionContext + + The ExecutionContext to adapt + + + + 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 TextWriter that will send output to the current test result. + + + + + Gets a TextWriter that will send output directly to Console.Error + + + + + Gets a TextWriter for use in displaying immediate progress messages + + + + + TestParameters object holds parameters for the test run, if any are specified + + + + + Static DefaultWorkDirectory is now used as the source + of the public instance property WorkDirectory. This is + a bit odd but necessary to avoid breaking user tests. + + + + + Get a representation of the current test. + + + + + Gets a Representation of the TestResult for the current test. + + + + + Gets the directory containing the current test assembly. + + + + + Gets the directory to be used for outputting files created + by this test run. + + + + + Gets the random generator. + + + The random generator. + + + + + Gets the number of assertions executed + up to this point in the test. + + + + + Get the number of times the current Test has been repeated. This is currently only + set when using the . + TODO: add this to the RepeatAttribute as well + + + + Write the string representation of a boolean value to the current result + + + Write a char to the current result + + + Write a char array to the current result + + + Write the string representation of a double to the current result + + + Write the string representation of an Int32 value to the current result + + + Write the string representation of an Int64 value to the current result + + + Write the string representation of a decimal value to the current result + + + Write the string representation of an object to the current result + + + Write the string representation of a Single value to the current result + + + Write a string to the current result + + + Write the string representation of a UInt32 value to the current result + + + Write the string representation of a UInt64 value to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a line terminator to the current result + + + Write the string representation of a boolean value to the current result followed by a line terminator + + + Write a char to the current result followed by a line terminator + + + Write a char array to the current result followed by a line terminator + + + Write the string representation of a double to the current result followed by a line terminator + + + Write the string representation of an Int32 value to the current result followed by a line terminator + + + Write the string representation of an Int64 value to the current result followed by a line terminator + + + Write the string representation of a decimal value to the current result followed by a line terminator + + + Write the string representation of an object to the current result followed by a line terminator + + + Write the string representation of a Single value to the current result followed by a line terminator + + + Write a string to the current result followed by a line terminator + + + Write the string representation of a UInt32 value to the current result followed by a line terminator + + + Write the string representation of a UInt64 value to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + + This method adds the a new ValueFormatterFactory to the + chain of responsibility used for formatting values in messages. + The scope of the change is the current TestContext. + + The factory delegate + + + + Attach a file to the current test result + + Relative or absolute file path to attachment + Optional description of attachment + + + + This method provides a simplified way to add a ValueFormatter + delegate to the chain of responsibility, creating the factory + delegate internally. It is useful when the Type of the object + is the only criterion for selection of the formatter, since + it can be used without getting involved with a compound function. + + The type supported by this formatter + The ValueFormatter delegate + + + + TestAdapter adapts a Test for consumption by + the user test code. + + + + + Construct a TestAdapter for a Test + + The Test to be adapted + + + + Gets the unique Id of a test + + + + + The name of the test, which may or may not be + the same as the method name. + + + + + The name of the method representing the test. + + + + + The FullName of the test + + + + + The ClassName of the test + + + + + A shallow copy of the properties of the test. + + + + + The arguments to use in creating the test or empty array if none are required. + + + + + ResultAdapter adapts a TestResult for consumption by + the user test code. + + + + + Construct a ResultAdapter for a TestResult + + The TestResult to be adapted + + + + Gets a ResultState representing the outcome of the test + up to this point in its execution. + + + + + Gets a list of the assertion results generated + up to this point in the test. + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + adapts an + for consumption by the user. + + + + + Construct a from a source + . + + + + + Get the first property with the given , if it can be found, otherwise + returns null. + + + + + Indicates whether is found in this + . + + + + + Returns a collection of properties + with the given . + + + + + Returns the count of elements with the given . + + + + + Returns a collection of the property keys. + + + + + The TestFixtureData class represents a set of arguments + and other parameter info to be used for a parameterized + fixture. It is derived from TestFixtureParameters and adds a + fluent syntax for use in initializing the fixture. + + + + + 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 name of the test fixture + + The modified TestFixtureData instance + + + + Sets the list of display names to use as the parameters in the test name. + + + + + Marks the test fixture as explicit. + + + + + Marks the test fixture as explicit, specifying the reason. + + + + + Ignores this TestFixture, specifying the reason. + + The reason. + + + + + TestParameters class holds any named parameters supplied to the test run + + + + + Gets the number of test parameters + + + + + Gets a collection of the test parameter names + + + + + Gets a flag indicating whether a parameter with the specified name exists. + + Name of the parameter + True if it exists, otherwise false + + + + Indexer provides access to the internal dictionary + + Name of the parameter + Value of the parameter or null if not present + + + + Get method is a simple alternative to the indexer + + Name of the parameter + Value of the parameter or null if not present + + + + Get the value of a parameter or a default string + + Name of the parameter + Default value of the parameter + Value of the parameter or default value if not present + + + + Get the value of a parameter or return a default + + The return Type + Name of the parameter + Default value of the parameter + Value of the parameter or default value if not present + + + + Adds a parameter to the list + + Name of the parameter + Value of the parameter + + + + Helper class with properties and methods that supply + constraints that operate on exceptions. + + + + + 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 ArgumentException + + + + + Creates a constraint specifying an expected ArgumentNullException + + + + + Creates a constraint specifying an expected InvalidOperationException + + + + + Creates a constraint specifying that no exception is thrown + + + + + 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 + + + + + Provides static methods to express conditions + that must be met for the test to succeed. If + any test fails, a warning is issued. + + + + + DO NOT USE! + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + Not applicable + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + 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 a warning is issued. + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning on success. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning on success. + + The Type being compared. + 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 an actual value, succeeding if the constraint + fails and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + 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 a warning is issued. + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + The message to display if the condition is true + Arguments to be used in formatting the message + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning if it succeeds. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning if it succeeds. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + FrameworkPackageSettings is a static class containing constant values that + are used as keys in setting up a TestPackage. These values are used in + the framework, and set in the runner. Setting values may be a string, int or bool. + + + + + Flag (bool) indicating whether tests are being debugged. + + + + + Flag (bool) indicating whether to pause execution of tests to allow + the user to attach a debugger. + + + + + The InternalTraceLevel for this run. Values are: "Default", + "Off", "Error", "Warning", "Info", "Debug", "Verbose". + Default is "Off". "Debug" and "Verbose" are synonyms. + + + + + Full path of the directory to be used for work and result files. + This path is provided to tests by the framework TestContext. + + + + + Integer value in milliseconds for the default timeout value + for test cases. If not specified, there is no timeout except + as specified by attributes on the tests themselves. + + + + + A TextWriter to which the internal trace will be sent. + + + + + A list of tests to be loaded. + + + + + The number of test threads to run for the assembly. If set to + 1, a single queue is used. If set to 0, tests are executed + directly, without queuing. + + + + + The random seed to be used for this assembly. If specified + as the value reported from a prior run, the framework should + generate identical random values for tests as were used for + that run, provided that no change has been made to the test + assembly. Default is a random value itself. + + + + + If true, execution stops after the first error or failure. + + + + + If true, use of the event queue is suppressed and test events are synchronous. + + + + + The default naming pattern used in generating test names + + + + + Parameters to be passed on to the tests, serialized to a single string which needs parsing. Obsoleted by ; kept for backward compatibility. + + + + + Parameters to be passed on to the tests, already parsed into an IDictionary<string, string>. Replaces . + + + + + If true, the tests will run on the same thread as the NUnit runner itself + + + + + Provides a platform-independent methods for getting attributes + for use by AttributeConstraint and AttributeExistsConstraint. + + + + + Gets the custom attributes from the given object. + + The actual. + Type of the attribute. + if set to true [inherit]. + A list of the given attribute on the given object. + + + + A MarshalByRefObject that lives forever + + + + + A shim of the .NET interface for platforms that do not support it. + Used to indicate that a control can be the target of a callback event on the server. + + + + + Processes a callback event that targets a control. + + + + + + Returns the results of a callback event that targets a control. + + + + + diff --git a/packages/NUnit.3.11.0/lib/netstandard2.0/nunit.framework.dll b/packages/NUnit.3.11.0/lib/netstandard2.0/nunit.framework.dll new file mode 100644 index 0000000000000000000000000000000000000000..4b97099b9ab7d2ad152da350c0d6c071bf15d342 Binary files /dev/null and b/packages/NUnit.3.11.0/lib/netstandard2.0/nunit.framework.dll differ diff --git a/packages/NUnit.3.11.0/lib/netstandard2.0/nunit.framework.pdb b/packages/NUnit.3.11.0/lib/netstandard2.0/nunit.framework.pdb new file mode 100644 index 0000000000000000000000000000000000000000..bb3bae1e5b94b146301a1ec28b313f6e815d0859 Binary files /dev/null and b/packages/NUnit.3.11.0/lib/netstandard2.0/nunit.framework.pdb differ diff --git a/packages/NUnit.3.11.0/lib/netstandard2.0/nunit.framework.xml b/packages/NUnit.3.11.0/lib/netstandard2.0/nunit.framework.xml new file mode 100644 index 0000000000000000000000000000000000000000..cf856fb78cc44a29435781ae72f56d41780f0cad --- /dev/null +++ b/packages/NUnit.3.11.0/lib/netstandard2.0/nunit.framework.xml @@ -0,0 +1,20430 @@ + + + + nunit.framework + + + + + 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 + + + + + DefaultTestAssemblyBuilder loads a single assembly and builds a TestSuite + containing test fixtures present in the assembly. + + + + + The default suite builder used by the test assembly builder. + + + + + Initializes a new instance of the class. + + + + + Build a suite of tests from a provided assembly + + The assembly from which tests are to be built + A dictionary of options to use in building the suite + + A TestSuite containing the tests found in the assembly + + + + + Build a suite of tests given the name or the location of an assembly + + The name or the location of the assembly. + A dictionary of options to use in building the suite + + A TestSuite containing the tests found in the assembly + + + + + FrameworkController provides a facade for use in loading, browsing + and running tests without requiring a reference to the NUnit + framework. All calls are encapsulated in constructors for + this class and its nested classes, which only require the + types of the Common Type System as arguments. + + The controller supports four actions: Load, Explore, Count and Run. + They are intended to be called by a driver, which should allow for + proper sequencing of calls. Load must be called before any of the + other actions. The driver may support other actions, such as + reload on run, by combining these calls. + + + + + Construct a FrameworkController using the default builder and runner. + + The AssemblyName or path to the test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + + + + Construct a FrameworkController using the default builder and runner. + + The test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + + + + Construct a FrameworkController, specifying the types to be used + for the runner and builder. This constructor is provided for + purposes of development. + + The full AssemblyName or the path to the test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + The Type of the test runner + The Type of the test builder + + + + Construct a FrameworkController, specifying the types to be used + for the runner and builder. This constructor is provided for + purposes of development. + + The test assembly + A prefix used for all test ids created under this controller. + A Dictionary of settings to use in loading and running the tests + The Type of the test runner + The Type of the test builder + + + + Gets the ITestAssemblyBuilder used by this controller instance. + + The builder. + + + + Gets the ITestAssemblyRunner used by this controller instance. + + The runner. + + + + Gets the AssemblyName or the path for which this FrameworkController was created + + + + + Gets the Assembly for which this + + + + + Gets a dictionary of settings for the FrameworkController + + + + + Loads the tests in the assembly + + + + + + Returns info about the tests in an assembly + + A string containing the XML representation of the filter to use + The XML result of exploring the tests + + + + Runs the tests in an assembly + + A string containing the XML representation of the filter to use + The XML result of the test run + + + + Runs the tests in an assembly synchronously reporting back the test results through the callback + or through the return value + + The callback that receives the test results + A string containing the XML representation of the filter to use + The XML result of the test run + + + + Runs the tests in an assembly asynchronously reporting back the test results through the callback + + The callback that receives the test results + A string containing the XML representation of the filter to use + + + + Stops the test run + + True to force the stop, false for a cooperative stop + + + + Counts the number of test cases in the loaded TestSuite + + A string containing the XML representation of the filter to use + The number of tests + + + + Inserts environment element + + Target node + The new node + + + + Inserts settings element + + Target node + Settings dictionary + The new node + + + + FrameworkControllerAction is the base class for all actions + performed against a FrameworkController. + + + + + LoadTestsAction loads a test into the FrameworkController + + + + + LoadTestsAction loads the tests in an assembly. + + The controller. + The callback handler. + + + + ExploreTestsAction returns info about the tests in an assembly + + + + + Initializes a new instance of the class. + + The controller for which this action is being performed. + Filter used to control which tests are included (NYI) + The callback handler. + + + + CountTestsAction counts the number of test cases in the loaded TestSuite + held by the FrameworkController. + + + + + Construct a CountsTestAction and perform the count of test cases. + + A FrameworkController holding the TestSuite whose cases are to be counted + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + RunTestsAction runs the loaded TestSuite held by the FrameworkController. + + + + + Construct a RunTestsAction and run all tests in the loaded TestSuite. + + A FrameworkController holding the TestSuite to run + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + RunAsyncAction initiates an asynchronous test run, returning immediately + + + + + Construct a RunAsyncAction and run all tests in the loaded TestSuite. + + A FrameworkController holding the TestSuite to run + A string containing the XML representation of the filter to use + A callback handler used to report results + + + + StopRunAction stops an ongoing run. + + + + + Construct a StopRunAction and stop any ongoing run. If no + run is in process, no error is raised. + + The FrameworkController for which a run is to be stopped. + True the stop should be forced, false for a cooperative stop. + >A callback handler used to report results + A forced stop will cause threads and processes to be killed as needed. + + + + The ITestAssemblyBuilder interface is implemented by a class + that is able to build a suite of tests given an assembly or + an assembly filename. + + + + + Build a suite of tests from a provided assembly + + The assembly from which tests are to be built + A dictionary of options to use in building the suite + A TestSuite containing the tests found in the assembly + + + + Build a suite of tests given the filename of an assembly + + The filename of the assembly from which tests are to be built + A dictionary of options to use in building the suite + A TestSuite containing the tests found in the assembly + + + + The ITestAssemblyRunner interface is implemented by classes + that are able to execute a suite of tests loaded + from an assembly. + + + + + Gets the tree of loaded tests, or null if + no tests have been loaded. + + + + + Gets the tree of test results, if the test + run is completed, otherwise null. + + + + + Indicates whether a test has been loaded + + + + + Indicates whether a test is currently running + + + + + Indicates whether a test run is complete + + + + + Loads the tests found in an Assembly, returning an + indication of whether or not the load succeeded. + + File name of the assembly to load + Dictionary of options to use in loading the test + An ITest representing the loaded tests + + + + Loads the tests found in an Assembly, returning an + indication of whether or not the load succeeded. + + The assembly to load + Dictionary of options to use in loading the test + An ITest representing the loaded tests + + + + Count Test Cases using a filter + + The filter to apply + The number of test cases found + + + + Explore the test cases using a filter + + The filter to apply + Test Assembly with test cases that matches the filter + + + + Run selected tests and return a test result. The test is run synchronously, + and the listener interface is notified as it progresses. + + Interface to receive ITestListener notifications. + A test filter used to select tests to be run + + + + Run selected tests asynchronously, notifying the listener interface as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + + + Wait for the ongoing run to complete. + + Time to wait in milliseconds + True if the run completed, otherwise false + + + + Signal any test run that is in process to stop. Return without error if no test is running. + + If true, kill any test-running threads + + + + Implementation of ITestAssemblyRunner + + + + + Initializes a new instance of the class. + + The builder. + + + + Gets the default level of parallel execution (worker threads) + + + + + The tree of tests that was loaded by the builder + + + + + The test result, if a run has completed + + + + + Indicates whether a test is loaded + + + + + Indicates whether a test is running + + + + + Indicates whether a test run is complete + + + + + Our settings, specified when loading the assembly + + + + + The top level WorkItem created for the assembly as a whole + + + + + The TestExecutionContext for the top level WorkItem + + + + + Loads the tests found in an Assembly + + File name or path of the assembly to load + Dictionary of option settings for loading the assembly + True if the load was successful + + + + Loads the tests found in an Assembly + + The assembly to load + Dictionary of option settings for loading the assembly + True if the load was successful + + + + Count Test Cases using a filter + + The filter to apply + The number of test cases found + + + + Explore the test cases using a filter + + The filter to apply + Test Assembly with test cases that matches the filter + + + + Run selected tests and return a test result. The test is run synchronously, + and the listener interface is notified as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + + + + Run selected tests asynchronously, notifying the listener interface as it progresses. + + Interface to receive EventListener notifications. + A test filter used to select tests to be run + + RunAsync is a template method, calling various abstract and + virtual methods to be overridden by derived classes. + + + + + Wait for the ongoing run to complete. + + Time to wait in milliseconds + True if the run completed, otherwise false + + + + Signal any test run that is in process to stop. Return without error if no test is running. + + If true, kill any tests that are currently running + + + + Initiate the test run. + + + + + Create the initial TestExecutionContext used to run tests + + The ITestListener specified in the RunAsync call + + + + Handle the Completed event for the top level work item + + + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + + + Verifies that the first int is greater than the second + int. 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 int is greater than the second + int. 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Verifies that the first value is greater than or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 or equal to 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 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Asserts that an int is zero. + + The number to be examined + + + + Asserts that an int is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is zero. + + The number to be examined + + + + Asserts that an unsigned int is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is zero. + + The number to be examined + + + + Asserts that a Long is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is zero. + + The number to be examined + + + + Asserts that an unsigned Long is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is zero. + + The number to be examined + + + + Asserts that a decimal is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is zero. + + The number to be examined + + + + Asserts that a double is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is zero. + + The number to be examined + + + + Asserts that a float is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is not zero. + + The number to be examined + + + + Asserts that an int is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is not zero. + + The number to be examined + + + + Asserts that an unsigned int is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is not zero. + + The number to be examined + + + + Asserts that a Long is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is not zero. + + The number to be examined + + + + Asserts that an unsigned Long is not zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is zero. + + The number to be examined + + + + Asserts that a decimal is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is zero. + + The number to be examined + + + + Asserts that a double is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is zero. + + The number to be examined + + + + Asserts that a float is zero. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is positive. + + The number to be examined + + + + Asserts that an int is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is positive. + + The number to be examined + + + + Asserts that an unsigned int is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is positive. + + The number to be examined + + + + Asserts that a Long is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is positive. + + The number to be examined + + + + Asserts that an unsigned Long is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is positive. + + The number to be examined + + + + Asserts that a decimal is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is positive. + + The number to be examined + + + + Asserts that a double is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is positive. + + The number to be examined + + + + Asserts that a float is positive. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an int is negative. + + The number to be examined + + + + Asserts that an int is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned int is negative. + + The number to be examined + + + + Asserts that an unsigned int is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a Long is negative. + + The number to be examined + + + + Asserts that a Long is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an unsigned Long is negative. + + The number to be examined + + + + Asserts that an unsigned Long is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a decimal is negative. + + The number to be examined + + + + Asserts that a decimal is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a double is negative. + + The number to be examined + + + + Asserts that a double is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a float is negative. + + The number to be examined + + + + Asserts that a float is negative. + + The number to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + DO NOT USE! Use Assert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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. + + + + + Issues a warning using the message and arguments provided. + + The message to display. + Arguments to be used in formatting the message + + + + Issues a warning using the message provided. + + The message to display. + + + + 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. + + + + + Asserts that an object is contained in a collection. + + The expected object + The collection 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 collection. + + The expected object + The collection to be examined + + + + Wraps code containing a series of assertions, which should all + be executed, even if they fail. Failed results are saved and + reported at the end of the code block. + + A TestDelegate to be executed in Multiple Assertion mode. + + + + Wraps code containing a series of assertions, which should all + be executed, even if they fail. Failed results are saved and + reported at the end of the code block. + + A TestDelegate to be executed in Multiple Assertion mode. + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Verifies that an async 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 an async delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + + + + Verifies that an async delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that an async delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + + + + Verifies that an async delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that an async delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + + + + Verifies that an async 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 an async delegate throws an exception when called + and returns it. + + A TestDelegate + + + + Verifies that an async 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 an async 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 an async delegate throws an exception of a certain Type + or one derived from it 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 an async delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + A TestDelegate + + + + Verifies that an async delegate does not throw an exception + + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that an async delegate does not throw an exception. + + A TestDelegate + + + + 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 + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + 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 TestDelegate + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + 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 TestDelegate + + + + 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 + + + + 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 + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it 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 of a certain Type + or one derived from it when called and returns it. + + A TestDelegate + + + + Verifies that a delegate does not throw an exception + + A TestDelegate + 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 TestDelegate + + + + 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 + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + 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. + + The actual value to test + A Constraint expression to be applied + + + + 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. + + The actual value to test + A Constraint expression to be applied + The message that will be displayed on failure + Arguments 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 + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Delegate used by tests that execute code and + capture any thrown exception. + + + + + Delegate used by tests that execute async code and + capture any thrown exception. + + + + + AssertionHelper is an optional base class for user tests, + allowing the use of shorter names in making asserts. + + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to + . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to . + + The evaluated condition + + + + 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. + + 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 + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + 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 + + + + 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 + + + + Returns a ListMapper based on a collection. + + The original collection + + + + + 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 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 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 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 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 equality with zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new 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 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 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 regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression 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 a subpath of the 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. + + + + + 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. + + + + + DO NOT USE! + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + Not applicable + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + 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 + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + 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 InconclusiveException on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Provides the author of a test or test fixture. + + + + + Initializes a new instance of the class. + + The name of the author. + + + + Initializes a new instance of the class. + + The name of the author. + The email address of the author. + + + + Applies 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 + + + + + Modifies a test by adding a category to it. + + The test to modify + + + + Marks a test to use a combinatorial join of any argument data provided. + Since this is the default, the attribute is optional. + + + + + Default constructor + + + + + Marks a test as using a particular CombiningStrategy to join any supplied parameter data. + Since this is the default, the attribute is optional. + + + + + Construct a CombiningStrategyAttribute incorporating an + ICombiningStrategy and an IParameterDataProvider. + + Combining strategy to be used in combining data + An IParameterDataProvider to supply data + + + + Construct a CombiningStrategyAttribute incorporating an object + that implements ICombiningStrategy and an IParameterDataProvider. + This constructor is provided for CLS compliance. + + Combining strategy to be used in combining data + An IParameterDataProvider to supply data + + + + Builds any number of tests from the specified method and context. + + The MethodInfo for which tests are to be constructed. + The suite to which the tests will be added. + + + + Modify the test by adding the name of the combining strategy + to the properties. + + The test to modify + + + + Marks an assembly, test fixture or test method as applying to a specific Culture. + + + + + Constructor with no cultures specified, for use + with named property syntax. + + + + + Constructor taking one or more cultures + + Comma-delimited list of cultures + + + + Causes a test to be skipped if this CultureAttribute is not satisfied. + + The test to modify + + + + Tests to determine if the current culture is supported + based on the properties of this attribute. + + True, if the current culture is supported + + + + Test to determine if the a particular culture or comma- + delimited set of cultures is in use. + + Name of the culture or comma-separated list of culture ids + True if the culture is in use on the system + + + + Test to determine if one of a collection of cultures + is being used currently. + + + + + + + Abstract base class for all data-providing attributes defined by NUnit. + Used to select all data sources for a method, class or parameter. + + + + + Default constructor + + + + + Marks a field for use as a datapoint when executing a theory within + the same fixture that requires an argument of the field's Type. + + + + + Marks a field, property or method as providing a set of datapoints for use + in executing any theories within the same fixture that require an argument of + the provided Type. The data source may provide an array of the required Type + or an . Synonymous with . + + + + + Marks a field, property or method as providing a set of datapoints for use + in executing any theories within the same fixture that require an argument + of the provided type. The data source may provide an array of the required + Type or an . Synonymous with . + + + + + Sets the tolerance used by default when checking the equality of floating point values + within the test assembly, fixture or method. + + + + + Construct specifying an amount + + + + + + Apply changes to the TestExecutionContext + + The TestExecutionContext + + + + Provides the descriptive text relating to the assembly, test fixture or test method. + + + + + Construct a description Attribute + + The text of the description + + + + Marks an assembly, test fixture or test method such that it will only run if explicitly + executed from the GUI, command line or included within a test 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 + + + + Modifies a test by marking it as explicit. + + The test to modify + + + + Marks an assembly, test fixture or test method as being ignored. Ignored tests result in a warning message when the tests are run. + + + + + Constructs the attribute giving a reason for ignoring the test + + The reason for ignoring the test + + + + The date in the future to stop ignoring the test as a string in UTC time. + For example for a date and time, "2014-12-25 08:10:00Z" or for just a date, + "2014-12-25". If just a date is given, the Ignore will expire at midnight UTC. + + + Once the ignore until date has passed, the test will be marked + as runnable. Tests with an ignore until date will have an IgnoreUntilDate + property set which will appear in the test results. + + The string does not contain a valid string representation of a date and time. + + + + Modifies a test by marking it as Ignored. + + The test to modify + + + + 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 items 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 + + + + + Sets the number of worker threads that may be allocated by the framework + for running tests. + + + + + Construct a LevelOfParallelismAttribute. + + The number of worker threads to be created by the framework. + + + + Specifies the maximum time (in milliseconds) for a test case to succeed. + + + + + Construct a MaxTimeAttribute, given a time in milliseconds. + + The maximum elapsed time in milliseconds + + + + Marks tests that should NOT be run in parallel. + + + + + Construct a NonParallelizableAttribute. + + + + + Used by third-party frameworks, or other software, that reference + the NUnit framework but do not contain any tests. Applying the + attribute indicates that the assembly is not a test assembly and + may prevent errors if certain runners attempt to load the assembly. + Note that recognition of the attribute depends on each individual runner. + + + + + Abstract base class for all custom attributes defined by NUnit. + + + + + Default constructor + + + + + Identifies a method that is called once to perform setup before any child tests are run. + + + + + Identifies a method to be called once after all the child tests have run. + The method is guaranteed to be called, even if an exception is thrown. + + + + + Defines the order that the test will run in + + + + + Defines the order that the test will run in + + + + + Defines the order that the test will run in + + + + + + Modifies a test as defined for the specific attribute. + + The test to modify + + + + Marks a test as using a pairwise join of any supplied argument data. Arguments will be + combined in such a way that all possible pairs of arguments are used. + + + + + Default constructor + + + + + Marks a test assembly, fixture or method that may be run in parallel. + + + + + Construct a ParallelizableAttribute using default ParallelScope.Self. + + + + + Construct a ParallelizableAttribute with a specified scope. + + The ParallelScope associated with this attribute. + + + + Defines the degree to which this test and its descendants may be run in parallel + + + + + Overridden to check for invalid combinations of settings + + + + + + Modify the context to be used for child tests + + The current TestExecutionContext + + + + Specifies the degree to which a test, and its descendants, + may be run in parallel. + + + + + No ParallelScope was specified on the test + + + + + The test may be run in parallel with others at the same level. + Valid on classes and methods but not assemblies. + + + + + Test may not be run in parallel with any others. Valid on + classes and methods but not assemblies. + + + + + Mask used to extract the flags that apply to the item on which a + ParallelizableAttribute has been placed, as opposed to descendants. + + + + + Descendants of the test may be run in parallel with one another. + Valid on assemblies and classes but not on methods. + + + + + Descendants of the test down to the level of TestFixtures may be + run in parallel with one another. Valid on assemblies and classes + but not on methods. + + + + + Mask used to extract all the flags that impact descendants of a + test and place them in the TestExecutionContext. + + + + + The test and its descendants may be run in parallel with others at + the same level. Valid on classes and methods but not assemblies. + + + + + Marks an assembly, test fixture or test method as applying to a specific platform. + + + + + Constructor with no platforms specified, for use + with named property syntax. + + + + + Constructor taking one or more platforms + + Comma-delimited list of platforms + + + + Causes a test to be skipped if this PlatformAttribute is not satisfied. + + The test to modify + + + + Attaches information to a test assembly, fixture or method 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 + + + + + Modifies a test by adding properties to it. + + The test to modify + + + + Supplies a set of random values to a single parameter of a parameterized test. + + + + + If true, no value will be repeated. + + + + + Construct a random set of values appropriate for the Type of the + parameter on which the attribute appears, specifying only the count. + + + + + + Construct a set of ints within a specified range + + + + + Construct a set of unsigned ints within a specified range + + + + + Construct a set of longs within a specified range + + + + + Construct a set of unsigned longs within a specified range + + + + + Construct a set of shorts within a specified range + + + + + Construct a set of unsigned shorts within a specified range + + + + + Construct a set of doubles within a specified range + + + + + Construct a set of floats within a specified range + + + + + Construct a set of bytes within a specified range + + + + + Construct a set of sbytes within a specified range + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + Supplies 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 unsigned ints using default step of 1 + + + + + Construct a range of unsigned ints specifying the step size + + + + + Construct a range of longs using a default step of 1 + + + + + Construct a range of longs + + + + + Construct a range of unsigned longs using default step of 1 + + + + + Construct a range of unsigned longs specifying the step size + + + + + Construct a range of doubles + + + + + Construct a range of floats + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + Returns a string that represents the current object. + + + + Specifies that a test should be run multiple times. + + + + + Construct a RepeatAttribute + + The number of times to run the test + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + The test command for the RepeatAttribute + + + + + Initializes a new instance of the class. + + The inner command. + The number of repetitions + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Marks a test that must run on a separate thread. + + + + + Construct a RequiresThreadAttribute + + + + + Specifies that a test method should be rerun on failure up to the specified + maximum number of times. + + + + + Construct a + + The maximum number of times the test should be run if it fails + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + The test command for the + + + + + Initializes a new instance of the class. + + The inner command. + The maximum number of repetitions + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Marks a test to use a sequential join of any provided argument data. + Arguments will be combined into test cases, taking the next value of + each argument until all are used. + + + + + Default constructor + + + + + Sets the current Culture on an assembly, test fixture or test method for + the duration of a test. The culture remains set until the test or fixture + completes and is then reset to its original value. + + + + + + Construct given the name of a culture + + + + + + Sets the current UI Culture on an assembly, test fixture or test method + for the duration of a test. The UI culture remains set until the test or + fixture completes and is then reset to its original value. + + + + + + Construct given the name of a culture + + + + + + Identifies a method to be called immediately before each test is run. + + + + + Identifies a class as containing or + methods for all the test fixtures + under a given namespace. + + + + + Builds a from the specified type. + + The type info of the fixture to be used. + + + + Marks a test fixture as requiring all child tests to be run on the + same thread as the OneTimeSetUp and OneTimeTearDown. A flag in the + is set forcing all child tests + to be run sequentially on the current thread. + Any setting is ignored. + + + + + Apply changes to the TestExecutionContext + + The TestExecutionContext + + + + Identifies a method to be called immediately after each test is run. + The method is guaranteed to be called, even if an exception is thrown. + + + + + Abstract attribute providing actions to execute before and after tests. + + + + + Executed before each test is run + + The test that is going to be run. + + + + Executed after each test is run + + The test that has just been run. + + + + Provides the target for the action attribute + + + + + Marks a test assembly as needing a special assembly resolution hook that will + explicitly search the test assembly's directory for dependent assemblies. + This works around a conflict between mixed-mode assembly initialization and + tests running in their own AppDomain in some cases. + + + + + Marks the method as callable from the NUnit test runner. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + public void TestDescriptionMethod() + {} + } + + + + + + Descriptive text for this test + + + + + The author of this test + + + + + The type that this test is testing + + + + + Gets or sets the expected result. Not valid if the test + method has parameters. + + The result. + + + + Modifies a test by adding a description, if not already set. + + The test to modify + + + + Builds a single test from the specified method and context. + + The method for which a test is to be constructed. + The suite to which the test will be added. + + + + Marks a method as a parameterized test suite and provides arguments for each test case. + + + + + 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 or sets the name of the test. + + The name of the test. + + + + Gets or sets the RunState of this test case. + + + + + Gets the list of arguments to a test case + + + + + Gets the properties of the test case + + + + + Gets or sets the expected result. + + The result. + + + + Returns true if the expected result has been set + + + + + Gets or sets the description. + + The description. + + + + The author of this test + + + + + The type that this test is testing + + + + + Gets or sets the reason for ignoring the test + + + + + Gets or sets a value indicating whether this is explicit. + + + true if explicit; otherwise, false. + + + + + Gets or sets the reason for not running the test. + + The reason. + + + + Gets or sets the ignore reason. When set to a non-null + non-empty value, the test is marked as ignored. + + The ignore reason. + + + + Comma-delimited list of platforms to run the test for + + + + + Comma-delimited list of platforms to not run the test for + + + + + Gets and sets the category for this test case. + May be a comma-separated list of categories. + + + + + Performs several special conversions allowed by NUnit in order to + permit arguments with types that cannot be used in the constructor + of an Attribute such as TestCaseAttribute or to simplify their use. + + The arguments to be converted + The ParameterInfo array for the method + + + + Performs several special conversions allowed by NUnit in order to + permit arguments with types that cannot be used in the constructor + of an Attribute such as TestCaseAttribute or to simplify their use. + + The argument to be converted + The target in which the should be converted + If conversion was successfully applied, the converted into + + true if was converted and should be used; + false is no conversion was applied and should be ignored + + + + + Builds a single test from the specified method and context. + + The MethodInfo for which tests are to be constructed. + The suite to which the tests will be added. + + + + Indicates the source to be used to provide test fixture instances for a test class. + + + + + Construct with the name of the method, property or field that will provide data + + The name of a static method, property or field that will provide data. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + + + + Construct with a name + + The name of a static method, property or field that will provide data. + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + Construct with a Type + + The type that will provide data + + + + A set of parameters passed to the method, works only if the Source Name is a method. + If the source name is a field or property has no effect. + + + + + 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 every fixture created from + this attribute. May be a single category or a comma-separated list. + + + + + Builds any number of tests from the specified method and context. + + The IMethod for which tests are to be constructed. + The suite to which the tests will be added. + + + + Marks the class as a TestFixture. + + + + + 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. + + + + + + Gets or sets the name of the test. + + The name of the test. + + + + Gets or sets the RunState of this test fixture. + + + + + The arguments originally provided to the attribute + + + + + Properties pertaining to this fixture + + + + + Get or set the type arguments. If not set + explicitly, any leading arguments that are + Types are taken as type arguments. + + + + + Descriptive text for this fixture + + + + + The author of this fixture + + + + + The type that this fixture is testing + + + + + Gets or sets the ignore reason. May set RunState as a side effect. + + The ignore reason. + + + + Gets or sets the reason for not running the fixture. + + The reason. + + + + Gets or sets the ignore reason. When set to a non-null + non-empty value, the test is marked as ignored. + + The ignore reason. + + + + Gets or sets a value indicating whether this is explicit. + + + true if explicit; otherwise, false. + + + + + Gets and sets the category for this fixture. + May be a comma-separated list of categories. + + + + + Builds a single test fixture from the specified type. + + + + + Builds a single test fixture from the specified type. + + The type info of the fixture to be used. + Filter used to select methods as tests. + + + + Identifies the source used to provide test fixture instances for a test class. + + + + + Error message string is public so the tests can use it + + + + + Construct with the name of the method, property or field that will provide data + + The name of a static method, property or field that will provide data. + + + + Construct with a Type and name + + The Type that will provide data + The name of a static method, property or field that will provide data. + + + + Construct with a Type + + The type 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 every fixture created from + this attribute. May be a single category or a comma-separated list. + + + + + Builds any number of test fixtures from the specified type. + + The TypeInfo for which fixtures are to be constructed. + + + + Builds any number of test fixtures from the specified type. + + The TypeInfo for which fixtures are to be constructed. + PreFilter used to select methods as tests. + + + + Returns a set of ITestFixtureData items for use as arguments + to a parameterized test fixture. + + The type for which data is needed. + + + + + Indicates the method or class the assembly, test fixture or test method is testing. + + + + + Initializes a new instance of the class. + + The type that is being tested. + + + + Initializes a new instance of the class. + + The type that is being tested. + + + + 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")] + public void TestDescriptionMethod() + {} + } + + + + + + Construct the attribute, specifying a combining strategy and source of parameter data. + + + + + Provides literal arguments for an individual parameter of a test. + + + + + 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 + + + + + Constructs for use with an Enum parameter. Will pass every enum + value in to the test. + + + + + Construct with one argument + + + + + + Construct with two arguments + + + + + + + Construct with three arguments + + + + + + + + Construct with an array of arguments + + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + To generate data for Values attribute, in case no data is provided. + + + + + To Check if type is nullable enum. + + + + + Indicates the source 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 a static method, property or field 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 a static 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 + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + A set of Assert methods operating on one or more collections + + + + + DO NOT USE! Use CollectionAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + 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 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 + 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 + 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 + 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 + 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 + 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 + 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 + Arguments to be used in formatting the message + + + + Asserts that the superset does not contain the subset + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + + + + Asserts that the superset does not contain the subset + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the superset contains the subset. + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + + + + Asserts that the superset contains the subset. + + The IEnumerable subset to be considered + The IEnumerable superset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the subset does not contain the superset + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that the subset does not contain the superset + + 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 the subset contains the superset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that the subset contains the superset. + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + AllItemsConstraint applies another constraint to each + item in a collection, succeeding if they all succeed. + + + + + Construct an AllItemsConstraint on top of an existing 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. + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + AndConstraint succeeds only if both members succeed. + + + + + Create an AndConstraint from two other constraints + + The first constraint + The second constraint + + + + Gets text describing a 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 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 + + + + is used to determine whether the value is equal to any of the expected values. + + + + + Construct a + + Collection of expected values + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether item is present in expected collection + + Actual item type + Actual item + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IEqualityComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + AssignableFromConstraint is used to test that an object + can be assigned from a given Type. + + + + + Construct an AssignableFromConstraint for the type provided + + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + AssignableToConstraint is used to test that an object + can be assigned to a given Type. + + + + + Construct an AssignableToConstraint for the type provided + + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + 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. + + + + + Constructs an AttributeConstraint for a specified attribute + Type and base constraint. + + + + + + + Determines whether the Type or other provider has the + expected attribute and if its value matches the + additional constraint specified. + + + + + Returns a string representation of the constraint. + + + + + AttributeExistsConstraint tests for the presence of a + specified attribute on a Type. + + + + + Constructs an AttributeExistsConstraint for a specific attribute Type + + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Tests whether the object provides the expected attribute. + + A Type, MethodInfo, or other ICustomAttributeProvider + True if the expected attribute is present, otherwise false + + + + 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 + + + + BinarySerializableConstraint tests whether + an object is serializable in binary format. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Returns the string representation + + + + + 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 + + + + + + + CollectionContainsConstraint is used to test whether a collection + contains an expected object as a member. + + + + + Construct a CollectionContainsConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Test whether the expected item is contained in the collection + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + CollectionEquivalentConstraint is used to determine whether two + collections are equivalent. + + + + The result of the from the collections + under comparison. + + + Construct a CollectionEquivalentConstraint + Expected collection. + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether two collections are equivalent + + + + + + + Test whether the collection is equivalent to the expected. + + + Actual collection type. + + + Actual collection to compare. + + + A indicating whether or not + the two collections are equivalent. + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + Provides a for the . + + + Result of a of the collections to compare for equivalence. + + + Maximum amount of elements to write to the if there are + extra/missing elements from the collection. + + + Construct a using a . + Source . + Result of the collection comparison. + Actual collection to compare. + Whether or not the succeeded. + + + Write any additional lines (following Expected: and But was:) for a failing constraint. + The to write the failure message to. + + + + CollectionItemsEqualConstraint is the abstract base class for all + collection constraints that apply some notion of item equality + as a part of their operation. + + + + + The NUnitEqualityComparer in use for this constraint + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Get a flag indicating whether the user requested us to ignore case. + + + + + Get a flag indicating whether any external comparers are in use. + + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + Compares two collection members for equality + + + + + Return a new CollectionTally for use in making tests + + The collection to be included in the tally + + + + CollectionOrderedConstraint is used to test whether a collection is ordered. + + + + + Construct a CollectionOrderedConstraint + + + + + 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. + + + + + If used performs a default ascending comparison + + + + + If used performs a reverse comparison + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use a and returns self. + + + + + Modifies the constraint to test ordering by the value of + a specified property and returns self. + + + + + Then signals a break between two ordering steps + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Test whether the collection is ordered + + + + + Returns the string representation of the constraint. + + + + + + An OrderingStep represents one stage of the sort + + + + + Constructor for success result. + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + + + + Constructor for failure result. + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + Index at which collection order breaks. + Value at which collection order breaks. + + + + 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 + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the actual collection is a subset of + the expected collection provided. + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + CollectionSupersetConstraint is used to determine whether + one collection is a superset of another + + + + + Construct a CollectionSupersetConstraint + + The collection that the actual value is expected to be a superset of + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the actual collection is a superset of + the expected collection provided. + + + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + counts (tallies) the number of occurrences + of each object in one or more enumerations. + + + The result of a . + + + Items that were not in the expected collection. + + + Items that were not accounted for in the expected collection. + + + Initializes a new instance of the class with the given fields. + + + The result of the comparison between the two collections. + + + Construct a CollectionTally object from a comparer and a collection. + The comparer to use for equality. + The expected collection to compare against. + + + Try to remove an object from the tally. + The object to remove. + + + Try to remove a set of objects from the tally. + The objects to remove. + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two types related by . + + + + + Interface for comparing two s. + + + + + Method for comparing two objects with a tolerance. + + The first object to compare. + The second object to compare. + The tolerance to use when comparing the objects. + Flag indicating whether or not this is the top level comparison. + + null if the objects cannot be compared using the method. + Otherwise the result of the comparison is returned. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s. + + + + + Comparator for two s or s. + + + + + Comparator for two Tuples. + + + + + Base class for comparators for tuples (both regular Tuples and ValueTuples). + + + + + Comparator for two ValueTuples. + + + + + ComparisonAdapter class centralizes all comparisons of + values in NUnit, adapting to the use of any provided + , + or . + + + + + Gets the default ComparisonAdapter, which wraps an + NUnitComparer object. + + + + + Returns a ComparisonAdapter that wraps an + + + + + Returns a ComparisonAdapter that wraps an + + + + + Returns a ComparisonAdapter that wraps a + + + + + Compares two objects + + + + + Construct a default ComparisonAdapter + + + + + Construct a ComparisonAdapter for an + + + + + Compares two objects + + + + + + + + ComparerAdapter extends and + allows use of an or + to actually perform the comparison. + + + + + Construct a ComparisonAdapter for an + + + + + Compare a Type T to an object + + + + + Construct a ComparisonAdapter for a + + + + + Compare a Type T to an object + + + + + Abstract base class for constraints that compare values to + determine if one is greater than, equal to or less than + the other. + + + + + The value against which a comparison is to be made + + + + + Tolerance used in making the comparison + + + + + ComparisonAdapter to be used in making the comparison + + + + + Initializes a new instance of the class. + + The value against which to make a comparison. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + A ConstraintResult + + + + Protected function overridden by derived class to actually perform the comparison + + + + + Modifies the constraint to use an and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Modifies the constraint to use an and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Modifies the constraint to use a and returns self + + The comparer used for comparison tests + A constraint modified to use the given comparer + + + + Set the tolerance for use in this comparison + + + + + Switches the .Within() modifier to interpret its tolerance as + a percentage that the actual values is allowed to deviate from + the expected value. + + Self + + + + Delegate used to delay evaluation of the actual value + to be used in evaluating a constraint + + + + + The Constraint class is the base of all built-in constraints + within NUnit. It provides the operator overloads used to combine + constraints. + + + + + Construct a constraint with optional arguments + + Arguments to be saved + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Arguments provided to this Constraint, for use in + formatting the description. + + + + + The ConstraintBuilder holding this constraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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 + A ConstraintResult + + + + Retrieves the value to be tested from an ActualValueDelegate. + The default implementation simply evaluates the delegate but derived + classes may override it to provide for delayed processing. + + An ActualValueDelegate + Delegate evaluation result + + + + 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 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. + + + + + Returns a DelayedConstraint.WithRawDelayInterval with the specified delay time. + + The delay, which defaults to milliseconds. + + + + + Returns a DelayedConstraint with the specified delay time + and polling interval. + + The delay in milliseconds. + The interval at which to test the constraint. + + + + + Resolves any pending operators and returns the resolved 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 reorganized. a ConstraintStack holds + input constraints as well as the results of each + operator applied. + + + + + OperatorStack is a type-safe stack for holding ConstraintOperators + + + + + Initializes a new instance of the class. + + The ConstraintBuilder using this stack. + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost operator without modifying the stack. + + + + + Pushes the specified operator onto the stack. + + The operator to put onto the stack. + + + + Pops the topmost operator from the stack. + + The topmost operator on the stack + + + + ConstraintStack is a type-safe stack for holding Constraints + + + + + Initializes a new instance of the class. + + The ConstraintBuilder using this stack. + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Pushes the specified constraint. As a side effect, + the constraint's Builder field is set to the + ConstraintBuilder owning this stack. + + The constraint to put onto the stack + + + + Pops this topmost constraint from the stack. + As a side effect, the constraint's Builder + field is set to null. + + The topmost constraint on the stack + + + + 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 expression 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. + + + + + 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 + reorganized. When a constraint is appended, it is returned as the + value of the operation so that modifiers may be applied. However, + any partially built expression is attached to the constraint for + later resolution. When an operator is appended, the partial + expression is returned. If it's a self-resolving operator, then + a ResolvableConstraintExpression is returned. + + + + + 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. Note that the constraint + is not reduced at this time. For example, if there + is a NotOperator on the stack we don't reduce and + return a NotConstraint. The original constraint must + be returned because it may support modifiers that + are yet to be applied. + + + + + 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 ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a , which will + apply the following constraint to a collection of length one, succeeding + only if exactly one of them succeeds. + + + + + 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 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 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. + + + + + With is currently a NOP - reserved for future use. + + + + + 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 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 if item is equal to zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new 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 new 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 new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the Dictionary key collection. + + The key to be matched in the Dictionary key collection + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the Dictionary value collection. + + The value to be matched in the Dictionary value collection + + + + 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 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 ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression 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 a subpath of the 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 + inclusively within a specified range. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + Returns a constraint that succeeds if the value + is a file or directory and it exists. + + + + + Returns a constraint that tests if an item is equal to any of parameters + + Expected values + + + + ConstraintStatus represents the status of a ConstraintResult + returned by a Constraint being applied to an actual value. + + + + + The status has not yet been set + + + + + The constraint succeeded + + + + + The constraint failed + + + + + An error occurred in applying the constraint (reserved for future use) + + + + + Contains the result of matching a against an actual value. + + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + The status of the new ConstraintResult. + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + If true, applies a status of Success to the result, otherwise Failure. + + + + The actual value that was passed to the method. + + + + + Gets and sets the ResultStatus for this result. + + + + + True if actual value meets the Constraint criteria otherwise false. + + + + + Display friendly name of the constraint. + + + + + Description of the constraint may be affected by the state the constraint had + when was performed against the actual value. + + + + + Write the failure message to the MessageWriter provided + as an argument. The default implementation simply passes + the result 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 occurred, can override this. + + The MessageWriter on which to display the message + + + + Write some additional failure message. + + The MessageWriter on which to display the message + + + + 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 + + + + 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 value contained within the string/collection. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Flag the constraint to ignore case and return self. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Applies a delay to the match so that a match can be evaluated in the future. + + + + + Allows only changing the time dimension of delay interval and setting a polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithRawDelayInterval + + Parent DelayedConstraint on which delay interval dimension is required to be set + + + + Changes delay interval dimension to minutes + + + + + Changes delay interval dimension to seconds + + + + + Changes delay interval dimension to milliseconds + + + + + Set polling interval, in milliseconds + + A time interval, in milliseconds + + + + + Allows only setting the polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithDimensionedDelayInterval + + Parent DelayedConstraint on which polling interval is required to be set + + + + Set polling interval, in milliseconds + + A time interval, in milliseconds + + + + + Allows only changing the time dimension of the polling interval of a DelayedConstraint + + + + + Creates a new DelayedConstraint.WithRawPollingInterval + + Parent DelayedConstraint on which polling dimension is required to be set + + + + Changes polling interval dimension to minutes + + + + + Changes polling interval dimension to seconds + + + + + Changes polling interval dimension to milliseconds + + + + + Delay value store as an Interval object + + + + + Polling value stored as an Interval object + + + + + Creates a new DelayedConstraint + + The inner constraint to 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 to decorate + The time interval after which the match is performed, in milliseconds + The time interval used for polling, in milliseconds + If the value of is less than 0 + + + + Gets text describing a constraint + + + + + 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 + A ConstraintResult + + + + 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 + + + + Returns the string representation of the constraint. + + + + + Adjusts a Timestamp by a given TimeSpan + + + + + + + + Returns the difference between two Timestamps as a TimeSpan + + + + + + + + DictionaryContainsKeyConstraint is used to test whether a dictionary + contains an expected object as a key. + + + + + Construct a DictionaryContainsKeyConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Flag the constraint to ignore case and return self. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + + + + Test whether the expected key is contained in the dictionary + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + + + + Flag the constraint to use the supplied Comparison object. + + The Comparison object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + + + + Flag the constraint to use the supplied boolean-returning delegate. + + The supplied boolean-returning delegate to use. + + + + DictionaryContainsValueConstraint is used to test whether a dictionary + contains an expected object as a value. + + + + + Construct a DictionaryContainsValueConstraint + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Gets the expected object + + + + + Test whether the expected value is contained in the dictionary + + + + + Flag the constraint to use the supplied predicate function + + The comparison function to use. + Self. + + + + Provides a for the constraints + that are applied to each item in the collection + + + + + Constructs a for a particular + Only used for Failure + + The Constraint to which this result applies + The actual value to which the Constraint was applied + Actual item that does not match expected condition + Non matching item index + + + + Write constraint description, actual items, and non-matching item + + The MessageWriter on which to display the message + + + + EmptyCollectionConstraint tests whether a collection is empty. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Check that the collection is empty + + + + + + + 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. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + EmptyDirectoryConstraint is used to test that a directory is empty + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + EmptyStringConstraint tests whether a string is empty. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + 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. + + + + + + + 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. + + + + + NUnitEqualityComparer used to test equality. + + + + + Initializes a new instance of the class. + + The expected value. + + + + Gets the tolerance for this comparison. + + + The tolerance. + + + + + Gets a value indicating whether to compare case insensitive. + + + true if comparing case insensitive; otherwise, false. + + + + + Gets a value indicating whether or not to clip strings. + + + true if set to clip strings otherwise, false. + + + + + Gets the failure points. + + + The failure points. + + + + + 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. + + + + + Flag the constraint to use a tolerance when determining equality. + + Tolerance value to be used + Self. + + + + Flags the constraint to include + property in comparison of two values. + + + Using this modifier does not allow to use the + constraint modifier. + + + + + 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 + + + + 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 boolean-returning delegate. + + The boolean-returning delegate 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 use the supplied predicate function + + The comparison function to use. + Self. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + The EqualConstraintResult class is tailored for formatting + and displaying the result of an EqualConstraint. + + + + + Construct an EqualConstraintResult + + + + + Write a failure message. Overridden to provide custom + failure messages for EqualConstraint. + + The MessageWriter to write to + + + + Display the failure information for two collections that did not match. + + The MessageWriter on which to display + The expected collection. + The actual collection + The depth of this failure in a set of nested collections + + + + Displays a single line showing the types and sizes of the expected + and actual collections or arrays. If both are identical, the value is + only shown once. + + The MessageWriter on which to display + The expected collection or array + The actual collection or array + The indentation level for the message line + + + + Displays a single line showing the point in the expected and actual + arrays at which the comparison failed. If the arrays have different + structures or dimensions, both values are shown. + + The MessageWriter on which to display + The expected array + The actual array + Index of the failure point in the underlying collections + The indentation level for the message line + + + + 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 + + + + EqualityAdapter class handles all equality comparisons + that use an , + or a . + + + + + 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 that wraps an . + + + + + that wraps an . + + + + + Returns an that wraps an . + + + + + Returns an EqualityAdapter that uses a predicate function for items comparison. + + + + + + + + + Returns true if the two objects can be compared by this adapter. + The base adapter cannot handle IEnumerables except for strings. + + + + + Compares two objects, returning true if they are equal + + + + + Returns true if the two objects can be compared by this adapter. + Generic adapter requires objects of the specified type. + + + + + Returns an that wraps an . + + + + + Returns an that wraps an . + + + + + that wraps an . + + + + + Returns an that wraps a . + + + + + ExactCountConstraint applies another constraint to each + item in a collection, succeeding only if a specified + number of items succeed. + + + + + Construct a standalone ExactCountConstraint + + + + + + 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. + + The value to be tested + A ConstraintResult + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Contain the result of matching a against an actual value. + + + + + The maximum count of list elements that are shown on the constraint result + + + + + The count of matched items of the + + + + + A list with maximum count (+1) of items of the + (The maximum count is set in ) + + + + + Constructs a for a . + + The Constraint to which this result applies. + The actual value to which the Constraint was applied. + If true, applies a status of Success to the result, otherwise Failure. + Count of matched items of the + A list with maximum count (+1) of items of the + + + + Write the actual value for a failing constraint test to a MessageWriter. + + 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. + + + + 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. + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + ExceptionTypeConstraint is a special version of ExactTypeConstraint + used to provided detailed info about the exception thrown in + an error message. + + + + + Constructs an ExceptionTypeConstraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + FalseConstraint tests that the actual value is false + + + + + Initializes a new instance of the class. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + FileExistsConstraint is used to determine if a file exists + + + + + Initializes a new instance of the class. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + FileOrDirectoryExistsConstraint is used to determine if a file or directory exists + + + + + If true, the constraint will only check if files exist, not directories + + + + + If true, the constraint will only check if directories exist, not files + + + + + Initializes a new instance of the class that + will check files and directories. + + + + + Initializes a new instance of the class that + will only check files if ignoreDirectories is true. + + if set to true [ignore directories]. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + 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. + + + + + 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 + + + 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 between 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 between 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/ + + + + + + Tests whether a value is greater than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Tests whether a value is greater than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Interface for all constraints + + + + + The display name of this Constraint for use by ToString(). + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Arguments provided to this Constraint, for use in + formatting the description. + + + + + The ConstraintBuilder holding this constraint + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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 + A ConstraintResult + + + + 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 + + + + 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. + + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + Keeps track of an interval time which can be represented in + Minutes, Seconds or Milliseconds + + + + + Constructs a interval given an value in milliseconds + + + + + Gets Interval value represented as a TimeSpan object + + + + + Returns the interval with the current value as a number of minutes. + + + + + Returns the interval with the current value as a number of seconds. + + + + + Returns the interval with the current value as a number of milliseconds. + + + + + Is true for intervals created with a non-zero value + + + + + Returns a string that represents the current object. + + + A string that represents the current object. + + + + + IntervalUnit provides the semantics to the value stored in Interval class. + + + + + Unit representing an Interval in minutes + + + + + Unit representing an Interval in seconds + + + + + Unit representing an Interval in milliseconds + + + + + The IResolveConstraint interface is implemented by all + complete and resolvable constraints and expressions. + + + + + Return the top-level constraint for this expression + + + + + + An extension of ResolvableConstraintExpression that adds a no-op Items property for readability. + + + + + Create a new instance of ItemsConstraintExpression + + + + + Create a new instance of ResolvableConstraintExpression, + passing in a pre-populated ConstraintBuilder. + + + + + + No-op property for readability. + + + + + Tests whether a value is less than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + Tests whether a value is less than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Perform the comparison + + + + + 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 + + + + + Abstract method to get the max line length + + + + + 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 given + 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 failing constraint result + + + + 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 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 + + + + Custom value formatter function + + The value + + + + + Custom value formatter factory function + + The next formatter function + ValueFormatter + If the given formatter is unable to handle a certain format, it must call the next formatter in the chain + + + + Static methods used in creating messages + + + + + Static string used when strings are clipped + + + + + Formatting strings used for expected and actual values + + + + + Current head of chain of value formatters. Public for testing. + + + + + Add a formatter to the chain of responsibility. + + + + + + Formats text to represent a generalized value. + + The value + The formatted text + + + + Formats 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 + + + + 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 + + + + Converts any null characters in a string + to their escaped representation. + + The string to be converted + The converted string + + + + Return the a string representation for a set of indices into an array + + Array of indices for which a string is needed + + + + Get an array of indices representing the point in a collection or + array corresponding to a single int index into the collection. + + The collection to which the indices apply + Index in the collection + Array of indices + + + + Clip a string to a given length, starting at a particular offset, returning the clipped + string with ellipses representing the removed parts + + The string to be clipped + The maximum permitted length of the result string + The point at which to start clipping + The clipped string + + + + Clip the expected and actual strings in a coordinated fashion, + so that they may be displayed together. + + + + + + + + + Shows the position two strings start to differ. Comparison + starts at the start index. + + The expected string + The actual string + The index in the strings at which comparison should start + Boolean indicating whether case should be ignored + -1 if no mismatch found, or the index where mismatch found + + + + NaNConstraint tests that the actual value is a double or float NaN + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test that the actual value is an NaN + + + + + + + NoItemConstraint applies another constraint to each + item in a collection, failing if any of them succeeds. + + + + + Construct a SomeItemsConstraint on top of an existing constraint + + + + + + 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. + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + 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 + + + + NullConstraint tests that the actual value is null + + + + + Initializes a new instance of the class. + + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + 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. + + + + + Returns the default NUnitComparer. + + + + + Compares two objects + + + + + + + + NUnitEqualityComparer encapsulates NUnit's handling of + equality tests between objects. + + + + + If true, all string comparisons will ignore case + + + + + If true, arrays will be treated as collections, allowing + those of different dimensions to be compared + + + + + Comparison objects used in comparisons for some constraints. + + + + + List of points at which a failure occurred. + + + + + List of comparers used to compare pairs of objects. + + + + + Initializes a new instance of the class. + + + + + 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 the list of external comparers to be used to + test for equality. They are applied to members of + collections, in place of NUnit's own logic. + + + + + Gets the list of failure points for the last Match performed. + The list consists of objects to be interpreted by the caller. + This generally means that the caller may only make use of + objects it has placed on the list at a particular depth. + + + + + Flags the comparer to include + property in comparison of two values. + + + Using this modifier does not allow to use the + modifier. + + + + + Compares two objects for equality within a tolerance. + + + + + 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 + + + + + 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. + + + + + Operator that requires both its arguments to succeed + + + + + Construct an AndOperator + + + + + Apply the operator to produce an AndConstraint + + + + + 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. + + + + + 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. + + + + + + Gets the left precedence of the operator + + + + + Gets the right precedence of the operator + + + + + Abstract method that produces a constraint by applying + the operator to its left and right constraint arguments. + + + + + Abstract base for operators that indicate how to + apply a constraint to items in a collection. + + + + + Constructs a CollectionOperator + + + + + 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. + + + + + The syntax element preceding this operator + + + + + The syntax element following 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. + + + + + 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. + + + + + + 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 + + + + 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. + + + + + + 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. + + + + + Negates the test of the constraint it wraps. + + + + + Constructs a new NotOperator + + + + + Returns a NotConstraint applied to its argument. + + + + + Operator that requires at least one of its arguments to succeed + + + + + Construct an OrOperator + + + + + Apply the operator to produce an OrConstraint + + + + + PrefixOperator takes a single constraint and modifies + its 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. + + + + + + + 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. + + + + + Gets the name of the property to which the operator applies + + + + + 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. + + + + + + Abstract base class for operators that are able to reduce to a + constraint whether or not another syntactic element follows. + + + + + 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. + + + + + 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. + + + + + Represents a constraint that simply wraps the + constraint provided as an argument, without any + further functionality, but which modifies the + order of evaluation because of its precedence. + + + + + Constructor for the WithOperator + + + + + Returns a constraint that wraps its argument + + + + + OrConstraint succeeds if either member succeeds + + + + + Create an OrConstraint from two other constraints + + The first constraint + The second constraint + + + + Gets text describing a 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 + + + + PathConstraint serves as the abstract base of constraints + that operate on paths and provides several helper methods. + + + + + Construct a PathConstraint for a give expected path + + The expected path + + + + Modifies the current instance to be case-sensitive + and returns it. + + + + + Returns the string representation of this constraint + + + + + Canonicalize the provided path + + + The path in standardized form + + + + Test whether one path in canonical form is a subpath of another path + + The first path - supposed to be the parent path + The second path - supposed to be the child path + + + + + Predicate constraint wraps a Predicate in a constraint, + returning success if the predicate is true. + + + + + Construct a PredicateConstraint from a predicate + + + + + Gets text describing a constraint + + + + + Determines whether the predicate succeeds when applied + to the actual value. + + + + + Abstract base class used for prefixes + + + + + The base constraint + + + + + Prefix used in forming the constraint description + + + + + Construct given a base constraint + + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Formats a prefix constraint's description. + + + + + 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 + + + + Returns the string representation of the constraint. + + + + + Contains the result of matching a against an actual value. + + + + + Constructs a for a particular . + + The Constraint to which this result applies. + The base result with actual value to which the Constraint was applied. + + + + Write the additional failure message for a failing constraint to a + MessageWriter. + + The writer on which the actual value is displayed + + + + 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 value + of the property. The two constraints are now separate. + + + + + Initializes a new instance of the class. + + The name of the property. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the property exists for a given object + + The object to be tested + True for success, false for failure + + + + Returns the string representation of the constraint. + + + + + + RangeConstraint tests whether two values are within a + specified range. + + + + + Initializes a new instance of the class. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use an and returns self. + + + + + Modifies the constraint to use a and returns self. + + + + + 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 + + + + 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. + + + + + Appends an And Operator to the expression + + + + + Appends an Or operator to the expression. + + + + + Resolve the current expression to a Constraint + + + + + ReusableConstraint wraps a constraint expression after + resolving it so that it can be reused consistently. + + + + + Construct a ReusableConstraint from a constraint expression + + The expression to be resolved and reused + + + + Converts a constraint to a ReusableConstraint + + The constraint to be converted + A ReusableConstraint + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Return the top-level constraint for this expression + + + + + + SameAsConstraint tests whether an object is identical to + the object passed to its constructor + + + + + Initializes a new instance of the class. + + The expected object. + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Summary description for SamePathConstraint. + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + SamePathOrUnderConstraint tests that one path is under another + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + 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 + + + + + + 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. + + + + + Apply the item constraint to each item in the collection, + succeeding if any item succeeds. + + + + + + + Flag the constraint to use the supplied object. + + The type of the elements in the collection. + The type of the member. + The comparison function to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied object. + + The IComparer object to use. + Self. + + + + 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. + + + + + + + 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 + + + + + Description of this constraint + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Constructs a StringConstraint without an expected value + + + + + Constructs a StringConstraint given an expected value + + The expected value + + + + Modify the constraint to ignore case in matching. + + + + + 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 a given string + + The string to be tested + True for success, false for failure + + + + SubPathConstraint tests that the actual path is under the expected path + + + + + Initializes a new instance of the class. + + The expected path + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + SubstringConstraint can test whether a string contains + the expected substring. + + + + + Initializes a new instance of the class. + + The expected. + + + + Modify the constraint to ignore case in matching. + This will call Using(StringComparison.CurrentCultureIgnoreCase). + + Thrown when a comparison type different + than was already set. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Modify the constraint to the specified comparison. + + Thrown when a comparison type different + than was already set. + + + + 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. + + + + Get the actual exception thrown - used by Assert.Throws. + + + + + Gets text describing a constraint + + + + + 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 actual value for a failing constraint test to a + MessageWriter. This override only handles the special message + used when an exception is expected but none is thrown. + + The writer on which the actual value is displayed + + + + ThrowsExceptionConstraint tests that an exception has + been thrown, without any further tests. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Executes the code and returns success if an exception is thrown. + + A delegate representing the code to be tested + True if an exception is thrown, otherwise false + + + + Applies the constraint to 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. + + + + + ThrowsNothingConstraint tests that a delegate does not + throw an exception. + + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True if no exception is thrown, otherwise false + + + + Applies the constraint to 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 + A ConstraintResult + + + + 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. + + + + + Returns a default Tolerance object, equivalent to an exact match. + + + + + Returns an empty Tolerance object, equivalent to an exact match. + + + + + Constructs a linear tolerance of a specified amount + + + + + Constructs a tolerance given an amount and + + + + + 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 as the amount, using + the current amount as a number of days. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of hours. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of minutes. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of seconds. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of milliseconds. + + + + + Returns a new tolerance with a as the amount, using + the current amount as a number of clock ticks. + + + + + Gets the for the current Tolerance + + + + + Gets the magnitude of the current Tolerance instance. + + + + + Returns true if the current tolerance has not been set or is using the . + + + + + Apply the tolerance to an expected value and return + a Tolerance.Range that represents the acceptable values. + + + + + Tests that the current Tolerance is linear with a + numeric value, throwing an exception if it is not. + + + + + Tolerance.Range represents the range of values that match + a specific tolerance, when applied to a specific value. + + + + + The lower bound of the range + + + + + The upper bound of the range + + + + + Constructs a range + + + + + 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. + + + + + TrueConstraint tests that the actual value is true + + + + + Initializes a new instance of the class. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + TypeConstraint is the abstract base for constraints + that take a Type as their expected value. + + + + + The expected Type used by the constraint + + + + + The type of the actual argument to which the constraint was applied + + + + + Construct a TypeConstraint for a given Type + + The expected type for the constraint + Prefix used in forming the constraint description + + + + Applies the constraint to an actual value, returning a ConstraintResult. + + The value to be tested + A ConstraintResult + + + + Apply the constraint to an actual value, returning true if it succeeds + + The actual argument + True if the constraint succeeds, otherwise false. + + + + UniqueItemsConstraint tests whether all the items in a + collection are unique. + + + + + The Description of what this constraint tests, for + use in messages and in the ConstraintResult. + + + + + Check that all items are unique. + + + + + + + XmlSerializableConstraint tests whether + an object is serializable in XML format. + + + + + Gets text describing a constraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Returns the string representation of this constraint + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the dictionary. + + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the dictionary. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Asserts on Directories + + + + + DO NOT USE! Use DirectoryAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both point to the same directory. + 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 the 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 point to the same directory. + If they are not 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 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 + + + + Asserts that the directory exists. If it does not exist + an is thrown. + + 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 the directory exists. If it does not exist + an is thrown. + + A directory containing the actual value + + + + Asserts that the directory exists. If it does not exist + an is thrown. + + The path to 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 the directory exists. If it does not exist + an is thrown. + + The path to a directory containing the actual value + + + + Asserts that the directory does not exist. If it does exist + an is thrown. + + 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 the directory does not exist. If it does exist + an is thrown. + + A directory containing the actual value + + + + Asserts that the directory does not exist. If it does exist + an is thrown. + + The path to 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 the directory does not exist. If it does exist + an is thrown. + + The path to a directory containing the actual value + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a constraint that succeeds if the value + is a file or directory and it exists. + + + + + Returns a new checking for the + presence of a particular object in the collection. + + + + + Returns a new . 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 new DictionaryContainsKeyConstraint checking for the + presence of a particular key in the Dictionary key collection. + + The key to be matched in the Dictionary key collection + + + + Returns a new DictionaryContainsValueConstraint checking for the + presence of a particular value in the Dictionary value collection. + + The value to be matched in the Dictionary value collection + + + + 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 regular expression supplied as an argument. + + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the ResultState provided by this exception + + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + Default Constructor + + + + + Construct based on the TestResult so far. This is the constructor + used normally, when exiting the multiple assert block with failures. + Not used internally but provided to facilitate debugging. + + + The current result, up to this point. The result is not used + internally by NUnit but is provided to facilitate debugging. + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the provided by this exception. + + + + + Gets the of this test at the point the exception was thrown, + + + + + Abstract base for Exceptions that terminate a test and provide a ResultState. + + + + 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 + + + + + Gets the ResultState provided by this exception + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Gets the ResultState provided by this exception + + + + + Contains extension methods that do not require a special using directive. + + + + + Asserts on Files + + + + + DO NOT USE! Use FileAssert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + Asserts that the file exists. If it does not exist + an is thrown. + + 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 the file exists. If it does not exist + an is thrown. + + A file containing the actual value + + + + Asserts that the file exists. If it does not exist + an is thrown. + + 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 the file exists. If it does not exist + an is thrown. + + The path to a file containing the actual value + + + + Asserts that the file does not exist. If it does exist + an is thrown. + + 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 the file does not exist. If it does exist + an is thrown. + + A file containing the actual value + + + + Asserts that the file does not exist. If it does exist + an is thrown. + + 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 the file does not exist. If it does exist + an is thrown. + + The path to a file containing the actual value + + + + Class used to guard against unexpected argument values + or operations by throwing an appropriate exception. + + + + + Throws an exception if an argument is null + + The value to be tested + The name of the argument + + + + Throws an exception if a string argument is null or empty + + The value to be tested + The name of the argument + + + + Throws an ArgumentOutOfRangeException if the specified condition is not met. + + The condition that must be met + The exception message to be used + The name of the argument + + + + Throws an ArgumentException if the specified condition is not met. + + The condition that must be met + The exception message to be used + The name of the argument + + + + Throws an InvalidOperationException if the specified condition is not met. + + The condition that must be met + The exception message to be used + + + + Throws an if the specified delegate is async void. + + + + + Throws an if the specified delegate is async void. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + 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 ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a which will apply + the following constraint to only one member of the collection, + and fail if none or more than one match occurs. + + + + + 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 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 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 checking for the + presence of a particular object in the collection. + + + + + The AssertionResult class represents the result of a single assertion. + + + + + Construct an AssertionResult + + + + The pass/fail status of the assertion + + + The message produced by the assertion, or null + + + The stack trace associated with the assertion, or null + + + + ToString Override + + + + + Override GetHashCode + + + + + Override Equals + + + + + + AssertionStatus enumeration represents the possible outcomes of an assertion. + The order of definition is significant, higher level values override lower + ones in determining the overall result of a test. + + + + + An assumption failed + + + + + The assertion succeeded + + + + + A warning message was issued + + + + + The assertion failed + + + + + An unexpected exception was thrown + + + + + The IApplyToContext interface is implemented by attributes + that want to make changes to the execution context before + a test is run. + + + + + Apply changes to the execution context + + The execution context + + + + The IApplyToTest interface is implemented by self-applying + attributes that modify the state of a test in some way. + + + + + Modifies a test as defined for the specific attribute. + + The test to modify + + + + CombiningStrategy is the abstract base for classes that + know how to combine values provided for individual test + parameters to create a set of test cases. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + ICommandWrapper is implemented by attributes and other + objects able to wrap a TestCommand with another command. + + + Attributes or other objects should implement one of the + derived interfaces, rather than this one, since they + indicate in which part of the command chain the wrapper + should be applied. + + + + + Wrap a command and return the result. + + The command to be wrapped + The wrapped command + + + + Objects implementing this interface are used to wrap + the TestMethodCommand itself. They apply after SetUp + has been run and before TearDown. + + + + + Objects implementing this interface are used to wrap + the entire test, including SetUp and TearDown. + + + + + Objects implementing this interface are used to wrap + tests that can repeat. The implementing command is run once, + invoking the chained commands any number of times. + + + + + Any ITest that implements this interface is at a level that the implementing + class should be disposed at the end of the test run + + + + + The IFixtureBuilder interface is exposed by a class that knows how to + build test fixtures from a specified type. In general, it is exposed + by an attribute, but it may be implemented in a helper class used by the + attribute in some cases. + + + + + Builds any number of test fixtures from the specified type. + + The type info of the fixture to be used. + + + + The IFixtureBuilder2 interface extends IFixtureBuilder by allowing + use of a PreFilter, which is used to select methods as test cases. + + + + + Builds any number of test fixtures from the specified type. + + The type info of the fixture to be used. + PreFilter to be used to select methods. + + + + IImplyFixture is an empty marker interface used by attributes like + TestAttribute that cause the class where they are used to be treated + as a TestFixture even without a TestFixtureAttribute. + + Marker interfaces are not usually considered a good practice, but + we use it here to avoid cluttering the attribute hierarchy with + classes that don't contain any extra implementation. + + + + + The IMethodInfo class is used to encapsulate information + about a method in a platform-independent manner. + + + + + Gets the Type from which this method was reflected. + + + + + Gets the MethodInfo for this method. + + + + + Gets the name of the method. + + + + + Gets a value indicating whether the method is abstract. + + + + + Gets a value indicating whether the method is public. + + + + + Gets a value indicating whether the method contains unassigned generic type parameters. + + + + + Gets a value indicating whether the method is a generic method. + + + + + Gets a value indicating whether the MethodInfo represents the definition of a generic method. + + + + + Gets the return Type of the method. + + + + + Gets the parameters of the method. + + + + + + Returns the Type arguments of a generic method or the Type parameters of a generic method definition. + + + + + Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo. + + The type arguments to be used + A new IMethodInfo with the type arguments replaced + + + + Invokes the method, converting any TargetInvocationException to an NUnitException. + + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + Provides data for a single test parameter. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test. + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + Provides data for a single test parameter. + + + + + Retrieves a list of arguments which can be passed to the specified parameter. + + The parameter of a parameterized test. + + + + The IParameterInfo interface is an abstraction of a .NET parameter. + + + + + Gets a value indicating whether the parameter is optional + + + + + Gets an IMethodInfo representing the method for which this is a parameter + + + + + Gets the underlying .NET ParameterInfo + + + + + Gets the Type of the parameter + + + + + Implemented by filters for use in deciding which + Types and Methods should be used to generate tests. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + A PropertyBag represents a collection of name/value pairs + that allows duplicate entries with the same key. Methods + are provided for adding a new pair as well as for setting + a key to a single value. All keys are strings but values + may be of any type. Null values are not permitted, since + a null entry represents the absence of the key. + + The entries in a PropertyBag are of two kinds: those that + take a single value and those that take multiple values. + However, the PropertyBag has no knowledge of which entries + fall into each category and the distinction is entirely + up to the code using the PropertyBag. + + When working with multi-valued properties, client code + should use the Add method to add name/value pairs and + indexing to retrieve a list of all values for a given + key. For example: + + bag.Add("Tag", "one"); + bag.Add("Tag", "two"); + Assert.That(bag["Tag"], + Is.EqualTo(new string[] { "one", "two" })); + + When working with single-valued properties, client code + should use the Set method to set the value and Get to + retrieve the value. The GetSetting methods may also be + used to retrieve the value in a type-safe manner while + also providing default. For example: + + bag.Set("Priority", "low"); + bag.Set("Priority", "high"); // replaces value + Assert.That(bag.Get("Priority"), + Is.EqualTo("high")); + Assert.That(bag.GetSetting("Priority", "low"), + Is.EqualTo("high")); + + + + + Adds a key/value pair to the property bag + + The key + The value + + + + Sets the value for a key, removing any other + values that are already in the property set. + + + + + + + Gets a single value for a key, using the first + one if multiple values are present and returning + null if the value is not found. + + + + + Gets a flag indicating whether the specified key has + any entries in the property set. + + The key to be checked + True if their are values present, otherwise false + + + + Gets or sets the list of values for a particular key + + The key for which the values are to be retrieved or set + + + + Gets a collection containing all the keys in the property set + + + + + The IReflectionInfo interface is implemented by NUnit wrapper objects that perform reflection. + + + + + Returns an array of custom attributes of the specified type applied to this object + + + + + Returns a value indicating whether an attribute of the specified type is defined on this object. + + + + + The ISimpleTestBuilder interface is exposed by a class that knows how to + build a single tests from a specified method. In general, + it is exposed by an attribute, but it may be implemented in a helper class + used by the attribute in some cases. + + + + + Builds a single test from the specified method and context. + + The method to be used as a test + The TestSuite to which the method will be added + + + + The ISuiteBuilder interface is exposed by a class that knows how to + build a single test suite from a specified type. + + + + + Examine the type and determine if it is suitable for + this builder to use in building a TestSuite. + + Note that returning false will cause the type to be ignored + in loading the tests. If it is desired to load the suite + but label it as non-runnable, ignored, etc., then this + method must return true. + + The type of the fixture to be used + + + + Builds a single test suite from the specified type. + + The type of the fixture to be used + + + + Builds a single test suite from the specified type, subject + to a filter that decides which methods are included. + + The type of the fixture to be used + A PreFilter for selecting methods. + + + + Common interface supported by all representations + of a test. Only includes informational fields. + The Run method is specifically excluded to allow + for data-only representations of a test. + + + + + Gets the id of the test + + + + + Gets the name of the test + + + + + Gets the type of the test + + + + + Gets the fully qualified name of the test + + + + + Gets the name of the class containing this test. Returns + null if the test is not associated with a class. + + + + + Gets the name of the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + Gets the Type of the test fixture, if applicable, or + null if no fixture type is associated with this test. + + + + + Gets the method which declares the test, or + if no method is associated with this test. + + + + + Gets the RunState of the test, indicating whether it can be run. + + + + + Count of the test cases ( 1 if this is a test case ) + + + + + Gets the properties of the test + + + + + Gets the parent test, if any. + + The parent test or null if none exists. + + + + Returns true if this is a test suite + + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets this test's child tests + + A list of child tests + + + + Gets a fixture object for running this test. + + + + + The arguments to use in creating the test or empty array if none are required. + + + + + The ITestBuilder interface is exposed by a class that knows how to + build tests from a specified method. In general, it is exposed + by an attribute which has additional information available to provide + the necessary test parameters to distinguish the test cases built. + + + + + Builds any number of tests from the specified method and context. + + The method to be used as a test + The TestSuite to which the method will be added + + + + The ITestCaseBuilder interface is exposed by a class that knows how to + build a test from a specified method, possibly containing child test cases. + + + + + Examine the method and determine if it is suitable for + this builder to use in building a TestCase to be + included in the suite being populated. + + Note that returning false will cause the method to be ignored + in loading the tests. If it is desired to load the method + but label it as non-runnable, ignored, etc., then this + method must return true. + + The test method to examine + The suite being populated + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method to be used as a test case + The test suite being populated, or null + + + + The ITestCaseData interface is implemented by a class + that is able to return complete test cases for use by + a parameterized test method. + + + + + Gets the expected result of the test case + + + + + Returns true if an expected result has been set + + + + + The ITestData interface is implemented by a class that + represents a single instance of a parameterized test. + + + + + Gets the name to be used for the test + + + + + Gets the RunState for this test case. + + + + + Gets the argument list to be provided to the test + + + + + Gets the property dictionary for the test case + + + + + Interface to be implemented by filters applied to tests. + The filter applies when running the test, after it has been + loaded, since this is the only time an ITest exists. + + + + + Determine if a particular test passes the filter criteria. Pass + may examine the parents and/or descendants of a test, depending + on the semantics of the particular filter + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + The ITestCaseData interface is implemented by a class + that is able to return the data required to create an + instance of a parameterized test fixture. + + + + + Get the TypeArgs if separately set + + + + + The ITestListener interface is used internally to receive + notifications of significant events while a test is being + run. The events are propagated to clients by means of an + AsyncCallback. NUnit extensions may also monitor these events. + + + + + Called when a test has just started + + The test that is starting + + + + Called when a test has finished + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + The ITestResult interface represents the result of a test. + + + + + Gets the ResultState of the test result, which + indicates the success or failure of the test. + + + + + Gets the name of the test result + + + + + Gets the full name of the test result + + + + + Gets the elapsed time for running the test in seconds + + + + + Gets or sets the time the test started running. + + + + + Gets or sets the time the test finished running. + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + Gets the number of asserts executed + when running the test and all its children. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + Accessing HasChildren should not force creation of the + Children collection in classes implementing this interface. + + + + + Gets the collection of child results. + + + + + Gets the Test to which this result applies. + + + + + Gets any text output written to this result. + + + + + Gets a list of AssertionResults associated with the test + + + + + Gets the collection of files attached to the test + + + + + The ITypeInfo interface is an abstraction of a .NET Type + + + + + Gets the underlying Type on which this ITypeInfo is based + + + + + Gets the base type of this type as an ITypeInfo + + + + + Returns true if the Type wrapped is equal to the argument + + + + + Gets the name of the Type + + + + + Gets the full name of the Type + + + + + Gets the assembly in which the type is declared + + + + + Gets the namespace of the Type + + + + + Gets a value indicating whether the type is abstract. + + + + + Gets a value indicating whether the Type is a generic Type + + + + + Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types. + + + + + Gets a value indicating whether the Type is a generic Type definition + + + + + Gets a value indicating whether the type is sealed. + + + + + Gets a value indicating whether this type is a static class. + + + + + Get the display name for this typeInfo. + + + + + Get the display name for an object of this type, constructed with specific arguments + + + + + Returns a Type representing a generic type definition from which this Type can be constructed. + + + + + Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments + + + + + Returns a value indicating whether this type has a method with a specified public attribute + + + + + Returns an array of IMethodInfos for methods of this Type + that match the specified flags. + + + + + Gets the public constructor taking the specified argument Types + + + + + Returns a value indicating whether this Type has a public constructor taking the specified argument Types. + + + + + Construct an object of this Type, using the specified arguments. + + + + + An object implementing IXmlNodeBuilder is able to build + an XML representation of itself and any children. + + + + + Returns a TNode representing the current object. + + If true, children are included where applicable + A TNode representing the result + + + + Returns a TNode representing the current object after + adding it as a child of the supplied parent node. + + The parent node. + If true, children are included, where applicable + + + + + The ResultState class represents the outcome of running a test. + It contains two pieces of information. The Status of the test + is an enum indicating whether the test passed, failed, was + skipped or was inconclusive. The Label provides a more + detailed breakdown for use by client runners. + + + + + Initializes a new instance of the class. + + The TestStatus. + + + + Initializes a new instance of the class. + + The TestStatus. + The label. + + + + Initializes a new instance of the class. + + The TestStatus. + The stage at which the result was produced + + + + Initializes a new instance of the class. + + The TestStatus. + The label. + The stage at which the result was produced + + + + The result is inconclusive + + + + + The test has been skipped. + + + + + The test has been ignored. + + + + + The test was skipped because it is explicit + + + + + The test succeeded + + + + + The test issued a warning + + + + + The test failed + + + + + The test encountered an unexpected exception + + + + + The test was cancelled by the user + + + + + The test was not runnable. + + + + + A suite failed because one or more child tests failed or had errors + + + + + A suite failed because one or more child tests had warnings + + + + + A suite is marked ignored because one or more child tests were ignored + + + + + A suite failed in its OneTimeSetUp + + + + + A suite had an unexpected exception in its OneTimeSetUp + + + + + A suite had an unexpected exception in its OneTimeDown + + + + + Gets the TestStatus for the test. + + The status. + + + + Gets the label under which this test result is + categorized, if any. + + + + + Gets the stage of test execution in which + the failure or other result took place. + + + + + Get a new ResultState, which is the same as the current + one but with the FailureSite set to the specified value. + + The FailureSite to use + A new ResultState + + + + Test whether this ResultState has the same Status and Label + as another one. In other words, the whether two are equal + ignoring the Site. + + + + + + + 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. + + + + + Overload == operator for ResultStates + + + + + Overload != operator for ResultStates + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + The FailureSite enum indicates the stage of a test + in which an error or failure occurred. + + + + + Failure in the test itself + + + + + Failure in the SetUp method + + + + + Failure in the TearDown method + + + + + Failure of a parent test + + + + + Failure of a child test + + + + + The RunState enum indicates whether a test can be executed. + + + + + The test is not runnable. + + + + + The test is runnable. + + + + + The test can only be run explicitly + + + + + The test has been skipped. This value may + appear on a Test when certain attributes + are used to skip the test. + + + + + The test has been ignored. May appear on + a Test, when the IgnoreAttribute is used. + + + + + The TestAttachment class represents a file attached to a TestResult, + with an optional description. + + + + + Absolute file path to attachment file + + + + + User specifed description of attachment. May be null. + + + + + Creates a TestAttachment class to represent a file attached to a test result. + + Absolute file path to attachment file + User specifed description of attachment. May be null. + + + + The class holds a message sent by a test to all listeners + + + + + Construct with text, destination type and + the name of the test that produced the message. + + Destination of the message + Text to be sent + ID of the test that produced the message + + + + Converts object to string + + + + + The message to send to listeners + + + + + The Destination of the message. + + + + + The ID of the test that sent the message + + + + + Returns the XML representation of the object. + + + + + The TestOutput class holds a unit of output from + a test to a specific output stream + + + + + Construct with text, output destination type and + the name of the test that produced the output. + + Text to be output + Name of the stream or channel to which the text should be written + Id of the test that produced the output + FullName of test that produced the output + + + + Return string representation of the object for debugging + + + + + + Get the text + + + + + Get the output type + + + + + Get the name of the test that created the output + + + + + Get the id of the test that created the output + + + + + Convert the TestOutput object to an XML string + + + + + The TestStatus enum indicates the result of running a test + + + + + The test was inconclusive + + + + + The test has skipped + + + + + The test succeeded + + + + + There was a warning + + + + + The test failed + + + + + TNode represents a single node in the XML representation + of a Test or TestResult. It replaces System.Xml.XmlNode and + System.Xml.Linq.XElement, providing a minimal set of methods + for operating on the XML in a platform-independent manner. + + + + + Constructs a new instance of TNode + + The name of the node + + + + Constructs a new instance of TNode with a value + + The name of the node + The text content of the node + + + + Constructs a new instance of TNode with a value + + The name of the node + The text content of the node + Flag indicating whether to use CDATA when writing the text + + + + Gets the name of the node + + + + + Gets the value of the node + + + + + Gets a flag indicating whether the value should be output using CDATA. + + + + + Gets the dictionary of attributes + + + + + Gets a list of child nodes + + + + + Gets the first ChildNode + + + + + Gets the XML representation of this node. + + + + + Create a TNode from its XML text representation + + The XML text to be parsed + A TNode + + + + Adds a new element as a child of the current node and returns it. + + The element name. + The newly created child element + + + + Adds a new element with a value as a child of the current node and returns it. + + The element name + The text content of the new element + The newly created child element + + + + Adds a new element with a value as a child of the current node and returns it. + The value will be output using a CDATA section. + + The element name + The text content of the new element + The newly created child element + + + + Adds an attribute with a specified name and value to the XmlNode. + + The name of the attribute. + The value of the attribute. + + + + Finds a single descendant of this node matching an XPath + specification. The format of the specification is + limited to what is needed by NUnit and its tests. + + + + + + + Finds all descendants of this node matching an XPath + specification. The format of the specification is + limited to what is needed by NUnit and its tests. + + + + + Writes the XML representation of the node to an XmlWriter + + + + + + Class used to represent a list of XmlResults + + + + + Class used to represent the attributes of a node + + + + + Gets or sets the value associated with the specified key. + Overridden to return null if attribute is not found. + + The key. + Value of the attribute or null + + + + AssemblyHelper provides static methods for working + with assemblies. + + + + + Gets the path from which an assembly was loaded. + For builds where this is not possible, returns + the name of the assembly. + + The assembly. + The path. + + + + Gets the path to the directory from which an assembly was loaded. + + The assembly. + The path. + + + + Gets the AssemblyName of an assembly. + + The assembly + An AssemblyName + + + + Loads an assembly given a string, which is the AssemblyName + + + + + Gets the assembly path from code base. + + Public for testing purposes + The code base. + + + + + CombinatorialStrategy creates test cases by using all possible + combinations of the parameter data. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + Provides data from fields marked with the DatapointAttribute or the + DatapointsAttribute. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + Built-in SuiteBuilder for all types of test classes. + + + + + Examine the type and determine if it is suitable for + this builder to use in building a TestSuite. + + Note that returning false will cause the type to be ignored + in loading the tests. If it is desired to load the suite + but label it as non-runnable, ignored, etc., then this + method must return true. + + The fixture type to check + + + + Builds a single test suite from the specified type. + + The fixture type to build + + + + Builds a single test suite from the specified type, subject + to a filter that decides which methods are included. + + The fixture type to build + A PreFilter for selecting methods. + + + + We look for attributes implementing IFixtureBuilder at one level + of inheritance at a time. Attributes on base classes are not used + unless there are no fixture builder attributes at all on the derived + class. This is by design. + + The type being examined for attributes + + + + Class to build ether a parameterized or a normal NUnitTestMethod. + There are four cases that the builder must deal with: + 1. The method needs no params and none are provided + 2. The method needs params and they are provided + 3. The method needs no params but they are provided in error + 4. The method needs params but they are not provided + This could have been done using two different builders, but it + turned out to be simpler to have just one. The BuildFrom method + takes a different branch depending on whether any parameters are + provided, but all four cases are dealt with in lower-level methods + + + + + Determines if the method can be used to build an NUnit test + test method of some kind. The method must normally be marked + with an identifying attribute for this to be true. + + Note that this method does not check that the signature + of the method for validity. If we did that here, any + test methods with invalid signatures would be passed + over in silence in the test run. Since we want such + methods to be reported, the check for validity is made + in BuildFrom rather than here. + + An IMethodInfo for the method being used as a test method + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method for which a test is to be built + + + + Determines if the method can be used to build an NUnit test + test method of some kind. The method must normally be marked + with an identifying attribute for this to be true. + + Note that this method does not check that the signature + of the method for validity. If we did that here, any + test methods with invalid signatures would be passed + over in silence in the test run. Since we want such + methods to be reported, the check for validity is made + in BuildFrom rather than here. + + An IMethodInfo for the method being used as a test method + The test suite being built, to which the new test would be added + + + + Builds a single test from the specified method and context, + possibly containing child test cases. + + The method for which a test is to be built + The test fixture being populated, or null + + + + Builds a ParameterizedMethodSuite containing individual test cases. + + The method for which a test is to be built. + The list of test cases to include. + + + + Build a simple, non-parameterized TestMethod for this method. + + The MethodInfo for which a test is to be built + The test suite for which the method is being built + + + + Class that can build a tree of automatic namespace + suites from a group of fixtures. + + + + + NamespaceDictionary of all test suites we have created to represent + namespaces. Used to locate namespace parent suites for fixtures. + + + + + Point in the tree where items in the global namespace are added + + + + + Initializes a new instance of the class. + + The root suite. + + + + Gets the root entry in the tree created by the NamespaceTreeBuilder. + + The root suite. + + + + Adds the specified fixtures to the tree. + + The fixtures to be added. + + + + Adds the specified fixture to the tree. + + The fixture to be added. + + + + NUnitTestCaseBuilder is a utility class used by attributes + that build test cases. + + + + + Constructs an + + + + + Builds a single NUnitTestMethod, either as a child of the fixture + or as one of a set of test cases under a ParameterizedTestMethodSuite. + + The MethodInfo from which to construct the TestMethod + The suite or fixture to which the new test will be added + The ParameterSet to be used, or null + + + + Checks to see if we have valid combinations of attributes. + + The TestMethod to be checked. If it + is found to be non-runnable, it will be modified. + True if the method signature is valid, false if not + + + + Helper method that checks the signature of a TestMethod and + any supplied parameters to determine if the test is valid. + + Currently, NUnitTestMethods are required to be public, + non-abstract methods, either static or instance, + returning void. They may take arguments but the values must + be provided or the TestMethod is not considered runnable. + + Methods not meeting these criteria will be marked as + non-runnable and the method will return false in that case. + + The TestMethod to be checked. If it + is found to be non-runnable, it will be modified. + Parameters to be used for this test, or null + True if the method signature is valid, false if not + + The return value is no longer used internally, but is retained + for testing purposes. + + + + + NUnitTestFixtureBuilder is able to build a fixture given + a class marked with a TestFixtureAttribute or an unmarked + class containing test methods. In the first case, it is + called by the attribute and in the second directly by + NUnitSuiteBuilder. + + + + + Build a TestFixture from type provided. A non-null TestSuite + must always be returned, since the method is generally called + because the user has marked the target class as a fixture. + If something prevents the fixture from being used, it should + be returned nonetheless, labelled as non-runnable. + + An ITypeInfo for the fixture to be used. + Filter used to select methods as tests. + A TestSuite object or one derived from TestSuite. + + + + Overload of BuildFrom called by tests that have arguments. + Builds a fixture using the provided type and information + in the ITestFixtureData object. + + The TypeInfo for which to construct a fixture. + Filter used to select methods as tests. + An object implementing ITestFixtureData or null. + + + + + Method to add test cases to the newly constructed fixture. + + + + + Method to create a test case from a MethodInfo and add + it to the fixture being built. It first checks to see if + any global TestCaseBuilder addin wants to build the + test case. If not, it uses the internal builder + collection maintained by this fixture builder. + + The default implementation has no test case builders. + Derived classes should add builders to the collection + in their constructor. + + The method for which a test is to be created + The test suite being built. + A newly constructed Test + + + + PairwiseStrategy creates test cases by combining the parameter + data so that all possible pairs of data items are used. + + + + The number of test cases that cover all possible pairs of test function + parameters values is significantly less than the number of test cases + that cover all possible combination of test function parameters values. + And because different studies show that most of software failures are + caused by combination of no more than two parameters, pairwise testing + can be an effective ways to test the system when it's impossible to test + all combinations of parameters. + + + The PairwiseStrategy code is based on "jenny" tool by Bob Jenkins: + http://burtleburtle.net/bob/math/jenny.html + + + + + + FleaRand is a pseudo-random number generator developed by Bob Jenkins: + http://burtleburtle.net/bob/rand/talksmall.html#flea + + + + + Initializes a new instance of the FleaRand class. + + The seed. + + + + FeatureInfo represents coverage of a single value of test function + parameter, represented as a pair of indices, Dimension and Feature. In + terms of unit testing, Dimension is the index of the test parameter and + Feature is the index of the supplied value in that parameter's list of + sources. + + + + + Initializes a new instance of FeatureInfo class. + + Index of a dimension. + Index of a feature. + + + + A FeatureTuple represents a combination of features, one per test + parameter, which should be covered by a test case. In the + PairwiseStrategy, we are only trying to cover pairs of features, so the + tuples actually may contain only single feature or pair of features, but + the algorithm itself works with triplets, quadruples and so on. + + + + + Initializes a new instance of FeatureTuple class for a single feature. + + Single feature. + + + + Initializes a new instance of FeatureTuple class for a pair of features. + + First feature. + Second feature. + + + + TestCase represents a single test case covering a list of features. + + + + + Initializes a new instance of TestCaseInfo class. + + A number of features in the test case. + + + + PairwiseTestCaseGenerator class implements an algorithm which generates + a set of test cases which covers all pairs of possible values of test + function. + + + + The algorithm starts with creating a set of all feature tuples which we + will try to cover (see method). This set + includes every single feature and all possible pairs of features. We + store feature tuples in the 3-D collection (where axes are "dimension", + "feature", and "all combinations which includes this feature"), and for + every two feature (e.g. "A" and "B") we generate both ("A", "B") and + ("B", "A") pairs. This data structure extremely reduces the amount of + time needed to calculate coverage for a single test case (this + calculation is the most time-consuming part of the algorithm). + + + Then the algorithm picks one tuple from the uncovered tuple, creates a + test case that covers this tuple, and then removes this tuple and all + other tuples covered by this test case from the collection of uncovered + tuples. + + + Picking a tuple to cover + + + There are no any special rules defined for picking tuples to cover. We + just pick them one by one, in the order they were generated. + + + Test generation + + + Test generation starts from creating a completely random test case which + covers, nevertheless, previously selected tuple. Then the algorithm + tries to maximize number of tuples which this test covers. + + + Test generation and maximization process repeats seven times for every + selected tuple and then the algorithm picks the best test case ("seven" + is a magic number which provides good results in acceptable time). + + Maximizing test coverage + + To maximize tests coverage, the algorithm walks through the list of mutable + dimensions (mutable dimension is a dimension that are not included in + the previously selected tuple). Then for every dimension, the algorithm + walks through the list of features and checks if this feature provides + better coverage than randomly selected feature, and if yes keeps this + feature. + + + This process repeats while it shows progress. If the last iteration + doesn't improve coverage, the process ends. + + + In addition, for better results, before start every iteration, the + algorithm "scrambles" dimensions - so for every iteration dimension + probes in a different order. + + + + + + Creates a set of test cases for specified dimensions. + + + An array which contains information about dimensions. Each element of + this array represents a number of features in the specific dimension. + + + A set of test cases. + + + + + Gets the test cases generated by this strategy instance. + + A set of test cases. + + + + The ParameterDataProvider class implements IParameterDataProvider + and hosts one or more individual providers. + + + + + Construct with a collection of individual providers + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + ParameterDataSourceProvider supplies individual argument values for + single parameters using attributes implementing IParameterDataSource. + + + + + Determines whether any data is available for a parameter. + + The parameter of a parameterized test + + + + Retrieves data for use with the supplied parameter. + + The parameter of a parameterized test + + + + SequentialStrategy creates test cases by using all of the + parameter data sources in parallel, substituting null + when any of them run out of data. + + + + + Gets the test cases generated by the CombiningStrategy. + + The test cases. + + + + TestActionAfterCommand handles the AfterTest method of a single + TestActionItem, provided the items BeforeTest has been run. + + + + + Initializes a new instance of the class. + + The inner command. + The TestActionItem to run before the inner command. + + + + AfterCommand is a DelegatingTestCommand that performs some + specific action after the inner command is run. + + + + + Construct an AfterCommand + + + + + Execute the command + + + + + Set this to perform action after the inner command. + + + + + ContextSettingsCommand applies specified changes to the + TestExecutionContext prior to running a test. No special + action is needed after the test runs, since the prior + context will be restored automatically. + + + + + TestActionCommand handles a single ITestAction applied + to a test. It runs the BeforeTest method, then runs the + test and finally runs the AfterTest method. + + + + + Initializes a new instance of the class. + + The inner command. + + + + Runs the test, saving a TestResult in the supplied TestExecutionContext. + + The context in which the test should run. + A TestResult + + + + Perform the before test action + + + + + Perform the after test action + + + + + TestActionBeforeCommand handles the BeforeTest method of a single + TestActionItem, relying on the item to remember it has been run. + + + + + Initializes a new instance of the class. + + The inner command. + The TestActionItem to run before the inner command. + + + + BeforeTestCommand is a DelegatingTestCommand that performs some + specific action before the inner command is run. + + + + + Construct a BeforeCommand + + + + + Execute the command + + + + + Action to perform before the inner command. + + + + + ConstructFixtureCommand constructs the user test object if necessary. + + + + + Constructs a OneTimeSetUpCommand for a suite + + The inner command to which the command applies + + + + DelegatingTestCommand wraps an inner TestCommand. + Derived classes may do what they like before or + after running the inner command. + + + + TODO: Documentation needed for field + + + + TODO: Documentation needed for constructor + + + + + + OneTimeTearDownCommand performs any teardown actions + specified for a suite and calls Dispose on the user + test object, if any. + + + + + Construct a OneTimeTearDownCommand + + The command wrapped by this command + + + + EmptyTestCommand is a TestCommand that does nothing. It simply + returns the current result from the context when executed. We + use it to avoid testing for null when executing a chain of + DelegatingTestCommands. + + + + + Construct a NullCommand for a test + + + + + Execute the command + + + + + TODO: Documentation needed for class + + + + + Initializes a new instance of the class. + + The inner command. + The max time allowed in milliseconds + + + + OneTimeSetUpCommand runs any one-time setup methods for a suite, + constructing the user test object if necessary. + + + + + Constructs a OneTimeSetUpCommand for a suite + + The inner command to which the command applies + A SetUpTearDownList for use by the command + + + + OneTimeTearDownCommand performs any teardown actions + specified for a suite and calls Dispose on the user + test object, if any. + + + + + Construct a OneTimeTearDownCommand + + The command wrapped by this command + A SetUpTearDownList for use by the command + + + + SetUpTearDownCommand runs SetUp methods for a suite, + runs the test and then runs TearDown methods. + + + + + Initializes a new instance of the class. + + The inner command. + List of setup/teardown items + + + + SetUpTearDownItem holds the setup and teardown methods + for a single level of the inheritance hierarchy. + + + + + Construct a SetUpTearDownNode + + A list of setup methods for this level + A list teardown methods for this level + + + + Returns true if this level has any methods at all. + This flag is used to discard levels that do nothing. + + + + + Run SetUp on this level. + + The execution context to use for running. + + + + Run TearDown for this level. + + + + + + TODO: Documentation needed for class + + + + + Initializes a new instance of the class. + + The test being skipped. + + + + Overridden to simply set the CurrentResult to the + appropriate Skipped state. + + The execution context for the test + A TestResult + + + + TestActionCommand handles a single ITestAction applied + to a test. It runs the BeforeTest method, then runs the + test and finally runs the AfterTest method. + + + + + Initializes a new instance of the class. + + The inner command. + The TestAction with which to wrap the inner command. + + + + TestActionItem wraps a single execution of an ITestAction. + Its primary purpose is to track whether the BeforeTest + method has been called and suppress calling the + AfterTest method if it has not. This is necessary when + ITestActions are used before and after a CompositeWorkItem, + since the OneTimeSetUpCommand and OneTimeTearDownCommand + are separate command chains. By sharing a TestActionItem + between the setup and teardown chains, the two calls can + be coordinated. + + + + + Construct a TestActionItem + + The ITestAction to be included + + + + Get flag indicating if the BeforeTest entry was already called. + + + + + Run the BeforeTest method of the action and remember that it has been run. + + The test to which the action applies + + + + Run the AfterTest action, but only if the BeforeTest + action was actually run. + + The test to which the action applies + + + + TestCommand is the abstract base class for all test commands + in the framework. A TestCommand represents a single stage in + the execution of a test, e.g.: SetUp/TearDown, checking for + Timeout, verifying the returned result from a method, etc. + + TestCommands may decorate other test commands so that the + execution of a lower-level command is nested within that + of a higher level command. All nested commands are executed + synchronously, as a single unit. Scheduling test execution + on separate threads is handled at a higher level, using the + task dispatcher. + + + + + Construct a TestCommand for a test. + + The test to be executed + + + + Gets the test associated with this command. + + + + + Runs the test in a specified context, returning a TestResult. + + The TestExecutionContext to be used for running the test. + A TestResult + + + + TestMethodCommand is the lowest level concrete command + used to run actual test cases. + + + + + Initializes a new instance of the class. + + The test. + + + + Runs the test, saving a TestResult in the execution context, as + well as returning it. If the test has an expected result, it + is asserts on that value. Since failed tests and errors throw + an exception, this command must be wrapped in an outer command, + will handle that exception and records the failure. This role + is usually played by the SetUpTearDown command. + + The execution context + + + + TheoryResultCommand adjusts the result of a Theory so that + it fails if all the results were inconclusive. + + + + + Constructs a TheoryResultCommand + + The command to be wrapped by this one + + + + Provides methods to support consistent checking in constraints. + + + + + Requires that the provided object is actually of the type required. + + The object to verify. + Name of the parameter as passed into the checking method. + + If and can be null, returns null rather than throwing when is null. + If cannot be null, this parameter is ignored. + The type to require. + + + + CultureDetector is a helper class used by NUnit to determine + whether a test should be run based on the current culture. + + + + + Default constructor uses the current culture. + + + + + Construct a CultureDetector for a particular culture for testing. + + The culture to be used + + + + Test to determine if one of a collection of cultures + is being used currently. + + + + + + + Tests to determine if the current culture is supported + based on a culture attribute. + + The attribute to examine + + + + + Test to determine if the a particular culture or comma- + delimited set of cultures is in use. + + Name of the culture or comma-separated list of culture ids + True if the culture is in use on the system + + + + Return the last failure reason. Results are not + defined if called before IsSupported( Attribute ) + is called. + + + + + ExceptionHelper provides static methods for working with exceptions + + + + + Rethrows an exception, preserving its stack trace + + The exception to rethrow + + + + Builds up a message, using the Message field of the specified exception + as well as any InnerExceptions. Optionally excludes exception names, + creating a more readable message. + + The exception. + Flag indicating whether exception names should be excluded. + A combined message string. + + + + Builds up a message, using the Message field of the specified exception + as well as any InnerExceptions. + + The exception. + A combined stack trace. + + + + Gets the stack trace of the exception. If no stack trace + is provided, returns "No stack trace available". + + The exception. + A string representation of the stack trace. + + + + A CompositeWorkItem represents a test suite and + encapsulates the execution of the suite as well + as all its child tests. + + + + + List of Child WorkItems + + + + + Indicates whether this work item should use a separate dispatcher. + + + + + Construct a CompositeWorkItem for executing a test suite + using a filter to select child tests. + + The TestSuite to be executed + A filter used to select child tests + + + + Method that actually performs the work. Overridden + in CompositeWorkItem to do one-time setup, run all child + items and then dispatch the one-time teardown work item. + + + + + + + + + + Cancel (abort or stop) a CompositeWorkItem and all of its children + + true if the CompositeWorkItem and all of its children should be aborted, false if it should allow all currently running tests to complete + + + + OneTimeTearDownWorkItem represents the cleanup + and one-time teardown phase of a CompositeWorkItem + + + + + Construct a OneTimeTearDownWOrkItem wrapping a CompositeWorkItem + + The CompositeWorkItem being wrapped + + + + The WorkItem name, overridden to indicate this is the teardown. + + + + + The ExecutionStrategy for use in running this work item + + + + + + + + + + PerformWork is not used in CompositeWorkItem + + + + + EventListenerTextWriter sends text output to the currently active + ITestEventListener in the form of a TestOutput object. If no event + listener is active in the context, or if there is no context, + the output is forwarded to the supplied default writer. + + + + + Construct an EventListenerTextWriter + + The name of the stream to use for events + The default writer to use if no listener is available + + + + Get the Encoding for this TextWriter + + + + + Write formatted string + + + + + Write formatted string + + + + + Write formatted string + + + + + Write an object + + + + + Write a string + + + + + Write a decimal + + + + + Write a double + + + + + Write formatted string + + + + + Write a ulong + + + + + Write a long + + + + + Write a uint + + + + + Write an int + + + + + Write a char + + + + + Write a boolean + + + + + Write chars + + + + + Write chars + + + + + Write a float + + + + + Write a string with newline + + + + + Write an object with newline + + + + + Write formatted string with newline + + + + + Write formatted string with newline + + + + + Write formatted string with newline + + + + + Write a decimal with newline + + + + + Write a formatted string with newline + + + + + Write a double with newline + + + + + Write a uint with newline + + + + + Write a ulong with newline + + + + + Write a long with newline + + + + + Write an int with newline + + + + + Write a bool with newline + + + + + Write chars with newline + + + + + Write chars with newline + + + + + Write a char with newline + + + + + Write a float with newline + + + + + Write newline + + + + + The EventPumpState enum represents the state of an + EventPump. + + + + + The pump is stopped + + + + + The pump is pumping events with no stop requested + + + + + The pump is pumping events but a stop has been requested + + + + + EventPump pulls events out of an EventQueue and sends + them to a listener. It is used to send events back to + the client without using the CallContext of the test + runner thread. + + + + + The downstream listener to which we send events + + + + + The queue that holds our events + + + + + Thread to do the pumping + + + + + The current state of the event pump + + + + + Constructor + + The EventListener to receive events + The event queue to pull events from + + + + Gets or sets the current state of the pump + + + + + Gets or sets the name of this EventPump + (used only internally and for testing). + + + + + Dispose stops the pump + Disposes the used WaitHandle, too. + + + + + Start the pump + + + + + Tell the pump to stop after emptying the queue. + + + + + Our thread proc for removing items from the event + queue and sending them on. Note that this would + need to do more locking if any other thread were + removing events from the queue. + + + + + NUnit.Core.Event is the abstract base for all stored events. + An Event is the stored representation of a call to the + ITestListener interface and is used to record such calls + or to queue them for forwarding on another thread or at + a later time. + + + + + The Send method is implemented by derived classes to send the event to the specified listener. + + The listener. + + + + TestStartedEvent holds information needed to call the TestStarted method. + + + + + Initializes a new instance of the class. + + The test. + + + + Calls TestStarted on the specified listener. + + The listener. + + + + TestFinishedEvent holds information needed to call the TestFinished method. + + + + + Initializes a new instance of the class. + + The result. + + + + Calls TestFinished on the specified listener. + + The listener. + + + + TestOutputEvent holds information needed to call the TestOutput method. + + + + + Initializes a new instance of the class. + + The output object. + + + + Calls TestOutput on the specified listener. + + The listener. + + + + TestMessageEvent holds information needed to call the SendMessage method. + + + + + Initializes a new instance of the class. + + The test message object. + + + + Calls on the specified listener. + + The listener. + + + + Holds object for sending to all listeners + + + + + Implements a queue of work items each of which + is queued as a WaitCallback. + + + + + Gets the count of items in the queue. + + + + + Enqueues the specified event + + The event to enqueue. + + + + Removes the first element from the queue and returns it (or null). + + + If true and the queue is empty, the calling thread is blocked until + either an element is enqueued, or is called. + + + + + If the queue not empty + the first element. + + + otherwise, if ==false + or has been called + null. + + + + + + + Stop processing of the queue + + + + + An IWorkItemDispatcher handles execution of work items. + + + + + The level of parallelism supported. Zero if not supported. + + + + + Start execution, performing any initialization. Sets + the top level work item and dispatches it. + + + + + Dispatch a single work item for execution. The first + work item dispatched is saved as the top-level + work item and used when stopping the run. + + The item to dispatch + + + + Cancel the ongoing run completely. + If no run is in process, the call has no effect. + + true if the IWorkItemDispatcher should abort all currently running WorkItems, false if it should allow all currently running WorkItems to complete + + + + MainThreadWorkItemDispatcher handles execution of WorkItems by + directly executing them on the main thread. This is different + from the SimpleWorkItemDispatcher where the work item is dispatched + onto its own thread. + + + + + The level of parallelism supported + + + + + Start execution, dispatching the top level + work into the main thread. + + + + + Dispatch a single work item for execution by + executing it directly. + The item to dispatch + + + + + This method is not supported for + this dispatcher. Using it will throw a + NotSupportedException. + + Not used + If used, it will always throw this. + + + + Enumeration representing the strategy to follow in executing a work item. + The value is only relevant when running under the parallel dispatcher. + + + + + Run directly on same thread + + + + + Enqueue for parallel execution + + + + + Enqueue for non-parallel execution + + + + + ParallelWorkItemDispatcher handles execution of work items by + queuing them for worker threads to process. + + + + + Event raised whenever a shift is starting. + + + + + Event raised whenever a shift has ended. + + + + + Construct a ParallelWorkItemDispatcher + + Number of workers to use + + + + Number of parallel worker threads + + + + + Enumerates all the shifts supported by the dispatcher + + + + + Enumerates all the Queues supported by the dispatcher + + + + + Start execution, setting the top level work, + enqueuing it and starting a shift to execute it. + + + + + Dispatch a single work item for execution. The first + work item dispatched is saved as the top-level + work item and used when stopping the run. + + The item to dispatch + + + + Cancel the ongoing run completely. + If no run is in process, the call has no effect. + + + + + Save the state of the queues and create a new isolated set + + + + + Remove isolated queues and restore old ones + + + + + QueuingEventListener uses an EventQueue to store any + events received on its EventListener interface. + + + + + The EventQueue created and filled by this listener + + + + + Construct a QueuingEventListener + + + + + A test has started + + The test that is starting + + + + A test case finished + + Result of the test case + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + A SimpleWorkItem represents a single test case and is + marked as completed immediately upon execution. This + class is also used for skipped or ignored test suites. + + + + + Construct a simple work item for a test. + + The test to be executed + The filter used to select this test + + + + Method that performs actually performs the work. + + + + + Creates a test command for use in running this test. + + A TestCommand + + + + SimpleWorkItemDispatcher handles execution of WorkItems by + directly executing them. It is provided so that a dispatcher + is always available in the context, thereby simplifying the + code needed to run child tests. + + + + + The level of parallelism supported + + + + + Start execution, creating the execution thread, + setting the top level work and dispatching it. + + + + + Dispatch a single work item for execution by + executing it directly. + The item to dispatch + + + + + Cancel (abort or stop) the ongoing run. + If no run is in process, the call has no effect. + + true if the run should be aborted, false if it should allow its currently running test to complete + + + + A TestWorker pulls work items from a queue + and executes them. + + + + + Event handler for TestWorker events + + The TestWorker sending the event + The WorkItem that caused the event + + + + Event signaled immediately before executing a WorkItem + + + + + Event signaled immediately after executing a WorkItem + + + + + Construct a new TestWorker. + + The queue from which to pull work items + The name of this worker + + + + The WorkItemQueue from which this worker pulls WorkItems + + + + + The name of this worker - also used for the thread + + + + + Indicates whether the worker thread is running + + + + + Our ThreadProc, which pulls and runs tests in a loop + + + + + Create thread and start processing work items. + + + + + Stop the thread, either immediately or after finishing the current WorkItem + + true if the thread should be aborted, false if it should allow the currently running test to complete + + + + The TextCapture class intercepts console output and writes it + to the current execution context, if one is present on the thread. + If no execution context is found, the output is written to a + default destination, normally the original destination of the + intercepted output. + + + + + Construct a TextCapture object + + The default destination for non-intercepted output + + + + Gets the Encoding in use by this TextWriter + + + + + Writes a single character + + The char to write + + + + Writes a string + + The string to write + + + + Writes a string followed by a line terminator + + The string to write + + + + A WorkItem may be an individual test case, a fixture or + a higher level grouping of tests. All WorkItems inherit + from the abstract WorkItem class, which uses the template + pattern to allow derived classes to perform work in + whatever way is needed. + + A WorkItem is created with a particular TestExecutionContext + and is responsible for re-establishing that context in the + current thread before it begins or resumes execution. + + + + + Construct a WorkItem for a particular test. + + The test that the WorkItem will run + Filter used to include or exclude child items + + + + Construct a work Item that wraps another work Item. + Wrapper items are used to represent independently + dispatched tasks, which form part of the execution + of a single test, such as OneTimeTearDown. + + The WorkItem being wrapped + + + + Initialize the TestExecutionContext. This must be done + before executing the WorkItem. + + + Originally, the context was provided in the constructor + but delaying initialization of the context until the item + is about to be dispatched allows changes in the parent + context during OneTimeSetUp to be reflected in the child. + + The TestExecutionContext to use + + + + Event triggered when the item is complete + + + + + Gets the current state of the WorkItem + + + + + The test being executed by the work item + + + + + The name of the work item - defaults to the Test name. + + + + + Filter used to include or exclude child tests + + + + + The execution context + + + + + The worker executing this item. + + + + + The ParallelExecutionStrategy to use for this work item + + + + + Indicates whether this work item should use a separate dispatcher. + + + + + The test result + + + + + Gets the ParallelScope associated with the test, if any, + otherwise returning ParallelScope.Default; + + + + + Execute the current work item, including any + child work items. + + + + + Wait until the execution of this item is complete + + + + + Marks the WorkItem as NotRunnable. + + Reason for test being NotRunnable. + + + + Cancel (abort or stop) a WorkItem + + true if the WorkItem should be aborted, false if it should run to completion + + + + Standard Dispose + + + + + Method that performs actually performs the work. It should + set the State to WorkItemState.Complete when done. + + + + + Method called by the derived class when all work is complete + + + + + Builds the set up tear down list. + + Unsorted array of setup MethodInfos. + Unsorted array of teardown MethodInfos. + A list of SetUpTearDownItems + + + + Changes the result of the test, logging the old and new states + + The new ResultState + The new message + + + + WorkItemBuilder class knows how to build a tree of work items from a tree of tests + + + + + Creates a work item. + + The test for which this WorkItem is being created. + The filter to be used in selecting any child Tests. + True if child work items should be created and added. + + + + + Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. + + + A signed integer that indicates the relative values of and , as shown in the following table.Value Meaning Less than zero is less than .Zero equals .Greater than zero is greater than . + + The first object to compare.The second object to compare. + + + + WorkItemQueueState indicates the current state of a WorkItemQueue + + + + + The queue is paused + + + + + The queue is running + + + + + The queue is stopped + + + + + A WorkItemQueue holds work items that are ready to + be run, either initially or after some dependency + has been satisfied. + + + + + Initializes a new instance of the class. + + The name of the queue. + Flag indicating whether this is a parallel queue + + + + Gets the name of the work item queue. + + + + + Gets a flag indicating whether this queue is used for parallel execution + + + + + Gets the total number of items processed so far + + + + + Gets the current state of the queue + + + + + Get a bool indicating whether the queue is empty. + + + + + Enqueue a WorkItem to be processed + + The WorkItem to process + + + + Enqueue a WorkItem to be processed - internal for testing + + The WorkItem to process + The priority at which to process the item + + + + Dequeue a WorkItem for processing + + A WorkItem or null if the queue has stopped + + + + Start or restart processing of items from the queue + + + + + Signal the queue to stop + + + + + Pause the queue for restarting later + + + + + Save the current inner queue and create new ones for use by + a non-parallel fixture with parallel children. + + + + + Restore the inner queue that was previously saved + + + + + The current state of a work item + + + + + Ready to run or continue + + + + + Work Item is executing + + + + + Complete + + + + + Handler for ShiftChange events. + + The shift that is starting or ending. + + + + The dispatcher needs to do different things at different, + non-overlapped times. For example, non-parallel tests may + not be run at the same time as parallel tests. We model + this using the metaphor of a working shift. The WorkShift + class associates one or more WorkItemQueues with one or + more TestWorkers. + + Work in the queues is processed until all queues are empty + and all workers are idle. Both tests are needed because a + worker that is busy may end up adding more work to one of + the queues. At that point, the shift is over and another + shift may begin. This cycle continues until all the tests + have been run. + + + + + Construct a WorkShift + + + + + Event that fires when the shift has ended + + + + + The Name of this shift + + + + + Gets a flag indicating whether the shift is currently active + + + + + Gets a bool indicating whether this shift has any work to do + + + + + Gets a list of the queues associated with this shift. + + Internal for testing - immutable once initialized + + + + Gets the list of workers associated with this shift. + + Internal for testing - immutable once initialized + + + + Add a WorkItemQueue to the shift, starting it if the + shift is currently active. + + + + + Assign a worker to the shift. + + + + + + Start or restart processing for the shift + + + + + End the shift, pausing all queues and raising + the EndOfShift event. + + + + + Shut down the shift. + + + + + Cancel (abort or stop) the shift without completing all work + + true if the WorkShift should be aborted, false if it should allow its currently running tests to complete + + + + 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. + + + + + + + Gets or sets the maximum line length for this writer + + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a given + 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 result of the constraint that failed + + + + Gets the unique type name between expected and actual. + + The expected value + The actual value causing the failure + Output of the unique type name for expected + Output of the unique type name for actual + + + + 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 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 ConstraintResult for which the actual value is to be written + + + + Write the generic 'Actual' line for a given value + + The actual value causing a failure + + + + Combines multiple filters so that a test must pass all + of them in order to pass this filter. + + + + + Constructs an empty AndFilter + + + + + Constructs an AndFilter from an array of filters + + + + + + Checks whether the AndFilter is matched by a test + + The test to be matched + True if all the component filters pass, otherwise false + + + + Checks whether the AndFilter is matched by a test + + The test to be matched + True if all the component filters match, otherwise false + + + + Checks whether the AndFilter is explicit matched by a test. + + The test to be matched + True if all the component filters explicit match, otherwise false + + + + Gets the element name + + Element name + + + + CategoryFilter is able to select or exclude tests + based on their categories. + + + + + Construct a CategoryFilter using a single category name + + A category name + + + + Check whether the filter matches a test + + The test to be matched + + + + + Gets the element name + + Element name + + + + ClassName filter selects tests based on the class FullName + + + + + Construct a FullNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + A base class for multi-part filters + + + + + Constructs an empty CompositeFilter + + + + + Constructs a CompositeFilter from an array of filters + + + + + + Adds a filter to the list of filters + + The filter to be added + + + + Return a list of the composing filters. + + + + + Checks whether the CompositeFilter is matched by a test. + + The test to be matched + + + + Checks whether the CompositeFilter is matched by a test. + + The test to be matched + + + + Checks whether the CompositeFilter is explicit matched by a test. + + The test to be matched + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + FullName filter selects tests based on their FullName + + + + + Construct a FullNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + IdFilter selects tests based on their id + + + + + Construct an IdFilter for a single value + + The id the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + FullName filter selects tests based on their FullName + + + + + Construct a MethodNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + ClassName filter selects tests based on the class FullName + + + + + Construct a NamespaceFilter for a single namespace + + The namespace the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + NotFilter negates the operation of another filter + + + + + Construct a not filter on another filter + + The filter to be negated + + + + Gets the base filter + + + + + Determine if a particular test passes the filter criteria. The default + implementation checks the test itself, its parents and any descendants. + + Derived classes may override this method or any of the Match methods + to change the behavior of the filter. + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Check whether the filter matches a test + + The test to be matched + True if it matches, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Combines multiple filters so that a test must pass one + of them in order to pass this filter. + + + + + Constructs an empty OrFilter + + + + + Constructs an AndFilter from an array of filters + + + + + + Checks whether the OrFilter is matched by a test + + The test to be matched + True if any of the component filters pass, otherwise false + + + + Checks whether the OrFilter is matched by a test + + The test to be matched + True if any of the component filters match, otherwise false + + + + Checks whether the OrFilter is explicit matched by a test + + The test to be matched + True if any of the component filters explicit match, otherwise false + + + + Gets the element name + + Element name + + + + PropertyFilter is able to select or exclude tests + based on their properties. + + + + + Construct a PropertyFilter using a property name and expected value + + A property name + The expected value of the property + + + + Check whether the filter matches a test + + The test to be matched + + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + TestName filter selects tests based on their Name + + + + + Construct a TestNameFilter for a single name + + The name the filter will recognize. + + + + Match a test against a single value. + + + + + Gets the element name + + Element name + + + + ValueMatchFilter selects tests based on some value, which + is expected to be contained in the test. + + + + + Returns the value matched by the filter - used for testing + + + + + Indicates whether the value is a regular expression + + + + + Construct a ValueMatchFilter for a single value. + + The value to be included. + + + + Match the input provided by the derived class + + The value to be matchedT + True for a match, false otherwise. + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + Gets the element name + + Element name + + + + GenericMethodHelper is able to deduce the Type arguments for + a generic method from the actual arguments provided. + + + + + A special value, which is used to indicate that BestCommonType() method + was unable to find a common type for the specified arguments. + + + + + Construct a GenericMethodHelper for a method + + MethodInfo for the method to examine + + + + Return the type arguments for the method, deducing them + from the arguments actually provided. + + The arguments to the method + If successful, an array of type arguments. + + + + InvalidTestFixtureException is thrown when an appropriate test + fixture constructor using the provided arguments cannot be found. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + InvalidPlatformException is thrown when the platform name supplied + to a test is not recognized. + + + + + Instantiates a new instance of the class. + + + + + Instantiates a new instance of the class + + The message. + + + + Instantiates a new instance of the class + + The message. + The inner. + + + + Serialization constructor for the class + + + + + InvalidTestFixtureException is thrown when an appropriate test + fixture constructor using the provided arguments cannot be found. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + Interface for logging within the engine + + + + + Logs the specified message at the error level. + + The message. + + + + Logs the specified message at the error level. + + The message. + The arguments. + + + + Logs the specified message at the warning level. + + The message. + + + + Logs the specified message at the warning level. + + The message. + The arguments. + + + + Logs the specified message at the info level. + + The message. + + + + Logs the specified message at the info level. + + The message. + The arguments. + + + + Logs the specified message at the debug level. + + The message. + + + + Logs the specified message at the debug level. + + The message. + The arguments. + + + + InternalTrace provides facilities for tracing the execution + of the NUnit framework. Tests and classes under test may make use + of Console writes, System.Diagnostics.Trace or various loggers and + NUnit itself traps and processes each of them. For that reason, a + separate internal trace is needed. + + Note: + InternalTrace uses a global lock to allow multiple threads to write + trace messages. This can easily make it a bottleneck so it must be + used sparingly. Keep the trace Level as low as possible and only + insert InternalTrace writes where they are needed. + TODO: add some buffering and a separate writer thread as an option. + TODO: figure out a way to turn on trace in specific classes only. + + + + + Gets a flag indicating whether the InternalTrace is initialized + + + + + Initialize the internal trace facility using the name of the log + to be written to and the trace level. + + The log name + The trace level + + + + Initialize the internal trace using a provided TextWriter and level + + A TextWriter + The InternalTraceLevel + + + + Get a named Logger + + + + + + Get a logger named for a particular Type. + + + + + InternalTraceLevel is an enumeration controlling the + level of detailed presented in the internal log. + + + + + Use the default settings as specified by the user. + + + + + Do not display any trace messages + + + + + Display Error messages only + + + + + Display Warning level and higher messages + + + + + Display informational and higher messages + + + + + Display debug messages and higher - i.e. all messages + + + + + Display debug messages and higher - i.e. all messages + + + + + A trace listener that writes to a separate file per domain + and process using it. + + + + + Construct an InternalTraceWriter that writes to a file. + + Path to the file to use + + + + Construct an InternalTraceWriter that writes to a + TextWriter provided by the caller. + + + + + + Returns the character encoding in which the output is written. + + The character encoding in which the output is written. + + + + Writes a character to the text string or stream. + + The character to write to the text stream. + + + + Writes a string to the text string or stream. + + The string to write. + + + + Writes a string followed by a line terminator to the text string or stream. + + The string to write. If is null, only the line terminator is written. + + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Clears all buffers for the current writer and causes any buffered data to be written to the underlying device. + + + + + Provides internal logging to the NUnit framework + + + + + Initializes a new instance of the class. + + The name. + The log level. + The writer where logs are sent. + + + + Logs the message at error level. + + The message. + + + + Logs the message at error level. + + The message. + The message arguments. + + + + Logs the message at warm level. + + The message. + + + + Logs the message at warning level. + + The message. + The message arguments. + + + + Logs the message at info level. + + The message. + + + + Logs the message at info level. + + The message. + The message arguments. + + + + Logs the message at debug level. + + The message. + + + + Logs the message at debug level. + + The message. + The message arguments. + + + + The MethodWrapper class wraps a MethodInfo so that it may + be used in a platform-independent manner. + + + + + Construct a MethodWrapper for a Type and a MethodInfo. + + + + + Construct a MethodInfo for a given Type and method name. + + + + + Gets the Type from which this method was reflected. + + + + + Gets the MethodInfo for this method. + + + + + Gets the name of the method. + + + + + Gets a value indicating whether the method is abstract. + + + + + Gets a value indicating whether the method is public. + + + + + Gets a value indicating whether the method contains unassigned generic type parameters. + + + + + Gets a value indicating whether the method is a generic method. + + + + + Gets a value indicating whether the MethodInfo represents the definition of a generic method. + + + + + Gets the return Type of the method. + + + + + Gets the parameters of the method. + + + + + + Returns the Type arguments of a generic method or the Type parameters of a generic method definition. + + + + + Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo. + + The type arguments to be used + A new IMethodInfo with the type arguments replaced + + + + Returns an array of custom attributes of the specified type applied to this method + + + + + Gets a value indicating whether one or more attributes of the specified type are defined on the method. + + + + + Invokes the method, converting any TargetInvocationException to an NUnitException. + + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + Override ToString() so that error messages in NUnit's own tests make sense + + + + + Thrown when an assertion failed. Here to preserve the inner + exception and hence its stack trace. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The error message that explains + the reason for the exception + + + + Initializes a new instance of the class. + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Enables the syntax. + + + + + Wraps an action so that it is executed when the returned object is disposed. + This disposal is thread-safe and the action will be executed at most once. + + + + + OSPlatform represents a particular operating system platform + + + + + Platform ID for Unix as defined by Microsoft .NET 2.0 and greater + + + + + Platform ID for Unix as defined by Mono + + + + + Platform ID for XBox as defined by .NET and Mono + + + + + Platform ID for MacOSX as defined by .NET and Mono + + + + + Get the OSPlatform under which we are currently running + + + + + Gets the actual OS Version, not the incorrect value that might be + returned for Win 8.1 and Win 10 + + + If an application is not manifested as Windows 8.1 or Windows 10, + the version returned from Environment.OSVersion will not be 6.3 and 10.0 + respectively, but will be 6.2 and 6.3. The correct value can be found in + the registry. + + The original version + The correct OS version + + + + Product Type Enumeration used for Windows + + + + + Product type is unknown or unspecified + + + + + Product type is Workstation + + + + + Product type is Domain Controller + + + + + Product type is Server + + + + + Construct from a platform ID and version + + + + + Construct from a platform ID, version and product type + + + + + Get the platform ID of this instance + + + + + Implemented to use in place of Environment.OSVersion.ToString() + + A representation of the platform ID and version in an approximation of the format used by Environment.OSVersion.ToString() + + + + Get the Version of this instance + + + + + Get the Product Type of this instance + + + + + Return true if this is a windows platform + + + + + Return true if this is a Unix or Linux platform + + + + + Return true if the platform is Win32S + + + + + Return true if the platform is Win32Windows + + + + + Return true if the platform is Win32NT + + + + + Return true if the platform is Windows CE + + + + + Return true if the platform is Xbox + + + + + Return true if the platform is MacOSX + + + + + Return true if the platform is Windows 95 + + + + + Return true if the platform is Windows 98 + + + + + Return true if the platform is Windows ME + + + + + Return true if the platform is NT 3 + + + + + Return true if the platform is NT 4 + + + + + Return true if the platform is NT 5 + + + + + Return true if the platform is Windows 2000 + + + + + Return true if the platform is Windows XP + + + + + Return true if the platform is Windows 2003 Server + + + + + Return true if the platform is NT 6 + + + + + Return true if the platform is NT 6.0 + + + + + Return true if the platform is NT 6.1 + + + + + Return true if the platform is NT 6.2 + + + + + Return true if the platform is NT 6.3 + + + + + Return true if the platform is Vista + + + + + Return true if the platform is Windows 2008 Server (original or R2) + + + + + Return true if the platform is Windows 2008 Server (original) + + + + + Return true if the platform is Windows 2008 Server R2 + + + + + Return true if the platform is Windows 2012 Server (original or R2) + + + + + Return true if the platform is Windows 2012 Server (original) + + + + + Return true if the platform is Windows 2012 Server R2 + + + + + Return true if the platform is Windows 7 + + + + + Return true if the platform is Windows 8 + + + + + Return true if the platform is Windows 8.1 + + + + + Return true if the platform is Windows 10 + + + + + Return true if the platform is Windows Server. This is named Windows + Server 10 to distinguish it from previous versions of Windows Server. + + + + + + Examines an attribute argument and tries to simulate what that value would have been if the literal syntax + which might have defined the value in C# had instead been used as an argument to a given method parameter in a direct call. + + + For example, since you can’t apply attributes using arguments, we allow the C# syntax + 10 ( value) or 0.1 ( value) to be specified. + NUnit then converts it to match the method’s parameters, just as if you were actually + using the syntax TestMethod(10) or TestMethod(0.1). + + + For another example, you might have written the syntax 10 and picked up the attribute + constructor overload; however, the test method for which this value is intended only has a + signature. Again, NUnit simulates what would have happened if the inferred C# syntax was transplanted + and you were actually using the syntax TestMethod(10). + + + + + + Converts an array of objects to the , if it is supported. + + + + + Converts a single value to the , if it is supported. + + + + + Converts a single value to the , if it is supported. + + + + + The ParameterWrapper class wraps a ParameterInfo so that it may + be used in a platform-independent manner. + + + + + Construct a ParameterWrapper for a given method and parameter + + + + + + + Gets a value indicating whether the parameter is optional + + + + + Gets an IMethodInfo representing the method for which this is a parameter. + + + + + Gets the underlying ParameterInfo + + + + + Gets the Type of the parameter + + + + + Returns an array of custom attributes of the specified type applied to this method + + + + + Gets a value indicating whether one or more attributes of the specified type are defined on the parameter. + + + + + PlatformHelper class is used by the PlatformAttribute class to + determine whether a platform is supported. + + + + + Comma-delimited list of all supported OS platform constants + + + + + Comma-delimited list of all supported Runtime platform constants + + + + + Default constructor uses the operating system and + common language runtime of the system. + + + + + Construct a PlatformHelper for a particular operating + system and common language runtime. Used in testing. + + RuntimeFramework to be used + OperatingSystem to be used + + + + Test to determine if one of a collection of platforms + is being used currently. + + + + + + + Tests to determine if the current platform is supported + based on a platform attribute. + + The attribute to examine + + + + + Tests to determine if the current platform is supported + based on a platform attribute. + + The attribute to examine + + + + + Test to determine if a particular platform or comma-delimited set of platforms is in use. + + Name of the platform or comma-separated list of platform ids + True if the platform is in use on the system + + + + Return the last failure reason. Results are not + defined if called before IsSupported( Attribute ) + is called. + + + + + Implements a simplified filter for use in deciding which + Types and Methods should be used to generate tests. It is consructed with a + list of strings, each of which may end up being interpreted in various ways. + + + + + Return a new PreFilter, without elements, which is considered + empty and always matches. + + + + + Return true if the filter is empty, in which case it + always succeeds. Technically, this is just a filter and + you can add elements but it's best to use Empty when + you need an empty filter and new when you plan to add. + + + + + Add a new filter element to the filter + + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + Use the filter on a Type, returning true if the type matches the filter + and should therefore be included in the discovery process. + + + + + A PropertyBag represents a collection of name value pairs + that allows duplicate entries with the same key. Methods + are provided for adding a new pair as well as for setting + a key to a single value. All keys are strings but values + may be of any type. Null values are not permitted, since + a null entry represents the absence of the key. + + + + + Adds a key/value pair to the property set + + The key + The value + + + + Sets the value for a key, removing any other + values that are already in the property set. + + + + + + + Gets a single value for a key, using the first + one if multiple values are present and returning + null if the value is not found. + + + + + + + Gets a flag indicating whether the specified key has + any entries in the property set. + + The key to be checked + + True if their are values present, otherwise false + + + + + Gets a collection containing all the keys in the property set + + + + + + Gets or sets the list of values for a particular key + + + + + Returns an XmlNode representing the current PropertyBag. + + Not used + An XmlNode representing the PropertyBag + + + + Returns an XmlNode representing the PropertyBag after + adding it as a child of the supplied parent node. + + The parent node. + Not used + + + + + The PropertyNames class provides static constants for the + standard property ids that NUnit uses on tests. + + + + + The FriendlyName of the AppDomain in which the assembly is running + + + + + The selected strategy for joining parameter data into test cases + + + + + The process ID of the executing assembly + + + + + The stack trace from any data provider that threw + an exception. + + + + + The reason a test was not run + + + + + The author of the tests + + + + + The ApartmentState required for running the test + + + + + The categories applying to a test + + + + + The Description of a test + + + + + The number of threads to be used in running tests + + + + + The maximum time in ms, above which the test is considered to have failed + + + + + The ParallelScope associated with a test + + + + + The number of times the test should be repeated + + + + + Indicates that the test should be run on a separate thread + + + + + The culture to be set for a test + + + + + The UI culture to be set for a test + + + + + The type that is under test + + + + + The timeout value for the test + + + + + The test will be ignored until the given date + + + + + The optional Order the test will run in + + + + + Randomizer returns a set of random values in a repeatable + way, to allow re-running of tests if necessary. It extends + the .NET Random class, providing random values for a much + wider range of types. + + The class is used internally by the framework to generate + test case data and is also exposed for use by users through + the TestContext.Random property. + + + For consistency with the underlying Random Type, methods + returning a single value use the prefix "Next..." Those + without an argument return a non-negative value up to + the full positive range of the Type. Overloads are provided + for specifying a maximum or a range. Methods that return + arrays or strings use the prefix "Get..." to avoid + confusion with the single-value methods. + + + + + Initial seed used to create randomizers for this run + + + + + 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. + + + + + Create a new Randomizer using the next seed + available to ensure that each randomizer gives + a unique sequence of values. + + + + + + Default constructor + + + + + Construct based on seed value + + + + + + Returns a random unsigned int. + + + + + Returns a random unsigned int less than the specified maximum. + + + + + Returns a random unsigned int within a specified range. + + + + + Returns a non-negative random short. + + + + + Returns a non-negative random short less than the specified maximum. + + + + + Returns a non-negative random short within a specified range. + + + + + Returns a random unsigned short. + + + + + Returns a random unsigned short less than the specified maximum. + + + + + Returns a random unsigned short within a specified range. + + + + + Returns a random long. + + + + + Returns a random long less than the specified maximum. + + + + + Returns a non-negative random long within a specified range. + + + + + Returns a random ulong. + + + + + Returns a random ulong less than the specified maximum. + + + + + Returns a non-negative random long within a specified range. + + + + + Returns a random Byte + + + + + Returns a random Byte less than the specified maximum. + + + + + Returns a random Byte within a specified range + + + + + Returns a random SByte + + + + + Returns a random sbyte less than the specified maximum. + + + + + Returns a random sbyte within a specified range + + + + + Returns a random bool + + + + + Returns a random bool based on the probability a true result + + + + + Returns a random double between 0.0 and the specified maximum. + + + + + Returns a random double within a specified range. + + + + + Returns a random float. + + + + + Returns a random float between 0.0 and the specified maximum. + + + + + Returns a random float within a specified range. + + + + + Returns a random enum value of the specified Type as an object. + + + + + Returns a random enum value of the specified Type. + + + + + Default characters for random functions. + + Default characters are the English alphabet (uppercase & lowercase), Arabic numerals, and underscore + + + + Generate a random string based on the characters from the input string. + + desired length of output string. + string representing the set of characters from which to construct the resulting string + A random string of arbitrary length + + + + Generate a random string based on the characters from the input string. + + desired length of output string. + A random string of arbitrary length + Uses DefaultStringChars as the input character set + + + + Generate a random string based on the characters from the input string. + + A random string of the default length + Uses DefaultStringChars as the input character set + + + + Returns a random decimal. + + + + + Returns a random decimal between positive zero and the specified maximum. + + + + + Returns a random decimal within a specified range, which is not + permitted to exceed decimal.MaxVal in the current implementation. + + + A limitation of this implementation is that the range from min + to max must not exceed decimal.MaxVal. + + + + + Generates a valid version 4 . + + + + + Helper methods for inspecting a type by reflection. + + Many of these methods take ICustomAttributeProvider as an + argument to avoid duplication, even though certain attributes can + only appear on specific types of members, like MethodInfo or Type. + + In the case where a type is being examined for the presence of + an attribute, interface or named member, the Reflect methods + operate with the full name of the member being sought. This + removes the necessity of the caller having a reference to the + assembly that defines the item being sought and allows the + NUnit core to inspect assemblies that reference an older + version of the NUnit framework. + + + + + Examine a fixture type and return an array of methods having a + particular attribute. The array is order with base methods first. + + The type to examine + The attribute Type to look for + Specifies whether to search the fixture type inheritance chain + The array of methods found + + + + Examine a fixture type and return true if it has a method with + a particular attribute. + + The type to examine + The attribute Type to look for + True if found, otherwise false + + + + Invoke the default constructor on a Type + + The Type to be constructed + An instance of the Type + + + + Invoke a constructor on a Type with arguments + + The Type to be constructed + Arguments to the constructor + An instance of the Type + + + + Returns an array of types from an array of objects. + Differs from by returning + for null elements rather than throwing . + + + + + Gets the constructors to which the specified argument types can be coerced. + + + + + Determines if the given types can be coerced to match the given parameters. + + + + + Determines whether the current type can be implicitly converted to the specified type. + + + + + Invoke a parameterless method returning void on an object. + + A MethodInfo for the method to be invoked + The object on which to invoke the method + + + + Invoke a method, converting any TargetInvocationException to an NUnitException. + + A MethodInfo for the method to be invoked + The object on which to invoke the method + The argument list for the method + The return value from the invoked method + + + + + Selects the ultimate shadowing property just like would, + rather than throwing + for properties that shadow properties of a different property type + which is what does. + + + If you request both public and nonpublic properties, every public property is preferred + over every nonpublic property. It would violate the principle of least surprise for a + derived class’s implementation detail to be chosen over the public API for a type. + + + See . + See . + See . + + + + Represents the result of running a single test case. + + + + + Construct a TestCaseResult based on a TestMethod + + A TestMethod to which the result applies. + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + The TestResult class represents the result of a test. + + + + + Error message for when child tests have errors + + + + + Error message for when child tests have warnings + + + + + Error message for when child tests are ignored + + + + + The minimum duration for tests + + + + + Aggregate assertion count + + + + + ReaderWriterLock + + + + + Construct a test result given a Test + + The test to be used + + + + Gets the test with which this result is associated. + + + + + Gets the ResultState of the test result, which + indicates the success or failure of the test. + + + + + Gets the name of the test result + + + + + Gets the full name of the test result + + + + + Gets or sets the elapsed time for running the test in seconds + + + + + Gets or sets the time the test started running. + + + + + Gets or sets the time the test finished running. + + + + + Adds a test attachment to the test result + + The TestAttachment object to attach + + + + Gets the collection of files attached to the test + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + + Gets or sets the count of asserts executed + when running the test. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + Gets a TextWriter, which will write output to be included in the result. + + + + + Gets any text output written to this result. + + + + + Gets a list of assertion results associated with the test. + + + + + Returns the XML representation of the result. + + If true, descendant results are included + An XmlNode representing the result + + + + Adds the XML representation of the result as a child of the + supplied parent node.. + + The parent node. + If true, descendant results are included + + + + + Gets a count of pending failures (from Multiple Assert) + + + + + Gets the worst assertion status (highest enum) in all the assertion results + + + + + Set the result of the test + + The ResultState to use in the result + + + + Set the result of the test + + The ResultState to use in the result + A message associated with the result state + + + + Set the result of the test + + The ResultState to use in the result + A message associated with the result state + Stack trace giving the location of the command + + + + Set the test result based on the type of exception thrown + + The exception that was thrown + + + + Set the test result based on the type of exception thrown + + The exception that was thrown + The FailureSite to use in the result + + + + RecordTearDownException appends the message and stack trace + from an exception arising during teardown of the test + to any previously recorded information, so that any + earlier failure information is not lost. Note that + calling Assert.Ignore, Assert.Inconclusive, etc. during + teardown is treated as an error. If the current result + represents a suite, it may show a teardown error even + though all contained tests passed. + + The Exception to be recorded + + + + Update overall test result, including legacy Message, based + on AssertionResults that have been saved to this point. + + + + + Record an assertion result + + + + + Record an assertion result + + + + + Record an assertion result + + + + + Creates a failure message incorporating failures + from a Multiple Assert block for use by runners + that don't know about AssertionResults. + + Message as a string + + + + Adds a reason element to a node and returns it. + + The target node. + The new reason element. + + + + Adds a failure element to a node and returns it. + + The target node. + The new failure element. + + + + Adds an attachments element to a node and returns it. + + The target node. + The new attachments element. + + + + Represents the result of running a test suite + + + + + Construct a TestSuiteResult base on a TestSuite + + The TestSuite to which the result applies + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + Indicates whether this result has any child results. + + + + + Gets the collection of child results. + + + + + Adds a child result to this result, setting this result's + ResultState to Failure if the child result failed. + + The result to be added + + + + Enumeration identifying a common language + runtime implementation. + + + + Any supported runtime framework + + + Microsoft .NET Framework + + + Microsoft Shared Source CLI + + + Mono + + + MonoTouch + + + Microsoft .NET Core + + + + RuntimeFramework represents a particular version + of a common language runtime implementation. + + + + + DefaultVersion is an empty Version, used to indicate that + NUnit should select the CLR version to use for the test. + + + + + Construct from a runtime type and version. If the version has + two parts, it is taken as a framework version. If it has three + or more, it is taken as a CLR version. In either case, the other + version is deduced based on the runtime type and provided version. + + The runtime type of the framework + The version of the framework + + + + Static method to return a RuntimeFramework object + for the framework that is currently in use. + + + + + The type of this runtime framework + + + + + The framework version for this runtime framework + + + + + The CLR version for this runtime framework + + + + + Return true if any CLR version may be used in + matching this RuntimeFramework object. + + + + + Returns the Display name for this framework + + + + + Parses a string representing a RuntimeFramework. + The string may be just a RuntimeType name or just + a Version or a hyphenated RuntimeType-Version or + a Version prefixed by 'versionString'. + + + + + + + Overridden to return the short name of the framework + + + + + + Returns true if the current framework matches the + one supplied as an argument. Two frameworks match + if their runtime types are the same or either one + is RuntimeType.Any and all specified version components + are equal. Negative (i.e. unspecified) version + components are ignored. + + The RuntimeFramework to be matched. + True on match, otherwise false + + + + Holds thread state which is captured and restored in order to sandbox user code. + + + + + Captures a snapshot of the tracked state of the current thread to be restored later. + + + + + Restores the tracked state of the current thread to the previously captured state. + + + + + Returns a copy with the specified culture. + + + + + Returns a copy with the specified UI culture. + + + + + Returns a copy with the specified principal. + + + + + May be called from any thread. + + + + + May be called from any thread. + + + + + May be called from any thread. + + + + + May be called from any thread, but may only be called once. + + + + + StackFilter class is used to remove internal NUnit + entries from a stack trace so that the resulting + trace provides better information about the test. + + + + + Single instance of our default filter + + + + + Construct a stack filter instance + + Regex pattern used to delete lines from the top of the stack + Regex pattern used to delete lines from the bottom of the stack + + + + Construct a stack filter instance + + Regex pattern used to delete lines from the top of the stack + + + + Construct a stack filter instance + + + + + Filters a raw stack trace and returns the result. + + The original stack trace + A filtered stack trace + + + + Provides methods to support legacy string comparison methods. + + + + + Compares two strings for equality, ignoring case if requested. + + The first string. + The second string.. + if set to true, the case of the letters in the strings is ignored. + Zero if the strings are equivalent, a negative number if strA is sorted first, a positive number if + strB is sorted first + + + + Compares two strings for equality, ignoring case if requested. + + The first string. + The second string.. + if set to true, the case of the letters in the strings is ignored. + True if the strings are equivalent, false if not. + + + + The TestCaseParameters class encapsulates method arguments and + other selected parameters needed for constructing + a parameterized test case. + + + + + The expected result to be returned + + + + + Default Constructor creates an empty parameter set + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a ParameterSet from an object implementing ITestCaseData + + + + + + The expected result of the test, which + must match the method return type. + + + + + Gets a value indicating whether an expected result was specified. + + + + + TestCaseTimeoutException is thrown when a test running directly + on a TestWorker thread is cancelled due to timeout. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Serialization Constructor + + + + + Helper class used to save and restore certain static or + singleton settings in the environment that affect tests + or which might be changed by the user tests. + + + + + Link to a prior saved context + + + + + Indicates that a stop has been requested + + + + + The event listener currently receiving notifications + + + + + The number of assertions for the current test + + + + + The current test result + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + An existing instance of TestExecutionContext. + + + + Gets and sets the current context. + + + + + Gets or sets the current test + + + + + The time the current test started execution + + + + + The time the current test started in Ticks + + + + + Gets or sets the current test result + + + + + Gets a TextWriter that will send output to the current test result. + + + + + The current test object - that is the user fixture + object on which tests are being executed. + + + + + Get or set indicator that run should stop on the first error + + + + + Gets an enum indicating whether a stop has been requested. + + + + + The current test event listener + + + + + The current WorkItemDispatcher. Made public for + use by nunitlite.tests + + + + + The ParallelScope to be used by tests running in this context. + For builds with out the parallel feature, it has no effect. + + + + + Default tolerance value used for floating point equality + when no other tolerance is specified. + + + + + The worker that spawned the context. + For builds without the parallel feature, it is null. + + + + + Gets the RandomGenerator specific to this Test + + + + + Gets the assert count. + + The assert count. + + + + The current nesting level of multiple assert blocks + + + + + Gets or sets the test case timeout value + + + + + Gets a list of ITestActions set by upstream tests + + + + + Saves or restores the CurrentCulture + + + + + Saves or restores the CurrentUICulture + + + + + Gets or sets the current for the Thread. + + + + + The current head of the ValueFormatter chain, copied from MsgUtils.ValueFormatter + + + + + If true, all tests must run on the same thread. No new thread may be spawned. + + + + + The number of times the current test has been scheduled for execution. + Currently only being executed in a test using the + + + + + Record any changes in the environment made by + the test code in the execution context so it + will be passed on to lower level tests. + + + + + Set up the execution environment to match a context. + Note that we may be running on the same thread where the + context was initially created or on a different thread. + + + + + Increments the assert count by one. + + + + + Increments the assert count by a specified amount. + + + + + Adds a new ValueFormatterFactory to the chain of formatters + + The new factory + + + + Sends a message from test to listeners. This message is not kind of test output and doesn't go to test result. + + A name recognized by the intended listeners. + A message to be sent + + + + Obtain lifetime service object + + + + + + An IsolatedContext is used when running code + that may effect the current result in ways that + should not impact the final result of the test. + A new TestExecutionContext is created with an + initially clear result, which is discarded on + exiting the context. + + + using (new TestExecutionContext.IsolatedContext()) + { + // Code that should not impact the result + } + + + + + Save the original current TestExecutionContext and + make a new isolated context current. + + + + + Restore the original TestExecutionContext. + + + + + An AdhocTestExecutionContext is created whenever a context is needed + but not available in CurrentContext. This happens when tests are run + on an ad-hoc basis or Asserts are used outside of tests. + + + + + Construct an AdhocTestExecutionContext, which is used + whenever the current TestExecutionContext is found to be null. + + + + + Enumeration indicating whether the tests are + running normally or being cancelled. + + + + + Running normally with no stop requested + + + + + A graceful stop has been requested + + + + + A forced stop has been requested + + + + + Interface to be implemented by filters applied to tests. + The filter applies when running the test, after it has been + loaded, since this is the only time an ITest exists. + + + + + Unique Empty filter. + + + + + Indicates whether this is the EmptyFilter + + + + + Indicates whether this is a top-level filter, + not contained in any other filter. + + + + + Determine if a particular test passes the filter criteria. The default + implementation checks the test itself, its parents and any descendants. + + Derived classes may override this method or any of the Match methods + to change the behavior of the filter. + + The test to which the filter is applied + True if the test passes the filter, otherwise false + + + + Determine if a test matches the filter explicitly. That is, it must + be a direct match of the test itself or one of its children. + + The test to which the filter is applied + True if the test matches the filter explicitly, otherwise false + + + + Determine whether the test itself matches the filter criteria, without + examining either parents or descendants. This is overridden by each + different type of filter to perform the necessary tests. + + The test to which the filter is applied + True if the filter matches the any parent of the test + + + + Determine whether any ancestor of the test matches the filter criteria + + The test to which the filter is applied + True if the filter matches the an ancestor of the test + + + + Determine whether any descendant of the test matches the filter criteria. + + The test to be matched + True if at least one descendant matches the filter criteria + + + + Create a TestFilter instance from an XML representation. + + + + + Create a TestFilter from its TNode representation + + + + + Nested class provides an empty filter - one that always + returns true when called. It never matches explicitly. + + + + + Adds an XML node + + True if recursive + The added XML node + + + + Adds an XML node + + Parent node + True if recursive + The added XML node + + + + The TestCaseParameters class encapsulates method arguments and + other selected parameters needed for constructing + a parameterized test case. + + + + + Default Constructor creates an empty parameter set + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a ParameterSet from an object implementing ITestCaseData + + + + + + Type arguments used to create a generic fixture instance + + + + + TestListener provides an implementation of ITestListener that + does nothing. It is used only through its NULL property. + + + + + Called when a test has just started + + The test that is starting + + + + Called when a test case has finished + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the message to send + + + + Construct a new TestListener - private so it may not be used. + + + + + Get a listener that does nothing + + + + + TestNameGenerator is able to create test names according to + a coded pattern. + + + + + Default pattern used to generate names + + + + + Construct a TestNameGenerator + + + + + Construct a TestNameGenerator + + The pattern used by this generator. + + + + Get the display name for a TestMethod and its arguments + + A TestMethod + The display name + + + + Get the display name for a TestMethod and its arguments + + A TestMethod + Arguments to be used + The display name + + + + TestParameters is the abstract base class for all classes + that know how to provide data for constructing a test. + + + + + Default Constructor creates an empty parameter set + + + + + Construct a parameter set with a list of arguments + + + + + + Construct a non-runnable ParameterSet, specifying + the provider exception that made it invalid. + + + + + Construct a ParameterSet from an object implementing ITestData + + + + + + The RunState for this set of parameters. + + + + + The arguments to be used in running the test, + which must match the method signature. + + + + + A name to be used for this test case in lieu + of the standard generated name containing + the argument list. + + + + + Gets the property dictionary for this test + + + + + Applies ParameterSet values to the test itself. + + A test. + + + + The original arguments provided by the user, + used for display purposes. + + + + + The list of display names to use as the parameters in the test name. + + + + + TestProgressReporter translates ITestListener events into + the async callbacks that are used to inform the client + software about the progress of a test run. + + + + + Initializes a new instance of the class. + + The callback handler to be used for reporting progress. + + + + Called when a test has just started + + The test that is starting + + + + Called when a test has finished. Sends a result summary to the callback. + to + + The result of the test + + + + Called when a test produces output for immediate display + + A TestOutput object containing the text to display + + + + Called when a test produces a message to be sent to listeners + + A object containing the text to send + + + + Returns the parent test item for the target test item if it exists + + + parent test item + + + + Makes a string safe for use as an attribute, replacing + characters that can't be used with their + corresponding XML representations. + + The string to be used + A new string with the values replaced + + + + ParameterizedFixtureSuite serves as a container for the set of test + fixtures created from a given Type using various parameters. + + + + + Initializes a new instance of the class. + + The ITypeInfo for the type that represents the suite. + + + + Gets a string representing the type of test + + + + + ParameterizedMethodSuite holds a collection of individual + TestMethods with their arguments applied. + + + + + Initializes a new instance of the class. + + + + + Gets a string representing the type of test + + + + + SetUpFixture extends TestSuite and supports + Setup and TearDown methods. + + + + + Initializes a new instance of the class. + + + + + The Test abstract class represents a test within the framework. + + + + + Static value to seed ids. It's started at 1000 so any + uninitialized ids will stand out. + + + + + Used to cache the declaring type for this MethodInfo + + + + + Method property backing field + + + + + Constructs a test given its name + + The name of the test + + + + Constructs a test given the path through the + test hierarchy to its parent and a name. + + The parent tests full name + The name of the test + + + + Constructs a test for a specific type. + + + + + Constructs a test for a specific method. + + + + + Gets or sets the id of the test + + + + + + Gets or sets the name of the test + + + + + Gets or sets the fully qualified name of the test + + + + + + Gets the name of the class where this test was declared. + Returns null if the test is not associated with a class. + + + + + Gets the name of the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + The arguments to use in creating the test or empty array if none required. + + + + + Gets the TypeInfo of the fixture used in running this test + or null if no fixture type is associated with it. + + + + + Gets a MethodInfo for the method implementing this test. + Returns null if the test is not implemented as a method. + + + + + Whether or not the test should be run + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Gets a string representing the type of test. Used as an attribute + value in the XML representation of a test and has no other + function in the framework. + + + + + Gets a count of test cases represented by + or contained under this test. + + + + + Gets the properties for this test + + + + + Returns true if this is a TestSuite + + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets the parent as a Test object. + Used by the core to set the parent. + + + + + Gets this test's child tests + + A list of child tests + + + + Gets or sets a fixture object for running this test. + + + + + Static prefix used for ids in this AppDomain. + Set by FrameworkController. + + + + + Gets or Sets the Int value representing the seed for the RandomGenerator + + + + + + The SetUp methods. + + + + + The teardown methods + + + + + Creates a TestResult for this test. + + A TestResult suitable for this type of test. + + + + Modify a newly constructed test by applying any of NUnit's common + attributes, based on a supplied , which is + usually the reflection element from which the test was constructed, + but may not be in some instances. The attributes retrieved are + saved for use in subsequent operations. + + + + + Mark the test as Invalid (not runnable) specifying a reason + + The reason the test is not runnable + + + + Get custom attributes applied to a test + + + + + Add standard attributes and members to a test node. + + + + + + + Returns the XML representation of the test + + If true, include child tests recursively + + + + + Returns an XmlNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Compares this test to another test for sorting purposes + + The other test + Value of -1, 0 or +1 depending on whether the current test is less than, equal to or greater than the other test + + + + TestAssembly is a TestSuite that represents the execution + of tests in a managed assembly. + + + + + Initializes a new instance of the class + specifying the Assembly and the suite name. + + The assembly this test represents. + The desired name for the test suite. + + + + Initializes a new instance of the class + specifying the suite name for an assembly that could not be loaded. + + The desired name for the test suite. + + + + Copy-constructor style to create a filtered copy of the test assemblies + test cases + + + + + + + Gets the Assembly represented by this instance. + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Get custom attributes specified on the assembly + + + + + TestFixture is a surrogate for a user test fixture class, + containing one or more tests. + + + + + Initializes a new instance of the class. + + Type of the fixture. + Arguments used to instantiate the test fixture, or null if none used + + + + The TestMethod class represents a Test implemented as a method. + + + + + The ParameterSet used to create this test method + + + + + Initializes a new instance of the class. + + The method to be used as a test. + + + + Initializes a new instance of the class. + + The method to be used as a test. + The suite or fixture to which the new test will be added + + + + The arguments to use in executing the test method, or empty array if none are provided. + + + + + Overridden to return a TestCaseResult. + + A TestResult for this test. + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Returns a TNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Gets this test's child tests + + A list of child tests + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Returns the name of the method + + + + + TestSuite represents a composite test, which contains other tests. + + + + + Our collection of child tests + + + + + Initializes a new instance of the class. + + The name of the suite. + + + + Initializes a new instance of the class. + + Name of the parent suite. + The name of the suite. + + + + Initializes a new instance of the class. + + Type of the fixture. + Arguments used to instantiate the test fixture, or null if none used. + + + + Initializes a new instance of the class. + + Type of the fixture. + + + + Copy constructor style to create a filtered copy of the given test suite + + Test Suite to copy + Filter to be applied + + + + Sorts tests under this suite. + + + + + Adds a test to the suite. + + The test. + + + + Gets this test's child tests + + The list of child tests + + + + Gets a count of test cases represented by + or contained under this test. + + + + + + The arguments to use in creating the fixture, or empty array if none are provided. + + + + + Set to true to suppress sorting this suite's contents + + + + + OneTimeSetUp methods for this suite + + + + + OneTimeTearDown methods for this suite + + + + + Overridden to return a TestSuiteResult. + + A TestResult for this test. + + + + Gets a bool indicating whether the current test + has any descendant tests. + + + + + Gets the name used for the top-level element in the + XML representation of this test + + + + + Returns an XmlNode representing the current result after + adding it as a child of the supplied parent node. + + The parent node. + If true, descendant results are included + + + + + Check that setup and teardown methods marked by certain attributes + meet NUnit's requirements and mark the tests not runnable otherwise. + + A list of methodinfos to check + + + + ThreadUtility provides a set of static methods convenient + for working with threads. + + + + + TypeHelper provides static methods that operate on Types. + + + + + Gets the display name for a Type as used by NUnit. + + The Type for which a display name is needed. + The display name for the Type + + + + Gets the display name for a Type as used by NUnit. + + The Type for which a display name is needed. + The arglist provided. + The display name for the Type + + + + Returns the best fit for a common type to be used in + matching actual arguments to a methods Type parameters. + + + + + Determines whether the specified type is numeric. + + The type to be examined. + + true if the specified type is numeric; otherwise, false. + + + + + Convert an argument list to the required parameter types. + Currently, only widening numeric conversions are performed. + + An array of args to be converted + A ParameterInfo[] whose types will be used as targets + + + + Determines whether this instance can deduce type args for a generic type from the supplied arguments. + + The type to be examined. + The arglist. + The type args to be used. + + true if this the provided args give sufficient information to determine the type args to be used; otherwise, false. + + + + + Return the interfaces implemented by a Type. + + The Type to be examined. + An array of Types for the interfaces. + + + + Return whether or not the given type is a ValueTuple. + + Type. + Whether or not the given type is a ValueTuple. + + + + Return whether or not the given type is a Tuple. + + Type. + Whether or not the given type is a Tuple. + + + + Determines whether the cast to the given type would succeed. + If is and + can be , the cast succeeds just like the C# language feature. + + The object to cast. + + + + Casts to a value of the given type if possible. + If is and + can be , the cast succeeds just like the C# language feature. + + The object to cast. + The value of the object, if the cast succeeded. + + + + Used for resolving the type difference between objects. + + + + + Gets the shortened type name difference between and . + + The expected object. + The actual object. + Output of the unique type name for the expected object. + Output of the unique type name for actual object. + + + + Gets the shortened type name difference between and . + + The expected object . + The actual object . + Output of the unique type name for the expected object. + Output of the unique type name for actual object. + + + + Obtain the shortened generic template parameters of the given and , + if they are generic. + + The expected . + The actual . + Shortened generic parameters of the expected . + Shortened generic parameters of the actual . + + + + Obtain a shortened name of the given . + + + + + Shorten the given names by only including the relevant differing namespaces/types, if they differ. + + The expected . + The actual . + The shortened expected name. + The shortened actual name. + + + + Returns whether or not the is generic. + + + + + Returns the fully qualified generic name of a given . + + + + + Reconstruct a generic type name using the provided generic type name, and a + of the template parameters. + + The name of the generic type, including the number of template parameters expected. + A of names of the template parameters of the provided generic type. + + + + Obtain the shortened generic names of the given expected and actual s. + + The expected . + The actual . + The shortened expected generic name. + The shortened actual generic name. + + + + The TypeWrapper class wraps a Type so it may be used in + a platform-independent manner. + + + + + Construct a TypeWrapper for a specified Type. + + + + + Gets the underlying Type on which this TypeWrapper is based. + + + + + Gets the base type of this type as an ITypeInfo + + + + + Gets the Name of the Type + + + + + Gets the FullName of the Type + + + + + Gets the assembly in which the type is declared + + + + + Gets the namespace of the Type + + + + + Gets a value indicating whether the type is abstract. + + + + + Gets a value indicating whether the Type is a generic Type + + + + + Returns true if the Type wrapped is T + + + + + Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types. + + + + + Gets a value indicating whether the Type is a generic Type definition + + + + + Gets a value indicating whether the type is sealed. + + + + + Gets a value indicating whether this type represents a static class. + + + + + Get the display name for this type + + + + + Get the display name for an object of this type, constructed with the specified args. + + + + + Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments + + + + + Returns a Type representing a generic type definition from which this Type can be constructed. + + + + + Returns an array of custom attributes of the specified type applied to this type + + + + + Returns a value indicating whether the type has an attribute of the specified type. + + + + + + + + Returns a flag indicating whether this type has a method with an attribute of the specified type. + + + + + + + Returns an array of IMethodInfos for methods of this Type + that match the specified flags. + + + + + Gets the public constructor taking the specified argument Types + + + + + Returns a value indicating whether this Type has a public constructor taking the specified argument Types. + + + + + Construct an object of this Type, using the specified arguments. + + + + + Override ToString() so that error messages in NUnit's own tests make sense + + + + + Encapsulates the ability to increment a value by an amount which may be of a different type. + + + + + Creates a from the specified value if the current instance is able to + use it to increment the on values which it operates. If the creation fails, + is thrown. + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values on which it operates. A return value indicates + whether the creation succeeded. + + + + + Provides a convenient shorthand when is + and the default value of represents zero. + + + + + Initializes a new instance of the class. + + The amount by which to increment each time this step is applied. + + Must increment the given value and return the result. + If the result is outside the range representable by , + must throw . If the result does not change due to lack + of precision representable by , must throw . + + + + + Increments the given value and returns the result. + If the result is outside the range representable by , + throws . If the result does not change due to lack + of precision representable by , throws . + + + + + + + Encapsulates the ability to increment a value by an amount + which may be of a different type. + + + + + Increments the given value and returns the result. + If the result is outside the range representable by , + throws . If the result does not change due to lack + of precision representable by , throws . + + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values of type . If the creation fails, + is thrown. + + + + + + Creates a from the specified value if the current instance is able to + use it to increment values of type . A return value indicates + whether the creation succeeded. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + 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 equality with zero + + + + + 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 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 supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the supplied 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 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 to the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable to 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 tests whether the actual value + is a superset of the collection supplied as an argument. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + 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 a subpath of the 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 + inclusively within a specified range. + + Inclusive beginning of the range. + Inclusive end of the range. + + + + + Returns a constraint that tests if an item is equal to any of parameters + + Expected values + + + + When implemented by an attribute, this interface implemented to provide actions to execute before and after tests. + + + + + Executed before each test is run + + The test that is going to be run. + + + + Executed after each test is run + + The test that has just been run. + + + + Provides the target for the action attribute + + The target for the action attribute + + + + 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 + + + + + Basic Asserts on strings. + + + + + DO NOT USE! Use StringAssert.AreEqualIgnoringCase(...) or Assert.AreEqual(...) instead. + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + + + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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 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 + + + + 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 TestCaseData class represents a set of arguments + and other parameter info to be used for a parameterized + test case. It is derived from TestCaseParameters and adds a + fluent syntax for use in initializing the 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 name of the test case + + The modified TestCaseData instance + + + + Sets the list of display names to use as the parameters in the test name. + + + + + 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 + + + + + + + + Marks the test case as explicit. + + + + + Marks the test case as explicit, specifying the reason. + + + + + Ignores this TestCase, specifying the reason. + + The reason. + + + + + Provide the context information of the current test. + This is an adapter for the internal ExecutionContext + class, hiding the internals from the user test. + + + + + Construct a TestContext for an ExecutionContext + + The ExecutionContext to adapt + + + + 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 TextWriter that will send output to the current test result. + + + + + Gets a TextWriter that will send output directly to Console.Error + + + + + Gets a TextWriter for use in displaying immediate progress messages + + + + + TestParameters object holds parameters for the test run, if any are specified + + + + + Static DefaultWorkDirectory is now used as the source + of the public instance property WorkDirectory. This is + a bit odd but necessary to avoid breaking user tests. + + + + + Get a representation of the current test. + + + + + Gets a Representation of the TestResult for the current test. + + + + + Gets the unique name of the Worker that is executing this test. + + + + + Gets the directory containing the current test assembly. + + + + + Gets the directory to be used for outputting files created + by this test run. + + + + + Gets the random generator. + + + The random generator. + + + + + Gets the number of assertions executed + up to this point in the test. + + + + + Get the number of times the current Test has been repeated. This is currently only + set when using the . + TODO: add this to the RepeatAttribute as well + + + + Write the string representation of a boolean value to the current result + + + Write a char to the current result + + + Write a char array to the current result + + + Write the string representation of a double to the current result + + + Write the string representation of an Int32 value to the current result + + + Write the string representation of an Int64 value to the current result + + + Write the string representation of a decimal value to the current result + + + Write the string representation of an object to the current result + + + Write the string representation of a Single value to the current result + + + Write a string to the current result + + + Write the string representation of a UInt32 value to the current result + + + Write the string representation of a UInt64 value to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a formatted string to the current result + + + Write a line terminator to the current result + + + Write the string representation of a boolean value to the current result followed by a line terminator + + + Write a char to the current result followed by a line terminator + + + Write a char array to the current result followed by a line terminator + + + Write the string representation of a double to the current result followed by a line terminator + + + Write the string representation of an Int32 value to the current result followed by a line terminator + + + Write the string representation of an Int64 value to the current result followed by a line terminator + + + Write the string representation of a decimal value to the current result followed by a line terminator + + + Write the string representation of an object to the current result followed by a line terminator + + + Write the string representation of a Single value to the current result followed by a line terminator + + + Write a string to the current result followed by a line terminator + + + Write the string representation of a UInt32 value to the current result followed by a line terminator + + + Write the string representation of a UInt64 value to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + Write a formatted string to the current result followed by a line terminator + + + + This method adds the a new ValueFormatterFactory to the + chain of responsibility used for formatting values in messages. + The scope of the change is the current TestContext. + + The factory delegate + + + + Attach a file to the current test result + + Relative or absolute file path to attachment + Optional description of attachment + + + + This method provides a simplified way to add a ValueFormatter + delegate to the chain of responsibility, creating the factory + delegate internally. It is useful when the Type of the object + is the only criterion for selection of the formatter, since + it can be used without getting involved with a compound function. + + The type supported by this formatter + The ValueFormatter delegate + + + + TestAdapter adapts a Test for consumption by + the user test code. + + + + + Construct a TestAdapter for a Test + + The Test to be adapted + + + + Gets the unique Id of a test + + + + + The name of the test, which may or may not be + the same as the method name. + + + + + The name of the method representing the test. + + + + + The FullName of the test + + + + + The ClassName of the test + + + + + A shallow copy of the properties of the test. + + + + + The arguments to use in creating the test or empty array if none are required. + + + + + ResultAdapter adapts a TestResult for consumption by + the user test code. + + + + + Construct a ResultAdapter for a TestResult + + The TestResult to be adapted + + + + Gets a ResultState representing the outcome of the test + up to this point in its execution. + + + + + Gets a list of the assertion results generated + up to this point in the test. + + + + + Gets the message associated with a test + failure or with not running the test + + + + + Gets any stack trace associated with an + error or failure. + + + + + Gets the number of test cases that failed + when running the test and all its children. + + + + + Gets the number of test cases that had warnings + when running the test and all its children. + + + + + Gets the number of test cases that passed + when running the test and all its children. + + + + + Gets the number of test cases that were skipped + when running the test and all its children. + + + + + Gets the number of test cases that were inconclusive + when running the test and all its children. + + + + + adapts an + for consumption by the user. + + + + + Construct a from a source + . + + + + + Get the first property with the given , if it can be found, otherwise + returns null. + + + + + Indicates whether is found in this + . + + + + + Returns a collection of properties + with the given . + + + + + Returns the count of elements with the given . + + + + + Returns a collection of the property keys. + + + + + The TestFixtureData class represents a set of arguments + and other parameter info to be used for a parameterized + fixture. It is derived from TestFixtureParameters and adds a + fluent syntax for use in initializing the fixture. + + + + + 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 name of the test fixture + + The modified TestFixtureData instance + + + + Sets the list of display names to use as the parameters in the test name. + + + + + Marks the test fixture as explicit. + + + + + Marks the test fixture as explicit, specifying the reason. + + + + + Ignores this TestFixture, specifying the reason. + + The reason. + + + + + TestParameters class holds any named parameters supplied to the test run + + + + + Gets the number of test parameters + + + + + Gets a collection of the test parameter names + + + + + Gets a flag indicating whether a parameter with the specified name exists. + + Name of the parameter + True if it exists, otherwise false + + + + Indexer provides access to the internal dictionary + + Name of the parameter + Value of the parameter or null if not present + + + + Get method is a simple alternative to the indexer + + Name of the parameter + Value of the parameter or null if not present + + + + Get the value of a parameter or a default string + + Name of the parameter + Default value of the parameter + Value of the parameter or default value if not present + + + + Get the value of a parameter or return a default + + The return Type + Name of the parameter + Default value of the parameter + Value of the parameter or default value if not present + + + + Adds a parameter to the list + + Name of the parameter + Value of the parameter + + + + Helper class with properties and methods that supply + constraints that operate on exceptions. + + + + + 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 ArgumentException + + + + + Creates a constraint specifying an expected ArgumentNullException + + + + + Creates a constraint specifying an expected InvalidOperationException + + + + + Creates a constraint specifying that no exception is thrown + + + + + 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 + + + + + Provides static methods to express conditions + that must be met for the test to succeed. If + any test fails, a warning is issued. + + + + + DO NOT USE! + The Equals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + Not applicable + + + + DO NOT USE! + The ReferenceEquals method throws an InvalidOperationException. This is done + to make sure there is no mistake by calling this function. + + The left object. + The right object. + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + 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 a warning is issued. + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + 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 . + + A lambda that returns a Boolean + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning on success. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning on success. + + The Type being compared. + 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 an actual value, succeeding if the constraint + fails and issuing a warning on failure. + + The Type being compared. + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + A function to build the message included with the Exception + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + 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 a warning is issued. + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false a warning is issued. + + The evaluated condition + A function to build the message included with the Exception + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + The message to display if the condition is true + Arguments to be used in formatting the message + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + + + + Asserts that a condition is false. If the condition is true a warning is issued. + + A lambda that returns a Boolean + A function to build the message included with the Exception + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning if it succeeds. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + fails and issuing a warning if it succeeds. + + The Type being compared. + The actual value to test + 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 an actual value, succeeding if the constraint + is satisfied and issuing a warning on failure. + + The Type being compared. + The actual value to test + A Constraint expression to be applied + A function to build the message included with the Exception + + + + FrameworkPackageSettings is a static class containing constant values that + are used as keys in setting up a TestPackage. These values are used in + the framework, and set in the runner. Setting values may be a string, int or bool. + + + + + Flag (bool) indicating whether tests are being debugged. + + + + + Flag (bool) indicating whether to pause execution of tests to allow + the user to attach a debugger. + + + + + The InternalTraceLevel for this run. Values are: "Default", + "Off", "Error", "Warning", "Info", "Debug", "Verbose". + Default is "Off". "Debug" and "Verbose" are synonyms. + + + + + Full path of the directory to be used for work and result files. + This path is provided to tests by the framework TestContext. + + + + + Integer value in milliseconds for the default timeout value + for test cases. If not specified, there is no timeout except + as specified by attributes on the tests themselves. + + + + + A TextWriter to which the internal trace will be sent. + + + + + A list of tests to be loaded. + + + + + The number of test threads to run for the assembly. If set to + 1, a single queue is used. If set to 0, tests are executed + directly, without queuing. + + + + + The random seed to be used for this assembly. If specified + as the value reported from a prior run, the framework should + generate identical random values for tests as were used for + that run, provided that no change has been made to the test + assembly. Default is a random value itself. + + + + + If true, execution stops after the first error or failure. + + + + + If true, use of the event queue is suppressed and test events are synchronous. + + + + + The default naming pattern used in generating test names + + + + + Parameters to be passed on to the tests, serialized to a single string which needs parsing. Obsoleted by ; kept for backward compatibility. + + + + + Parameters to be passed on to the tests, already parsed into an IDictionary<string, string>. Replaces . + + + + + If true, the tests will run on the same thread as the NUnit runner itself + + + + + Provides a platform-independent methods for getting attributes + for use by AttributeConstraint and AttributeExistsConstraint. + + + + + Gets the custom attributes from the given object. + + The actual. + Type of the attribute. + if set to true [inherit]. + A list of the given attribute on the given object. + + + + A MarshalByRefObject that lives forever + + + + + Obtains a lifetime service object to control the lifetime policy for this instance. + + + + + A shim of the .NET interface for platforms that do not support it. + Used to indicate that a control can be the target of a callback event on the server. + + + + + Processes a callback event that targets a control. + + + + + + Returns the results of a callback event that targets a control. + + + + + diff --git a/packages/NUnit3TestAdapter.3.12.0/.signature.p7s b/packages/NUnit3TestAdapter.3.12.0/.signature.p7s new file mode 100644 index 0000000000000000000000000000000000000000..c4d5a2b97c6c29d1c29025203feb3eb281c1f236 Binary files /dev/null and b/packages/NUnit3TestAdapter.3.12.0/.signature.p7s differ diff --git a/packages/NUnit3TestAdapter.3.12.0/LICENSE.txt b/packages/NUnit3TestAdapter.3.12.0/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..210c64746b842ac76d0f5d68f2d1136c9adbe1ff --- /dev/null +++ b/packages/NUnit3TestAdapter.3.12.0/LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2011-2017 Charlie Poole, 2014-2017 Terje Sandstrom + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/packages/NUnit3TestAdapter.3.12.0/NUnit3TestAdapter.3.12.0.nupkg b/packages/NUnit3TestAdapter.3.12.0/NUnit3TestAdapter.3.12.0.nupkg new file mode 100644 index 0000000000000000000000000000000000000000..8b5057fd79230d29b463e14f734d8b8337d38c6e Binary files /dev/null and b/packages/NUnit3TestAdapter.3.12.0/NUnit3TestAdapter.3.12.0.nupkg differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3.TestAdapter.dll b/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3.TestAdapter.dll new file mode 100644 index 0000000000000000000000000000000000000000..97907257342fd5a225fc11996b6efa0b6a573ddf Binary files /dev/null and b/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3.TestAdapter.dll differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3.TestAdapter.pdb b/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3.TestAdapter.pdb new file mode 100644 index 0000000000000000000000000000000000000000..5cada9f75d7387efb71250e15b10971c43b78976 Binary files /dev/null and b/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3.TestAdapter.pdb differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3TestAdapter.props b/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3TestAdapter.props new file mode 100644 index 0000000000000000000000000000000000000000..9cbeed67fb65c94ff2504293d1b168ef06ffda03 --- /dev/null +++ b/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3TestAdapter.props @@ -0,0 +1,25 @@ + + + + + NUnit3.TestAdapter.dll + PreserveNewest + False + + + NUnit3.TestAdapter.pdb + PreserveNewest + False + + + nunit.engine.dll + PreserveNewest + False + + + nunit.engine.api.dll + PreserveNewest + False + + + diff --git a/packages/NUnit3TestAdapter.3.12.0/build/net35/nunit.engine.api.dll b/packages/NUnit3TestAdapter.3.12.0/build/net35/nunit.engine.api.dll new file mode 100644 index 0000000000000000000000000000000000000000..724a7a2e0ea050fdfb25991cbc2e73d0608f88d0 Binary files /dev/null and b/packages/NUnit3TestAdapter.3.12.0/build/net35/nunit.engine.api.dll differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/net35/nunit.engine.dll b/packages/NUnit3TestAdapter.3.12.0/build/net35/nunit.engine.dll new file mode 100644 index 0000000000000000000000000000000000000000..ca53afacfe4ced6e1468af6096301861e1568388 Binary files /dev/null and b/packages/NUnit3TestAdapter.3.12.0/build/net35/nunit.engine.dll differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3.TestAdapter.dll b/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3.TestAdapter.dll new file mode 100644 index 0000000000000000000000000000000000000000..53ad88912fd42bcea59bc036332f2d816dc6a7af Binary files /dev/null and b/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3.TestAdapter.dll differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3.TestAdapter.pdb b/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3.TestAdapter.pdb new file mode 100644 index 0000000000000000000000000000000000000000..ea8b2b25362c608f3ac866385f9742d969f7b429 Binary files /dev/null and b/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3.TestAdapter.pdb differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3TestAdapter.props b/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3TestAdapter.props new file mode 100644 index 0000000000000000000000000000000000000000..3016fb1b2a294d2b695e78ffaf5935fd228dae32 --- /dev/null +++ b/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3TestAdapter.props @@ -0,0 +1,20 @@ + + + + + NUnit3.TestAdapter.dll + PreserveNewest + False + + + NUnit3.TestAdapter.pdb + PreserveNewest + False + + + nunit.engine.netstandard.dll + PreserveNewest + False + + + diff --git a/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/nunit.engine.netstandard.dll b/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/nunit.engine.netstandard.dll new file mode 100644 index 0000000000000000000000000000000000000000..ab0c005375c8dbfa56a86cf08cd01e3f64c9bae6 Binary files /dev/null and b/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/nunit.engine.netstandard.dll differ diff --git a/packages/repositories.config b/packages/repositories.config deleted file mode 100644 index ec41ca85a57da377cdd2ffe990d0d10d348441ea..0000000000000000000000000000000000000000 --- a/packages/repositories.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/run_all.android.sh b/run_all.android.sh deleted file mode 100755 index c8a6e36b881f3c0bca7d463840abb0df0975d9c6..0000000000000000000000000000000000000000 --- a/run_all.android.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -cd Core/KeraLua -make -f Makefile.Android -cd ../../ -make -f Makefile.Android - diff --git a/run_all.ios.sh b/run_all.ios.sh deleted file mode 100755 index 0e6e686a33b45066788047938d90b1dd1af35fe0..0000000000000000000000000000000000000000 --- a/run_all.ios.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -cd Core/KeraLua -make -f Makefile.iOS -cd ../../ -make -f Makefile.iOS run - diff --git a/run_all.linux64.sh b/run_all.linux64.sh deleted file mode 100755 index d5737d4f3c83f19b0c5c7c2a971a1330d5ccb2de..0000000000000000000000000000000000000000 --- a/run_all.linux64.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# If you have mono x86 installed on a amd64 linux. - -export CFLAGS=-m64 -export CXXFLAGS=-m64 -export LDFLAGS=-m64 -#export LD_LIBRARY_PATH=$PWD/external/lua/linux/lib64 - -cd Core/KeraLua/ -make -f Makefile.Linux -xbuild KeraLua.Net45.sln /p:Configuration=Release -cd ../../ -xbuild NLua.Net45.sln /p:Configuration=Release -export LD_LIBRARY_PATH=$PWD/Core/KeraLua/external/lua/linux/lib64 -cd tests/ -nunit-console NLuaTest.dll diff --git a/run_all.osx.40.kopilua.sh b/run_all.osx.40.kopilua.sh deleted file mode 100755 index 9bb2a6f36e33e3c1c638e2155e5f967d83497d1c..0000000000000000000000000000000000000000 --- a/run_all.osx.40.kopilua.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -xbuild NLua.Net40.sln /p:Configuration=ReleaseKopiLua -cd tests/ -export MONO_PATH="/Library/Frameworks/Mono.framework/Libraries/mono/4.0/" -nunit-console NLuaTest.dll -xml=$1 diff --git a/run_all.osx.40.sh b/run_all.osx.40.sh deleted file mode 100755 index 40eb3953e88441de8627025c3a745a0bb5227af1..0000000000000000000000000000000000000000 --- a/run_all.osx.40.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -cd Core/KeraLua -make -f Makefile.OSX -xbuild KeraLua.Net40.sln /p:Configuration=Release -cd ../../ -cp Core/KeraLua/external/lua/osx/lib/liblua52.dylib tests/liblua52.dylib -xbuild NLua.Net40.sln /p:Configuration=Release -cd tests/ -export MONO_PATH="/Library/Frameworks/Mono.framework/Libraries/mono/4.0/" -nunit-console NLuaTest.dll -xml=$1 diff --git a/run_all.osx.kopilua.sh b/run_all.osx.kopilua.sh deleted file mode 100755 index acd5046af3d268cd3b8a406d0af0b83e8bded2a9..0000000000000000000000000000000000000000 --- a/run_all.osx.kopilua.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -xbuild NLua.Net45.sln /p:Configuration=ReleaseKopiLua -cd tests/ -export MONO_PATH="/Library/Frameworks/Mono.framework/Libraries/mono/4.5/" -nunit-console NLuaTest.dll -xml=$1 diff --git a/run_all.osx.sh b/run_all.osx.sh deleted file mode 100755 index 8bdee22fb036c05258d2d6099e39c1c2040b4e31..0000000000000000000000000000000000000000 --- a/run_all.osx.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -cd Core/KeraLua -make -f Makefile.OSX -xbuild KeraLua.Net45.sln /p:Configuration=Release -cd ../../ -cp Core/KeraLua/external/lua/osx/lib/liblua52.dylib tests/liblua52.dylib -xbuild NLua.Net45.sln /p:Configuration=Release -cd tests/ -export MONO_PATH="/Library/Frameworks/Mono.framework/Libraries/mono/4.5/" -nunit-console NLuaTest.dll -xml=$1 diff --git a/run_all.win.kopilua.35.bat b/run_all.win.kopilua.35.bat deleted file mode 100755 index 7c9742f2a00feb3b389340555a4b07a28f2ab5bd..0000000000000000000000000000000000000000 --- a/run_all.win.kopilua.35.bat +++ /dev/null @@ -1,5 +0,0 @@ -erase tests\*.dll -msbuild NLua.Net35.sln /p:Configuration=ReleaseKopiLua /p:Platform="Any CPU" -cd tests/ -nunit-console NLuaTest.dll /xml=$1 -cd .. \ No newline at end of file diff --git a/run_all.win.kopilua.40.bat b/run_all.win.kopilua.40.bat deleted file mode 100644 index ccd7d06b0d1a7adeecafe38b0283efe99b41a296..0000000000000000000000000000000000000000 --- a/run_all.win.kopilua.40.bat +++ /dev/null @@ -1,5 +0,0 @@ -erase tests\*.dll -msbuild NLua.Net40.sln /p:Configuration=ReleaseKopiLua /p:Platform="Any CPU" -cd tests/ -nunit-console NLuaTest.dll /xml=$1 -cd .. \ No newline at end of file diff --git a/run_all.win.kopilua.bat b/run_all.win.kopilua.bat deleted file mode 100644 index 2aec29e25398bca2d70b1f4b081341d32f4dbee9..0000000000000000000000000000000000000000 --- a/run_all.win.kopilua.bat +++ /dev/null @@ -1,5 +0,0 @@ -erase tests\*.dll -msbuild NLua.Net45.sln /p:Configuration=ReleaseKopiLua /p:Platform="Any CPU" -cd tests/ -nunit-console NLuaTest.dll /xml=$1 -cd .. \ No newline at end of file diff --git a/run_all.win32.35.bat b/run_all.win32.35.bat deleted file mode 100755 index 4c9b1c46c900c2f8869e4e8dbdb1d6f945c591a2..0000000000000000000000000000000000000000 --- a/run_all.win32.35.bat +++ /dev/null @@ -1,11 +0,0 @@ -erase tests\*.dll -cd Core\KeraLua -call Makefile.Win32.bat -msbuild KeraLua.Net35.sln /p:Configuration=Release /p:DefineConstants="USE_DYNAMIC_DLL_REGISTER;WSTRING" /p:Platform="Any CPU" -cd ..\.. -xcopy Core\KeraLua\external\lua\win32\bin\*.dll tests\*.dll -msbuild NLua.Net35.sln /p:Configuration=Release /p:DefineConstants="USE_DYNAMIC_DLL_REGISTER;WSTRING;LUA_CORE;CATCH_EXCEPTIONS;NET_3_5" /p:Platform="Any CPU" -cd tests/ -nunit-console-x86 NLuaTest.dll /xml=$1 -cd .. - diff --git a/run_all.win32.40.bat b/run_all.win32.40.bat deleted file mode 100644 index e5b5cd21d7849c68d87270d3e474fe64ff2adaa4..0000000000000000000000000000000000000000 --- a/run_all.win32.40.bat +++ /dev/null @@ -1,11 +0,0 @@ -erase tests\*.dll -cd Core\KeraLua -call Makefile.Win32.bat -msbuild KeraLua.Net40.sln /p:Configuration=Release /p:DefineConstants="USE_DYNAMIC_DLL_REGISTER;WSTRING" /p:Platform="Any CPU" -cd ..\.. -xcopy Core\KeraLua\external\lua\win32\bin\*.dll tests\*.dll -msbuild NLua.Net40.sln /p:Configuration=Release /p:DefineConstants="USE_DYNAMIC_DLL_REGISTER;WSTRING;LUA_CORE;CATCH_EXCEPTIONS" /p:Platform="Any CPU" -cd tests/ -nunit-console-x86 NLuaTest.dll /xml=$1 -cd .. - diff --git a/run_all.win32.bat b/run_all.win32.bat deleted file mode 100644 index 67e93cfc85e738afaf713e17915a9dd508d8e198..0000000000000000000000000000000000000000 --- a/run_all.win32.bat +++ /dev/null @@ -1,11 +0,0 @@ -erase tests\*.dll -cd Core\KeraLua -call Makefile.Win32.bat -msbuild KeraLua.Net45.sln /p:Configuration=Release /p:DefineConstants="USE_DYNAMIC_DLL_REGISTER;WSTRING" /p:Platform="Any CPU" -cd ..\.. -xcopy Core\KeraLua\external\lua\win32\bin\*.dll tests\*.dll -msbuild NLua.Net45.sln /p:Configuration=Release /p:DefineConstants="USE_DYNAMIC_DLL_REGISTER;WSTRING;LUA_CORE;CATCH_EXCEPTIONS" /p:Platform="Any CPU" -cd tests/ -nunit-console-x86 NLuaTest.dll /xml=$1 -cd .. - diff --git a/run_all.win64.35.bat b/run_all.win64.35.bat deleted file mode 100755 index bac482779305fc99d861ae55b0d7173e153f748a..0000000000000000000000000000000000000000 --- a/run_all.win64.35.bat +++ /dev/null @@ -1,10 +0,0 @@ -erase tests\*.dll -cd Core\KeraLua -call Makefile.Win64.bat -msbuild KeraLua.Net35.sln /p:Configuration=Release /p:DefineConstants="USE_DYNAMIC_DLL_REGISTER;WSTRING" /p:Platform="Any CPU" -cd ..\.. -xcopy Core\KeraLua\external\lua\win64\bin64\*.dll tests\*.dll -msbuild NLua.Net35.sln /p:Configuration=Release /p:DefineConstants="USE_DYNAMIC_DLL_REGISTER;WSTRING;LUA_CORE;CATCH_EXCEPTIONS;NET_3_5" /p:Platform="Any CPU" -cd tests/ -nunit-console NLuaTest.dll /xml=$1 -cd .. diff --git a/run_all.win64.40.bat b/run_all.win64.40.bat deleted file mode 100644 index 4f0b776b3b0267bd8cc8d2fb2c35f14e97f133fb..0000000000000000000000000000000000000000 --- a/run_all.win64.40.bat +++ /dev/null @@ -1,10 +0,0 @@ -erase tests\*.dll -cd Core\KeraLua -call Makefile.Win64.bat -msbuild KeraLua.Net40.sln /p:Configuration=Release /p:DefineConstants="USE_DYNAMIC_DLL_REGISTER;WSTRING" /p:Platform="Any CPU" -cd ..\.. -xcopy Core\KeraLua\external\lua\win64\bin64\*.dll tests\*.dll -msbuild NLua.Net40.sln /p:Configuration=Release /p:DefineConstants="USE_DYNAMIC_DLL_REGISTER;WSTRING;LUA_CORE;CATCH_EXCEPTIONS" /p:Platform="Any CPU" -cd tests/ -nunit-console NLuaTest.dll /xml=$1 -cd .. diff --git a/run_all.win64.bat b/run_all.win64.bat deleted file mode 100644 index d374bd62e5f29040bda5cbe4d0efd70fb06e6830..0000000000000000000000000000000000000000 --- a/run_all.win64.bat +++ /dev/null @@ -1,10 +0,0 @@ -erase tests\*.dll -cd Core\KeraLua -call Makefile.Win64.bat -msbuild KeraLua.Net45.sln /p:Configuration=Release /p:DefineConstants="USE_DYNAMIC_DLL_REGISTER;WSTRING" /p:Platform="Any CPU" -cd ..\.. -xcopy Core\KeraLua\external\lua\win64\bin64\*.dll tests\*.dll -msbuild NLua.Net45.sln /p:Configuration=Release /p:DefineConstants="USE_DYNAMIC_DLL_REGISTER;WSTRING;LUA_CORE;CATCH_EXCEPTIONS" /p:Platform="Any CPU" -cd tests/ -nunit-console NLuaTest.dll /xml=$1 -cd .. diff --git a/run_all.wp8.arm.bat b/run_all.wp8.arm.bat deleted file mode 100755 index 67fd80f3c59a265bd90d6be0db1ccd7fa536845a..0000000000000000000000000000000000000000 --- a/run_all.wp8.arm.bat +++ /dev/null @@ -1 +0,0 @@ -msbuild NLua.WP8.sln /p:Configuration=Release /p:Platform="ARM" diff --git a/run_all.wp8.x86.bat b/run_all.wp8.x86.bat deleted file mode 100755 index 16cdc59c24c446a2cdca9ea787358d2c97817102..0000000000000000000000000000000000000000 --- a/run_all.wp8.x86.bat +++ /dev/null @@ -1 +0,0 @@ -msbuild NLua.WP8.sln /p:Configuration=Release /p:Platform="Win32" diff --git a/run_all.wpsl8.arm.bat b/run_all.wpsl8.arm.bat deleted file mode 100755 index 0b99fc2325dd3515239b7ccc2f90ac1316876d2b..0000000000000000000000000000000000000000 --- a/run_all.wpsl8.arm.bat +++ /dev/null @@ -1 +0,0 @@ -msbuild NLua.WPSL8.sln /p:Configuration=Release /p:Platform="ARM" diff --git a/run_all.wpsl8.x86.bat b/run_all.wpsl8.x86.bat deleted file mode 100755 index 545c6ce4f4c3793f3dc3ad383901acf3cbe663c8..0000000000000000000000000000000000000000 --- a/run_all.wpsl8.x86.bat +++ /dev/null @@ -1 +0,0 @@ -msbuild NLua.WPSL8.sln /p:Configuration=Release /p:Platform="Win32" diff --git a/src/CheckType.cs b/src/CheckType.cs new file mode 100644 index 0000000000000000000000000000000000000000..2acdc0dddc97d55b7da875709b2c2dd3a79c02b2 --- /dev/null +++ b/src/CheckType.cs @@ -0,0 +1,381 @@ +using System; +using System.Collections.Generic; +using KeraLua; +using NLua.Method; +using NLua.Extensions; + +namespace NLua +{ + using LuaState = KeraLua.Lua; + sealed class CheckType + { + Dictionary extractValues = new Dictionary(); + ExtractValue extractNetObject; + ObjectTranslator translator; + + public CheckType(ObjectTranslator translator) + { + this.translator = translator; + extractValues.Add(GetExtractDictionaryKey(typeof(object)), new ExtractValue(GetAsObject)); + extractValues.Add(GetExtractDictionaryKey(typeof(sbyte)), new ExtractValue(GetAsSbyte)); + extractValues.Add(GetExtractDictionaryKey(typeof(byte)), new ExtractValue(GetAsByte)); + extractValues.Add(GetExtractDictionaryKey(typeof(short)), new ExtractValue(GetAsShort)); + extractValues.Add(GetExtractDictionaryKey(typeof(ushort)), new ExtractValue(GetAsUshort)); + extractValues.Add(GetExtractDictionaryKey(typeof(int)), new ExtractValue(GetAsInt)); + extractValues.Add(GetExtractDictionaryKey(typeof(uint)), new ExtractValue(GetAsUint)); + extractValues.Add(GetExtractDictionaryKey(typeof(long)), new ExtractValue(GetAsLong)); + extractValues.Add(GetExtractDictionaryKey(typeof(ulong)), new ExtractValue(GetAsUlong)); + extractValues.Add(GetExtractDictionaryKey(typeof(double)), new ExtractValue(GetAsDouble)); + extractValues.Add(GetExtractDictionaryKey(typeof(char)), new ExtractValue(GetAsChar)); + extractValues.Add(GetExtractDictionaryKey(typeof(float)), new ExtractValue(GetAsFloat)); + extractValues.Add(GetExtractDictionaryKey(typeof(decimal)), new ExtractValue(GetAsDecimal)); + extractValues.Add(GetExtractDictionaryKey(typeof(bool)), new ExtractValue(GetAsBoolean)); + extractValues.Add(GetExtractDictionaryKey(typeof(string)), new ExtractValue(GetAsString)); + extractValues.Add(GetExtractDictionaryKey(typeof(char[])), new ExtractValue(GetAsCharArray)); + extractValues.Add(GetExtractDictionaryKey(typeof(LuaFunction)), new ExtractValue(GetAsFunction)); + extractValues.Add(GetExtractDictionaryKey(typeof(LuaTable)), new ExtractValue(GetAsTable)); + extractValues.Add(GetExtractDictionaryKey(typeof(LuaUserData)), new ExtractValue(GetAsUserdata)); + extractNetObject = new ExtractValue(GetAsNetObject); + } + + /* + * Checks if the value at Lua stack index stackPos matches paramType, + * returning a conversion function if it does and null otherwise. + */ + internal ExtractValue GetExtractor(ProxyType paramType) + { + return GetExtractor(paramType.UnderlyingSystemType); + } + + internal ExtractValue GetExtractor(Type paramType) + { + if (paramType.IsByRef) + paramType = paramType.GetElementType(); + + var extractKey = GetExtractDictionaryKey(paramType); + return extractValues.ContainsKey(extractKey) ? extractValues[extractKey] : extractNetObject; + } + + internal ExtractValue CheckLuaType(LuaState luaState, int stackPos, Type paramType) + { + LuaType luatype = luaState.Type(stackPos); + + if (paramType.IsByRef) + paramType = paramType.GetElementType(); + + var underlyingType = Nullable.GetUnderlyingType(paramType); + + if (underlyingType != null) + { + paramType = underlyingType; // Silently convert nullable types to their non null requics + } + + var extractKey = GetExtractDictionaryKey(paramType); + + bool netParamIsNumeric = paramType == typeof(int) || + paramType == typeof(uint) || + paramType == typeof(long) || + paramType == typeof(ulong) || + paramType == typeof(short) || + paramType == typeof(ushort) || + paramType == typeof(float) || + paramType == typeof(double) || + paramType == typeof(decimal) || + paramType == typeof(byte); + + // If it is a nullable + if (underlyingType != null) + { + // null can always be assigned to nullable + if (luatype == LuaType.Nil) + { + // Return the correct extractor anyways + if (netParamIsNumeric || paramType == typeof(bool)) + return extractValues[extractKey]; + return extractNetObject; + } + } + + if (paramType.Equals(typeof(object))) + return extractValues[extractKey]; + + //CP: Added support for generic parameters + if (paramType.IsGenericParameter) + { + if (luatype == LuaType.Boolean) + return extractValues[GetExtractDictionaryKey(typeof(bool))]; + else if (luatype == LuaType.String) + return extractValues[GetExtractDictionaryKey(typeof(string))]; + else if (luatype == LuaType.Table) + return extractValues[GetExtractDictionaryKey(typeof(LuaTable))]; + else if (luatype == LuaType.UserData) + return extractValues[GetExtractDictionaryKey(typeof(object))]; + else if (luatype == LuaType.Function) + return extractValues[GetExtractDictionaryKey(typeof(LuaFunction))]; + else if (luatype == LuaType.Number) + return extractValues[GetExtractDictionaryKey(typeof(double))]; + } + bool netParamIsString = paramType == typeof(string) || paramType == typeof(char[]); + + if (netParamIsNumeric) + { + if (luaState.IsNumber(stackPos) && !netParamIsString) + return extractValues[extractKey]; + } + else if (paramType == typeof(bool)) + { + if (luaState.IsBoolean(stackPos)) + return extractValues[extractKey]; + } + else if (netParamIsString) + { + if (luaState.IsString(stackPos)) + return extractValues[extractKey]; + else if (luatype == LuaType.Nil) + return extractNetObject; // kevinh - silently convert nil to a null string pointer + } + else if (paramType == typeof(LuaTable)) + { + if (luatype == LuaType.Table || luatype == LuaType.Nil) + return extractValues[extractKey]; + } + else if (paramType == typeof(LuaUserData)) + { + if (luatype == LuaType.UserData || luatype == LuaType.Nil) + return extractValues[extractKey]; + } + else if (paramType == typeof(LuaFunction)) + { + if (luatype == LuaType.Function || luatype == LuaType.Nil) + return extractValues[extractKey]; + } + else if (typeof(Delegate).IsAssignableFrom(paramType) && luatype == LuaType.Function) + return new ExtractValue(new DelegateGenerator(translator, paramType).ExtractGenerated); + else if (paramType.IsInterface && luatype == LuaType.Table) + return new ExtractValue(new ClassGenerator(translator, paramType).ExtractGenerated); + else if ((paramType.IsInterface || paramType.IsClass) && luatype == LuaType.Nil) + { + // kevinh - allow nil to be silently converted to null - extractNetObject will return null when the item ain't found + return extractNetObject; + } + else if (luaState.Type(stackPos) == LuaType.Table) + { + if (luaState.GetMetaField(stackPos, "__index") != LuaType.Nil) + { + object obj = translator.GetNetObject(luaState, -1); + luaState.SetTop(-2); + if (obj != null && paramType.IsAssignableFrom(obj.GetType())) + return extractNetObject; + } + else + return null; + } + else + { + object obj = translator.GetNetObject(luaState, stackPos); + if (obj != null && paramType.IsAssignableFrom(obj.GetType())) + return extractNetObject; + } + + return null; + } + + Type GetExtractDictionaryKey(Type targetType) + { + return targetType; + } + + /* + * The following functions return the value in the Lua stack + * index stackPos as the desired type if it can, or null + * otherwise. + */ + private object GetAsSbyte(LuaState luaState, int stackPos) + { + sbyte retVal = (sbyte)luaState.ToNumber(stackPos); + if (retVal == 0 && !luaState.IsNumber(stackPos)) + return null; + + return retVal; + } + + private object GetAsByte(LuaState luaState, int stackPos) + { + byte retVal = (byte)luaState.ToNumber(stackPos); + if (retVal == 0 && !luaState.IsNumber(stackPos)) + return null; + + return retVal; + } + + private object GetAsShort(LuaState luaState, int stackPos) + { + short retVal = (short)luaState.ToNumber(stackPos); + if (retVal == 0 && !luaState.IsNumber(stackPos)) + return null; + + return retVal; + } + + private object GetAsUshort(LuaState luaState, int stackPos) + { + ushort retVal = (ushort)luaState.ToNumber(stackPos); + if (retVal == 0 && !luaState.IsNumericType(stackPos)) + return null; + + return retVal; + } + + private object GetAsInt(LuaState luaState, int stackPos) + { + if (!luaState.IsNumericType(stackPos)) + return null; + + int retVal = (int)luaState.ToNumber(stackPos); + return retVal; + } + + private object GetAsUint(LuaState luaState, int stackPos) + { + uint retVal = (uint)luaState.ToNumber(stackPos); + if (retVal == 0 && !luaState.IsNumericType(stackPos)) + return null; + + return retVal; + } + + private object GetAsLong(LuaState luaState, int stackPos) + { + long retVal = (long)luaState.ToNumber(stackPos); + if (retVal == 0 && !luaState.IsNumericType(stackPos)) + return null; + + return retVal; + } + + private object GetAsUlong(LuaState luaState, int stackPos) + { + ulong retVal = (ulong)luaState.ToNumber(stackPos); + if (retVal == 0 && !luaState.IsNumericType(stackPos)) + return null; + + return retVal; + } + + private object GetAsDouble(LuaState luaState, int stackPos) + { + double retVal = luaState.ToNumber(stackPos); + if (retVal == 0 && !luaState.IsNumericType(stackPos)) + return null; + + return retVal; + } + + private object GetAsChar(LuaState luaState, int stackPos) + { + char retVal = (char)luaState.ToNumber(stackPos); + if (retVal == 0 && !luaState.IsNumericType(stackPos)) + return null; + + return retVal; + } + + private object GetAsFloat(LuaState luaState, int stackPos) + { + float retVal = (float)luaState.ToNumber(stackPos); + if (retVal == 0 && !luaState.IsNumericType(stackPos)) + return null; + + return retVal; + } + + private object GetAsDecimal(LuaState luaState, int stackPos) + { + decimal retVal = (decimal)luaState.ToNumber(stackPos); + if (retVal == 0 && !luaState.IsNumericType(stackPos)) + return null; + + return retVal; + } + + private object GetAsBoolean(LuaState luaState, int stackPos) + { + return luaState.ToBoolean(stackPos); + } + + + + private object GetAsCharArray(LuaState luaState, int stackPos) + { + if (!luaState.IsString(stackPos)) + return null; + string retVal = luaState.ToString(stackPos); + return retVal.ToCharArray(); + } + + private object GetAsString(LuaState luaState, int stackPos) + { + if (!luaState.IsString(stackPos)) + return null; + string retVal = luaState.ToString(stackPos); + return retVal; + } + + private object GetAsTable(LuaState luaState, int stackPos) + { + return translator.GetTable(luaState, stackPos); + } + + private object GetAsFunction(LuaState luaState, int stackPos) + { + return translator.GetFunction(luaState, stackPos); + } + + private object GetAsUserdata(LuaState luaState, int stackPos) + { + return translator.GetUserData(luaState, stackPos); + } + + public object GetAsObject(LuaState luaState, int stackPos) + { + if (luaState.Type(stackPos) == LuaType.Table) + { + if (luaState.GetMetaField(stackPos, "__index") != LuaType.Nil) + { + if (luaState.CheckMetaTable(-1, translator.Tag)) + { + luaState.Insert(stackPos); + luaState.Remove(stackPos + 1); + } + else + luaState.SetTop(-2); + } + } + + object obj = translator.GetObject(luaState, stackPos); + return obj; + } + + public object GetAsNetObject(LuaState luaState, int stackPos) + { + object obj = translator.GetNetObject(luaState, stackPos); + + if (obj == null && luaState.Type(stackPos) == LuaType.Table) + { + if (luaState.GetMetaField(stackPos, "__index") != LuaType.Nil) + { + if (luaState.CheckMetaTable(-1, translator.Tag)) + { + luaState.Insert(stackPos); + luaState.Remove(stackPos + 1); + obj = translator.GetNetObject(luaState, stackPos); + } + else + luaState.SetTop(-2); + } + } + + return obj; + } + } +} \ No newline at end of file diff --git a/src/Event/DebugHookEventArgs.cs b/src/Event/DebugHookEventArgs.cs new file mode 100644 index 0000000000000000000000000000000000000000..96098770937251a7dafb158ff11967823677e68c --- /dev/null +++ b/src/Event/DebugHookEventArgs.cs @@ -0,0 +1,23 @@ +using System; +using KeraLua; + +namespace NLua.Event +{ + /// + /// Event args for hook callback event + /// + /// Reinhard Ostermeier + public class DebugHookEventArgs : EventArgs + { + readonly LuaDebug luaDebug; + + public DebugHookEventArgs(LuaDebug luaDebug) + { + this.luaDebug = luaDebug; + } + + public LuaDebug LuaDebug { + get { return luaDebug; } + } + } +} \ No newline at end of file diff --git a/src/Event/HookExceptionEventArgs.cs b/src/Event/HookExceptionEventArgs.cs new file mode 100644 index 0000000000000000000000000000000000000000..5488ac3cf77389a0ea4d79da126a29c8d6ad84e7 --- /dev/null +++ b/src/Event/HookExceptionEventArgs.cs @@ -0,0 +1,18 @@ +using System; + +namespace NLua.Event +{ + public class HookExceptionEventArgs : EventArgs + { + private readonly Exception m_Exception; + + public Exception Exception { + get { return m_Exception; } + } + + public HookExceptionEventArgs(Exception ex) + { + m_Exception = ex; + } + } +} \ No newline at end of file diff --git a/src/Exceptions/LuaException.cs b/src/Exceptions/LuaException.cs new file mode 100644 index 0000000000000000000000000000000000000000..59d79fa34b61a18dcbb3ed7f2c49b30dac568e86 --- /dev/null +++ b/src/Exceptions/LuaException.cs @@ -0,0 +1,24 @@ +using System; + +namespace NLua.Exceptions +{ + /// + /// Exceptions thrown by the Lua runtime + /// + [Serializable] + public class LuaException : Exception + { + public LuaException () + { + } + + public LuaException (string message) : base(message) + { + } + + public LuaException (string message, Exception innerException) : base(message, innerException) + { + } + + } +} \ No newline at end of file diff --git a/src/Exceptions/LuaScriptException.cs b/src/Exceptions/LuaScriptException.cs new file mode 100644 index 0000000000000000000000000000000000000000..d34a4e67349467e6d59627275830a126ce56a287 --- /dev/null +++ b/src/Exceptions/LuaScriptException.cs @@ -0,0 +1,56 @@ +using System; + +namespace NLua.Exceptions +{ + /// + /// Exceptions thrown by the Lua runtime because of errors in the script + /// + /// + [Serializable] + public class LuaScriptException : LuaException + { + /// + /// Returns true if the exception has occured as the result of a .NET exception in user code + /// + public bool IsNetException { get; private set; } + + private readonly string source; + + /// + /// The position in the script where the exception was triggered. + /// +#if SILVERLIGHT && !WINDOWS_PHONE + public string Source { get { return source; } } +#else + public override string Source { get { return source; } } +#endif + + /// + /// Creates a new Lua-only exception. + /// + /// The message that describes the error. + /// The position in the script where the exception was triggered. + public LuaScriptException(string message, string source) : base(message) + { + this.source = source; + } + + /// + /// Creates a new .NET wrapping exception. + /// + /// The .NET exception triggered by user-code. + /// The position in the script where the exception was triggered. + public LuaScriptException(Exception innerException, string source) + : base("A .NET exception occured in user-code", innerException) + { + this.source = source; + this.IsNetException = true; + } + + public override string ToString() + { + // Prepend the error source + return GetType().FullName + ": " + source + Message; + } + } +} \ No newline at end of file diff --git a/src/Extensions/GeneralExtensions.cs b/src/Extensions/GeneralExtensions.cs new file mode 100644 index 0000000000000000000000000000000000000000..6b090fe6b04eb7f56c2e004c2fdbb1100bfb8ea8 --- /dev/null +++ b/src/Extensions/GeneralExtensions.cs @@ -0,0 +1,163 @@ +using System; +using System.Linq; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.CompilerServices; + +namespace NLua.Extensions +{ + static class TypeExtensions + { + public static bool HasMethod(this Type t, string name) + { + var op = t.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static); + return op.Any(m => m.Name == name); + } + + public static bool HasAdditionOperator(this Type t) + { + if (t.IsPrimitive) + return true; + + return t.HasMethod("op_Addition"); + } + + public static bool HasSubtractionOperator(this Type t) + { + if (t.IsPrimitive) + return true; + + return t.HasMethod("op_Subtraction"); + } + + public static bool HasMultiplyOperator(this Type t) + { + if (t.IsPrimitive) + return true; + + return t.HasMethod("op_Multiply"); + } + + public static bool HasDivisionOperator(this Type t) + { + if (t.IsPrimitive) + return true; + + return t.HasMethod("op_Division"); + } + + public static bool HasModulusOperator(this Type t) + { + if (t.IsPrimitive) + return true; + + return t.HasMethod("op_Modulus"); + } + + public static bool HasUnaryNegationOperator(this Type t) + { + if (t.IsPrimitive) + return true; + // Unary - will always have only one version. + var op = t.GetMethod("op_UnaryNegation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static); + return op != null; + } + + public static bool HasEqualityOperator(this Type t) + { + if (t.IsPrimitive) + return true; + return t.HasMethod("op_Equality"); + } + + public static bool HasLessThanOperator(this Type t) + { + if (t.IsPrimitive) + return true; + + return t.HasMethod("op_LessThan"); + } + + public static bool HasLessThanOrEqualOperator(this Type t) + { + if (t.IsPrimitive) + return true; + return t.HasMethod("op_LessThanOrEqual"); + } + + public static MethodInfo[] GetMethods(this Type t, string name, BindingFlags flags) + { + return t.GetMethods(flags).Where(m => m.Name == name).ToArray(); + } + + public static MethodInfo[] GetExtensionMethods(this Type type, IEnumerable assemblies = null) + { + List types = new List(); + + types.AddRange(type.Assembly.GetTypes().Where(t => t.IsPublic)); + + if (assemblies != null) + { + foreach (Assembly item in assemblies) + { + if (item == type.Assembly) + continue; + types.AddRange(item.GetTypes().Where(t => t.IsPublic)); + } + } + + var query = from extensionType in types + where extensionType.IsSealed && !extensionType.IsGenericType && !extensionType.IsNested + from method in extensionType.GetMethods(BindingFlags.Static | BindingFlags.Public) + where method.IsDefined(typeof(ExtensionAttribute), false) + where (method.GetParameters()[0].ParameterType == type + || type.IsSubclassOf(method.GetParameters()[0].ParameterType) + || type.GetInterfaces().Contains(method.GetParameters()[0].ParameterType)) + select method; + return query.ToArray(); + } + + /// + /// Extends the System.Type-type to search for a given extended MethodeName. + /// + /// Name of the Methode + /// the found Method or null + public static MethodInfo GetExtensionMethod(this Type t, string name, IEnumerable assemblies = null) + { + var mi = from methode in t.GetExtensionMethods(assemblies) + where methode.Name == name + select methode; + if (!mi.Any()) + return null; + else + return mi.First(); + } + } + + static class StringExtensions + { + public static IEnumerable SplitWithEscape(this string input, char separator, char escapeCharacter) + { + int start = 0; + int index = 0; + while (index < input.Length) + { + index = input.IndexOf(separator, index); + if (index == -1) + break; + + if (input[index - 1] == escapeCharacter) + { + input = input.Remove(index - 1, 1); + continue; + } + + + yield return input.Substring(start, index - start); + index++; + start = index; + } + yield return input.Substring(start); + } + } +} \ No newline at end of file diff --git a/src/Extensions/LuaExtensions.cs b/src/Extensions/LuaExtensions.cs new file mode 100644 index 0000000000000000000000000000000000000000..d6c956a925f1b144dbda4ec51f3fe53500299bf7 --- /dev/null +++ b/src/Extensions/LuaExtensions.cs @@ -0,0 +1,121 @@ + +using System; +using System.Runtime.InteropServices; +using KeraLua; +using LuaState=KeraLua.Lua; + +namespace NLua.Extensions +{ + static class LuaExtensions + { + public static bool CheckMetaTable(this LuaState state, int index, IntPtr tag) + { + if (!state.GetMetaTable(index)) + return false; + + state.PushLightUserData(tag); + state.RawGet(-2); + bool isNotNil = !state.IsNil(-1); + state.SetTop(-3); + return isNotNil; + } + + public static void PopGlobalTable(this LuaState luaState) + { + luaState.RawSetInteger(LuaRegistry.Index, (long) LuaRegistryIndex.Globals); + } + + public static void GetRef (this LuaState luaState, int reference) + { + luaState.RawGetInteger(LuaRegistry.Index, reference); + } + + public static void Unref (this LuaState luaState, int reference) + { + luaState.Unref(LuaRegistry.Index, reference); + } + + public static bool AreEqual(this LuaState luaState, int ref1, int ref2) + { + return luaState.Compare(ref1, ref2, LuaCompare.Equal); + } + + public static IntPtr CheckUData(this LuaState state, int ud, string name) + { + IntPtr p = state.ToUserData(ud); + if (p == IntPtr.Zero) + return IntPtr.Zero; + if (!state.GetMetaTable(ud)) + return IntPtr.Zero; + + state.GetField(LuaRegistry.Index, name); + + bool isEqual = state.RawEqual(-1, -2); + + state.Pop(2); + + if (isEqual) + return p; + + return IntPtr.Zero; + } + + public static int ToNetObject(this LuaState state, int index, IntPtr tag) + { + if (state.Type(index) != LuaType.UserData) + return -1; + + IntPtr userData; + + if (state.CheckMetaTable(index, tag)) + { + userData = state.ToUserData(index); + if (userData != IntPtr.Zero) + return Marshal.ReadInt32(userData); + } + + userData = state.CheckUData(index, "luaNet_class"); + if (userData != IntPtr.Zero) + return Marshal.ReadInt32(userData); + + userData = state.CheckUData(index, "luaNet_searchbase"); + if (userData != IntPtr.Zero) + return Marshal.ReadInt32(userData); + + userData = state.CheckUData(index, "luaNet_function"); + if (userData != IntPtr.Zero) + return Marshal.ReadInt32(userData); + + return -1; + } + + public static void NewUData(this LuaState state, int val) + { + IntPtr pointer = state.NewUserData(Marshal.SizeOf(typeof(int))); + Marshal.WriteInt32(pointer, val); + } + + public static int RawNetObj(this LuaState state, int index) + { + IntPtr pointer = state.ToUserData(index); + if (pointer == IntPtr.Zero) + return -1; + + return Marshal.ReadInt32(pointer); + } + + public static int CheckUObject(this LuaState state, int index, string name) + { + IntPtr udata = state.CheckUData(index, name); + if (udata == IntPtr.Zero) + return -1; + + return Marshal.ReadInt32(udata); + } + + public static bool IsNumericType(this LuaState state, int index) + { + return state.Type(index) == LuaType.Number; + } + } +} diff --git a/src/GenerateEventAssembly/ClassGenerator.cs b/src/GenerateEventAssembly/ClassGenerator.cs new file mode 100644 index 0000000000000000000000000000000000000000..7241d72f7ebc5f53f5f169f6312d11524aac90a2 --- /dev/null +++ b/src/GenerateEventAssembly/ClassGenerator.cs @@ -0,0 +1,22 @@ +using System; +using LuaState = KeraLua.Lua; + +namespace NLua +{ + class ClassGenerator + { + private ObjectTranslator translator; + private Type klass; + + public ClassGenerator(ObjectTranslator objTranslator, Type typeClass) + { + translator = objTranslator; + klass = typeClass; + } + + public object ExtractGenerated(LuaState luaState, int stackPos) + { + return CodeGeneration.Instance.GetClassInstance(klass, translator.GetTable(luaState, stackPos)); + } + } +} \ No newline at end of file diff --git a/src/GenerateEventAssembly/CodeGeneration.cs b/src/GenerateEventAssembly/CodeGeneration.cs new file mode 100644 index 0000000000000000000000000000000000000000..2fa944b99bf381622fb3586ed235417b75861366 --- /dev/null +++ b/src/GenerateEventAssembly/CodeGeneration.cs @@ -0,0 +1,782 @@ +using System; +using System.Threading; +using System.Reflection; + +using NLua.Extensions; +using System.Reflection.Emit; +using System.Collections; +using System.Collections.Generic; +using NLua.Method; + +namespace NLua +{ + class CodeGeneration + { + private Dictionary classCollection = new Dictionary(); + private Dictionary delegateCollection = new Dictionary(); + private static readonly CodeGeneration instance = new CodeGeneration(); + private AssemblyName assemblyName; + +#if !(__IOS__ || __TVOS__ || __WATCHOS__) && !SILVERLIGHT && !NETSTANDARD + private Dictionary eventHandlerCollection = new Dictionary(); + private Type eventHandlerParent = typeof(LuaEventHandler); + private Type delegateParent = typeof(LuaDelegate); + private Type classHelper = typeof(LuaClassHelper); + private AssemblyBuilder newAssembly; + private ModuleBuilder newModule; + private int luaClassNumber = 1; +#endif + + static CodeGeneration() + { + } + + private CodeGeneration() + { + // Create an assembly name + assemblyName = new AssemblyName(); + assemblyName.Name = "NLua_generatedcode"; + // Create a new assembly with one module. +#if NETCOREAPP + newAssembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); + newModule = newAssembly.DefineDynamicModule("NLua_generatedcode"); +#elif !(__IOS__ || __TVOS__ || __WATCHOS__) && !NETSTANDARD + newAssembly = Thread.GetDomain().DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); + newModule = newAssembly.DefineDynamicModule("NLua_generatedcode"); +#endif + } + + /* + * Singleton instance of the class + */ + public static CodeGeneration Instance { + get { return instance; } + } + + /* + * Generates an event handler that calls a Lua function + */ + private Type GenerateEvent(Type eventHandlerType) + { +#if __IOS__ || __TVOS__ || __WATCHOS__ + throw new NotImplementedException (" Emit not available on Xamarin.iOS "); +#elif SILVERLIGHT + throw new NotImplementedException(" Emit not available on Silverlight "); +#elif NETSTANDARD + throw new NotImplementedException(" Emit not available on .NET Standard "); +#else + string typeName; + lock (this) + { + typeName = "LuaGeneratedClass" + luaClassNumber.ToString(); + luaClassNumber++; + } + + // Define a public class in the assembly, called typeName + var myType = newModule.DefineType(typeName, TypeAttributes.Public, eventHandlerParent); + + // Defines the handler method. Its signature is void(object, ) + var paramTypes = new Type[2]; + paramTypes[0] = typeof(object); + paramTypes[1] = eventHandlerType; + var returnType = typeof(void); + var handleMethod = myType.DefineMethod("HandleEvent", MethodAttributes.Public | MethodAttributes.HideBySig, returnType, paramTypes); + + // Emits the IL for the method. It loads the arguments + // and calls the handleEvent method of the base class + ILGenerator generator = handleMethod.GetILGenerator(); + generator.Emit(OpCodes.Ldarg_0); + generator.Emit(OpCodes.Ldarg_1); + generator.Emit(OpCodes.Ldarg_2); + var miGenericEventHandler = eventHandlerParent.GetMethod("HandleEvent"); + generator.Emit(OpCodes.Call, miGenericEventHandler); + // returns + generator.Emit(OpCodes.Ret); + // creates the new type + return myType.CreateType(); +#endif + } + + /* + * Generates a type that can be used for instantiating a delegate + * of the provided type, given a Lua function. + */ + private Type GenerateDelegate(Type delegateType) + { +#if __IOS__ || __TVOS__ || __WATCHOS__ + throw new NotImplementedException ("GenerateDelegate is not available on iOS, please register your LuaDelegate type with Lua.RegisterLuaDelegateType( yourDelegate, theLuaDelegateHandler) "); +#elif SILVERLIGHT + throw new NotImplementedException("GenerateDelegate is not available on Silverlight, please register your LuaDelegate type with Lua.RegisterLuaDelegateType( yourDelegate, theLuaDelegateHandler) "); +#elif NETSTANDARD + throw new NotImplementedException("GenerateDelegate is not available on Windows Store, please register your LuaDelegate type with Lua.RegisterLuaDelegateType( yourDelegate, theLuaDelegateHandler) "); +#else + string typeName; + lock (this) + { + typeName = "LuaGeneratedClass" + luaClassNumber.ToString(); + luaClassNumber++; + } + + // Define a public class in the assembly, called typeName + var myType = newModule.DefineType(typeName, TypeAttributes.Public, delegateParent); + + // Defines the delegate method with the same signature as the + // Invoke method of delegateType + var invokeMethod = delegateType.GetMethod("Invoke"); + var paramInfo = invokeMethod.GetParameters(); + var paramTypes = new Type[paramInfo.Length]; + var returnType = invokeMethod.ReturnType; + + // Counts out and ref params, for use later + int nOutParams = 0; + int nOutAndRefParams = 0; + + for (int i = 0; i < paramTypes.Length; i++) + { + paramTypes[i] = paramInfo[i].ParameterType; + + if ((!paramInfo[i].IsIn) && paramInfo[i].IsOut) + nOutParams++; + + if (paramTypes[i].IsByRef) + nOutAndRefParams++; + } + + int[] refArgs = new int[nOutAndRefParams]; + var delegateMethod = myType.DefineMethod("CallFunction", invokeMethod.Attributes, returnType, paramTypes); + + // Generates the IL for the method + ILGenerator generator = delegateMethod.GetILGenerator(); + generator.DeclareLocal(typeof(object[])); // original arguments + generator.DeclareLocal(typeof(object[])); // with out-only arguments removed + generator.DeclareLocal(typeof(int[])); // indexes of out and ref arguments + + if (!(returnType == typeof(void))) // return value + generator.DeclareLocal(returnType); + else + generator.DeclareLocal(typeof(object)); + + // Initializes local variables + generator.Emit(OpCodes.Ldc_I4, paramTypes.Length); + generator.Emit(OpCodes.Newarr, typeof(object)); + generator.Emit(OpCodes.Stloc_0); + generator.Emit(OpCodes.Ldc_I4, paramTypes.Length - nOutParams); + generator.Emit(OpCodes.Newarr, typeof(object)); + generator.Emit(OpCodes.Stloc_1); + generator.Emit(OpCodes.Ldc_I4, nOutAndRefParams); + generator.Emit(OpCodes.Newarr, typeof(int)); + generator.Emit(OpCodes.Stloc_2); + + // Stores the arguments in the local variables + for (int iArgs = 0, iInArgs = 0, iOutArgs = 0; iArgs < paramTypes.Length; iArgs++) + { + generator.Emit(OpCodes.Ldloc_0); + generator.Emit(OpCodes.Ldc_I4, iArgs); + generator.Emit(OpCodes.Ldarg, iArgs + 1); + + if (paramTypes[iArgs].IsByRef) + { + if (paramTypes[iArgs].GetElementType().IsValueType) + { + generator.Emit(OpCodes.Ldobj, paramTypes[iArgs].GetElementType()); + generator.Emit(OpCodes.Box, paramTypes[iArgs].GetElementType()); + } + else + generator.Emit(OpCodes.Ldind_Ref); + } + else + { + if (paramTypes[iArgs].IsValueType) + generator.Emit(OpCodes.Box, paramTypes[iArgs]); + } + + generator.Emit(OpCodes.Stelem_Ref); + + if (paramTypes[iArgs].IsByRef) + { + generator.Emit(OpCodes.Ldloc_2); + generator.Emit(OpCodes.Ldc_I4, iOutArgs); + generator.Emit(OpCodes.Ldc_I4, iArgs); + generator.Emit(OpCodes.Stelem_I4); + refArgs[iOutArgs] = iArgs; + iOutArgs++; + } + + if (paramInfo[iArgs].IsIn || (!paramInfo[iArgs].IsOut)) + { + generator.Emit(OpCodes.Ldloc_1); + generator.Emit(OpCodes.Ldc_I4, iInArgs); + generator.Emit(OpCodes.Ldarg, iArgs + 1); + + if (paramTypes[iArgs].IsByRef) + { + if (paramTypes[iArgs].GetElementType().IsValueType) + { + generator.Emit(OpCodes.Ldobj, paramTypes[iArgs].GetElementType()); + generator.Emit(OpCodes.Box, paramTypes[iArgs].GetElementType()); + } + else + generator.Emit(OpCodes.Ldind_Ref); + } + else + { + if (paramTypes[iArgs].IsValueType) + generator.Emit(OpCodes.Box, paramTypes[iArgs]); + } + + generator.Emit(OpCodes.Stelem_Ref); + iInArgs++; + } + } + + // Calls the callFunction method of the base class + generator.Emit(OpCodes.Ldarg_0); + generator.Emit(OpCodes.Ldloc_0); + generator.Emit(OpCodes.Ldloc_1); + generator.Emit(OpCodes.Ldloc_2); + var miGenericEventHandler = delegateParent.GetMethod("CallFunction"); + generator.Emit(OpCodes.Call, miGenericEventHandler); + + // Stores return value + if (returnType == typeof(void)) + { + generator.Emit(OpCodes.Pop); + generator.Emit(OpCodes.Ldnull); + } + else if (returnType.IsValueType) + { + generator.Emit(OpCodes.Unbox, returnType); + generator.Emit(OpCodes.Ldobj, returnType); + } + else + generator.Emit(OpCodes.Castclass, returnType); + + generator.Emit(OpCodes.Stloc_3); + + // Stores new value of out and ref params + for (int i = 0; i < refArgs.Length; i++) + { + generator.Emit(OpCodes.Ldarg, refArgs[i] + 1); + generator.Emit(OpCodes.Ldloc_0); + generator.Emit(OpCodes.Ldc_I4, refArgs[i]); + generator.Emit(OpCodes.Ldelem_Ref); + + if (paramTypes[refArgs[i]].GetElementType().IsValueType) + { + generator.Emit(OpCodes.Unbox, paramTypes[refArgs[i]].GetElementType()); + generator.Emit(OpCodes.Ldobj, paramTypes[refArgs[i]].GetElementType()); + generator.Emit(OpCodes.Stobj, paramTypes[refArgs[i]].GetElementType()); + } + else + { + generator.Emit(OpCodes.Castclass, paramTypes[refArgs[i]].GetElementType()); + generator.Emit(OpCodes.Stind_Ref); + } + } + + // Returns + if (!(returnType == typeof(void))) + generator.Emit(OpCodes.Ldloc_3); + + generator.Emit(OpCodes.Ret); + return myType.CreateType(); // creates the new type +#endif + } + + void GetReturnTypesFromClass(Type klass, out Type[][] returnTypes) + { + var classMethods = klass.GetMethods(); + returnTypes = new Type[classMethods.Length][]; + + int i = 0; + + foreach (var method in classMethods) + { + if (klass.IsInterface) + { + GetReturnTypesFromMethod(method, out returnTypes[i]); + i++; + } + else + { + if (!method.IsPrivate && !method.IsFinal && method.IsVirtual) + { + GetReturnTypesFromMethod(method, out returnTypes[i]); + i++; + } + } + } + } + + /* + * Generates an implementation of klass, if it is an interface, or + * a subclass of klass that delegates its virtual methods to a Lua table. + */ + public void GenerateClass(Type klass, out Type newType, out Type[][] returnTypes) + { +#if __IOS__ || __TVOS__ || __WATCHOS__ + throw new NotImplementedException (" Emit not available on Xamarin.iOS "); +#elif SILVERLIGHT + throw new NotImplementedException (" Emit not available on Silverlight "); +#elif NETSTANDARD + throw new NotImplementedException (" Emit not available on .NET Standard "); +#else + string typeName; + lock (this) + { + typeName = "LuaGeneratedClass" + luaClassNumber.ToString(); + luaClassNumber++; + } + + TypeBuilder myType; + // Define a public class in the assembly, called typeName + if (klass.IsInterface) + myType = newModule.DefineType(typeName, TypeAttributes.Public, typeof(object), new Type[] { + klass, + typeof(ILuaGeneratedType) + }); + else + myType = newModule.DefineType(typeName, TypeAttributes.Public, klass, new Type[] { typeof(ILuaGeneratedType) }); + + // Field that stores the Lua table + var luaTableField = myType.DefineField("__luaInterface_luaTable", typeof(LuaTable), FieldAttributes.Public); + // Field that stores the return types array + var returnTypesField = myType.DefineField("__luaInterface_returnTypes", typeof(Type[][]), FieldAttributes.Public); + // Generates the constructor for the new type, it takes a Lua table and an array + // of return types and stores them in the respective fields + var constructor = myType.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, new Type[] { + typeof(LuaTable), + typeof(Type[][]) + }); + ILGenerator generator = constructor.GetILGenerator(); + generator.Emit(OpCodes.Ldarg_0); + + if (klass.IsInterface) + generator.Emit(OpCodes.Call, typeof(object).GetConstructor(Type.EmptyTypes)); + else + generator.Emit(OpCodes.Call, klass.GetConstructor(Type.EmptyTypes)); + + generator.Emit(OpCodes.Ldarg_0); + generator.Emit(OpCodes.Ldarg_1); + generator.Emit(OpCodes.Stfld, luaTableField); + generator.Emit(OpCodes.Ldarg_0); + generator.Emit(OpCodes.Ldarg_2); + generator.Emit(OpCodes.Stfld, returnTypesField); + generator.Emit(OpCodes.Ret); + // Generates overriden versions of the klass' public virtual methods + var classMethods = klass.GetMethods(); + returnTypes = new Type[classMethods.Length][]; + int i = 0; + + foreach (var method in classMethods) + { + if (klass.IsInterface) + { + GenerateMethod(myType, method, MethodAttributes.HideBySig | MethodAttributes.Virtual | MethodAttributes.NewSlot, + i, luaTableField, returnTypesField, false, out returnTypes[i]); + i++; + } + else + { + if (!method.IsPrivate && !method.IsFinal && method.IsVirtual) + { + GenerateMethod(myType, method, (method.Attributes | MethodAttributes.NewSlot) ^ MethodAttributes.NewSlot, i, + luaTableField, returnTypesField, true, out returnTypes[i]); + i++; + } + } + } + + // Generates an implementation of the luaInterfaceGetLuaTable method + var returnTableMethod = myType.DefineMethod("LuaInterfaceGetLuaTable", + MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.Virtual, typeof(LuaTable), new Type[0]); + myType.DefineMethodOverride(returnTableMethod, typeof(ILuaGeneratedType).GetMethod("LuaInterfaceGetLuaTable")); + generator = returnTableMethod.GetILGenerator(); + generator.Emit(OpCodes.Ldfld, luaTableField); + generator.Emit(OpCodes.Ret); + newType = myType.CreateType(); // Creates the type +#endif + } + + void GetReturnTypesFromMethod(MethodInfo method, out Type[] returnTypes) + { + var paramInfo = method.GetParameters(); + var paramTypes = new Type[paramInfo.Length]; + var returnTypesList = new List(); + + // Counts out and ref parameters, for later use, + // and creates the list of return types + int nOutParams = 0; + int nOutAndRefParams = 0; + var returnType = method.ReturnType; + returnTypesList.Add(returnType); + + for (int i = 0; i < paramTypes.Length; i++) + { + paramTypes[i] = paramInfo[i].ParameterType; +#if SILVERLIGHT + if (paramInfo[i].IsOut) { +#else + if ((!paramInfo[i].IsIn) && paramInfo[i].IsOut) + { +#endif + nOutParams++; + } + + if (paramTypes[i].IsByRef) + { + returnTypesList.Add(paramTypes[i].GetElementType()); + nOutAndRefParams++; + } + } + + returnTypes = returnTypesList.ToArray(); + } + +#if !(__IOS__ || __TVOS__ || __WATCHOS__) && !SILVERLIGHT && !NETSTANDARD + + /* + * Generates an overriden implementation of method inside myType that delegates + * to a function in a Lua table with the same name, if the function exists. If it + * doesn't the method calls the base method (or does nothing, in case of interface + * implementations). + */ + private void GenerateMethod(TypeBuilder myType, MethodInfo method, MethodAttributes attributes, int methodIndex, + FieldInfo luaTableField, FieldInfo returnTypesField, bool generateBase, out Type[] returnTypes) + { + var paramInfo = method.GetParameters(); + var paramTypes = new Type[paramInfo.Length]; + var returnTypesList = new List(); + + // Counts out and ref parameters, for later use, + // and creates the list of return types + int nOutParams = 0; + int nOutAndRefParams = 0; + var returnType = method.ReturnType; + returnTypesList.Add(returnType); + + for (int i = 0; i < paramTypes.Length; i++) + { + paramTypes[i] = paramInfo[i].ParameterType; + if ((!paramInfo[i].IsIn) && paramInfo[i].IsOut) + nOutParams++; + + if (paramTypes[i].IsByRef) + { + returnTypesList.Add(paramTypes[i].GetElementType()); + nOutAndRefParams++; + } + } + + int[] refArgs = new int[nOutAndRefParams]; + returnTypes = returnTypesList.ToArray(); + + // Generates a version of the method that calls the base implementation + // directly, for use by the base field of the table + if (generateBase) + { + var baseMethod = myType.DefineMethod("__luaInterface_base_" + method.Name, + MethodAttributes.Private | MethodAttributes.NewSlot | MethodAttributes.HideBySig, + returnType, paramTypes); + ILGenerator generatorBase = baseMethod.GetILGenerator(); + generatorBase.Emit(OpCodes.Ldarg_0); + + for (int i = 0; i < paramTypes.Length; i++) + generatorBase.Emit(OpCodes.Ldarg, i + 1); + + generatorBase.Emit(OpCodes.Call, method); + + if (returnType == typeof(void)) + generatorBase.Emit(OpCodes.Pop); + + generatorBase.Emit(OpCodes.Ret); + } + + // Defines the method + var methodImpl = myType.DefineMethod(method.Name, attributes, returnType, paramTypes); + + // If it's an implementation of an interface tells what method it + // is overriding + if (myType.BaseType.Equals(typeof(object))) + myType.DefineMethodOverride(methodImpl, method); + + ILGenerator generator = methodImpl.GetILGenerator(); + generator.DeclareLocal(typeof(object[])); // original arguments + generator.DeclareLocal(typeof(object[])); // with out-only arguments removed + generator.DeclareLocal(typeof(int[])); // indexes of out and ref arguments + + if (!(returnType == typeof(void))) // return value + generator.DeclareLocal(returnType); + else + generator.DeclareLocal(typeof(object)); + + // Initializes local variables + generator.Emit(OpCodes.Ldc_I4, paramTypes.Length); + generator.Emit(OpCodes.Newarr, typeof(object)); + generator.Emit(OpCodes.Stloc_0); + generator.Emit(OpCodes.Ldc_I4, paramTypes.Length - nOutParams + 1); + generator.Emit(OpCodes.Newarr, typeof(object)); + generator.Emit(OpCodes.Stloc_1); + generator.Emit(OpCodes.Ldc_I4, nOutAndRefParams); + generator.Emit(OpCodes.Newarr, typeof(int)); + generator.Emit(OpCodes.Stloc_2); + generator.Emit(OpCodes.Ldloc_1); + generator.Emit(OpCodes.Ldc_I4_0); + generator.Emit(OpCodes.Ldarg_0); + generator.Emit(OpCodes.Ldfld, luaTableField); + generator.Emit(OpCodes.Stelem_Ref); + + // Stores the arguments into the local variables, as needed + for (int iArgs = 0, iInArgs = 1, iOutArgs = 0; iArgs < paramTypes.Length; iArgs++) + { + generator.Emit(OpCodes.Ldloc_0); + generator.Emit(OpCodes.Ldc_I4, iArgs); + generator.Emit(OpCodes.Ldarg, iArgs + 1); + + if (paramTypes[iArgs].IsByRef) + { + if (paramTypes[iArgs].GetElementType().IsValueType) + { + generator.Emit(OpCodes.Ldobj, paramTypes[iArgs].GetElementType()); + generator.Emit(OpCodes.Box, paramTypes[iArgs].GetElementType()); + } + else + generator.Emit(OpCodes.Ldind_Ref); + } + else + { + if (paramTypes[iArgs].IsValueType) + generator.Emit(OpCodes.Box, paramTypes[iArgs]); + } + + generator.Emit(OpCodes.Stelem_Ref); + + if (paramTypes[iArgs].IsByRef) + { + generator.Emit(OpCodes.Ldloc_2); + generator.Emit(OpCodes.Ldc_I4, iOutArgs); + generator.Emit(OpCodes.Ldc_I4, iArgs); + generator.Emit(OpCodes.Stelem_I4); + refArgs[iOutArgs] = iArgs; + iOutArgs++; + } + + if (paramInfo[iArgs].IsIn || (!paramInfo[iArgs].IsOut)) + { + generator.Emit(OpCodes.Ldloc_1); + generator.Emit(OpCodes.Ldc_I4, iInArgs); + generator.Emit(OpCodes.Ldarg, iArgs + 1); + + if (paramTypes[iArgs].IsByRef) + { + if (paramTypes[iArgs].GetElementType().IsValueType) + { + generator.Emit(OpCodes.Ldobj, paramTypes[iArgs].GetElementType()); + generator.Emit(OpCodes.Box, paramTypes[iArgs].GetElementType()); + } + else + generator.Emit(OpCodes.Ldind_Ref); + } + else + { + if (paramTypes[iArgs].IsValueType) + generator.Emit(OpCodes.Box, paramTypes[iArgs]); + } + + generator.Emit(OpCodes.Stelem_Ref); + iInArgs++; + } + } + + // Gets the function the method will delegate to by calling + // the getTableFunction method of class LuaClassHelper + generator.Emit(OpCodes.Ldarg_0); + generator.Emit(OpCodes.Ldfld, luaTableField); + generator.Emit(OpCodes.Ldstr, method.Name); + generator.Emit(OpCodes.Call, classHelper.GetMethod("GetTableFunction")); + var lab1 = generator.DefineLabel(); + generator.Emit(OpCodes.Dup); + generator.Emit(OpCodes.Brtrue_S, lab1); + // Function does not exist, call base method + generator.Emit(OpCodes.Pop); + + if (!method.IsAbstract) + { + generator.Emit(OpCodes.Ldarg_0); + + for (int i = 0; i < paramTypes.Length; i++) + generator.Emit(OpCodes.Ldarg, i + 1); + + generator.Emit(OpCodes.Call, method); + + if (returnType == typeof(void)) + generator.Emit(OpCodes.Pop); + + generator.Emit(OpCodes.Ret); + generator.Emit(OpCodes.Ldnull); + } + else + generator.Emit(OpCodes.Ldnull); + + var lab2 = generator.DefineLabel(); + generator.Emit(OpCodes.Br_S, lab2); + generator.MarkLabel(lab1); + // Function exists, call using method callFunction of LuaClassHelper + generator.Emit(OpCodes.Ldloc_0); + generator.Emit(OpCodes.Ldarg_0); + generator.Emit(OpCodes.Ldfld, returnTypesField); + generator.Emit(OpCodes.Ldc_I4, methodIndex); + generator.Emit(OpCodes.Ldelem_Ref); + generator.Emit(OpCodes.Ldloc_1); + generator.Emit(OpCodes.Ldloc_2); + generator.Emit(OpCodes.Call, classHelper.GetMethod("CallFunction")); + generator.MarkLabel(lab2); + + // Stores the function return value + if (returnType == typeof(void)) + { + generator.Emit(OpCodes.Pop); + generator.Emit(OpCodes.Ldnull); + } + else if (returnType.IsValueType) + { + generator.Emit(OpCodes.Unbox, returnType); + generator.Emit(OpCodes.Ldobj, returnType); + } + else + generator.Emit(OpCodes.Castclass, returnType); + + generator.Emit(OpCodes.Stloc_3); + + // Sets return values of out and ref parameters + for (int i = 0; i < refArgs.Length; i++) + { + generator.Emit(OpCodes.Ldarg, refArgs[i] + 1); + generator.Emit(OpCodes.Ldloc_0); + generator.Emit(OpCodes.Ldc_I4, refArgs[i]); + generator.Emit(OpCodes.Ldelem_Ref); + + if (paramTypes[refArgs[i]].GetElementType().IsValueType) + { + generator.Emit(OpCodes.Unbox, paramTypes[refArgs[i]].GetElementType()); + generator.Emit(OpCodes.Ldobj, paramTypes[refArgs[i]].GetElementType()); + generator.Emit(OpCodes.Stobj, paramTypes[refArgs[i]].GetElementType()); + } + else + { + generator.Emit(OpCodes.Castclass, paramTypes[refArgs[i]].GetElementType()); + generator.Emit(OpCodes.Stind_Ref); + } + } + + // Returns + if (!(returnType == typeof(void))) + generator.Emit(OpCodes.Ldloc_3); + + generator.Emit(OpCodes.Ret); + } +#endif + /* + * Gets an event handler for the event type that delegates to the eventHandler Lua function. + * Caches the generated type. + */ + public LuaEventHandler GetEvent(Type eventHandlerType, LuaFunction eventHandler) + { +#if __IOS__ || __TVOS__ || __WATCHOS__ + throw new NotImplementedException (" Emit not available on Xamarin.iOS "); +#elif SILVERLIGHT + throw new NotImplementedException (" Emit not available on Silverlight "); +#elif NETSTANDARD + throw new NotImplementedException (" Emit not available on .NET Standard "); +#else + Type eventConsumerType; + + if (eventHandlerCollection.ContainsKey(eventHandlerType)) + eventConsumerType = eventHandlerCollection[eventHandlerType]; + else + { + eventConsumerType = GenerateEvent(eventHandlerType); + eventHandlerCollection[eventHandlerType] = eventConsumerType; + } + + var luaEventHandler = (LuaEventHandler)Activator.CreateInstance(eventConsumerType); + luaEventHandler.handler = eventHandler; + return luaEventHandler; +#endif + } + + public void RegisterLuaDelegateType(Type delegateType, Type luaDelegateType) + { + delegateCollection[delegateType] = luaDelegateType; + } + + public void RegisterLuaClassType(Type klass, Type luaClass) + { + LuaClassType luaClassType = new LuaClassType(); + luaClassType.klass = luaClass; + GetReturnTypesFromClass(klass, out luaClassType.returnTypes); + classCollection[klass] = luaClassType; + } + /* + * Gets a delegate with delegateType that calls the luaFunc Lua function + * Caches the generated type. + */ + public Delegate GetDelegate(Type delegateType, LuaFunction luaFunc) + { + var returnTypes = new List(); + Type luaDelegateType; + + if (delegateCollection.ContainsKey(delegateType)) + luaDelegateType = delegateCollection[delegateType]; + else + { + luaDelegateType = GenerateDelegate(delegateType); + delegateCollection[delegateType] = luaDelegateType; + } + + var methodInfo = delegateType.GetMethod("Invoke"); + returnTypes.Add(methodInfo.ReturnType); + + foreach (ParameterInfo paramInfo in methodInfo.GetParameters()) + { + if (paramInfo.ParameterType.IsByRef) + returnTypes.Add(paramInfo.ParameterType); + } + + var luaDelegate = (LuaDelegate)Activator.CreateInstance(luaDelegateType); + luaDelegate.function = luaFunc; + luaDelegate.returnTypes = returnTypes.ToArray(); +#if NETFX_CORE + var mi = luaDelegate.GetType ().GetTypeInfo ().GetDeclaredMethod ("CallFunction"); + return mi.CreateDelegate (delegateType, luaDelegate); +#else + return Delegate.CreateDelegate(delegateType, luaDelegate, "CallFunction"); +#endif + } + + /* + * Gets an instance of an implementation of the klass interface or + * subclass of klass that delegates public virtual methods to the + * luaTable table. + * Caches the generated type. + */ + public object GetClassInstance(Type klass, LuaTable luaTable) + { + LuaClassType luaClassType; + + if (classCollection.ContainsKey(klass)) + luaClassType = classCollection[klass]; + else + { + luaClassType = new LuaClassType(); + GenerateClass(klass, out luaClassType.klass, out luaClassType.returnTypes); + classCollection[klass] = luaClassType; + } + + return Activator.CreateInstance(luaClassType.klass, new object[] { + luaTable, + luaClassType.returnTypes + }); + } + } +} \ No newline at end of file diff --git a/src/GenerateEventAssembly/DelegateGenerator.cs b/src/GenerateEventAssembly/DelegateGenerator.cs new file mode 100644 index 0000000000000000000000000000000000000000..a6375e2f1f507043893fdfc90e8b0c4c20a09127 --- /dev/null +++ b/src/GenerateEventAssembly/DelegateGenerator.cs @@ -0,0 +1,23 @@ +using System; +using LuaState = KeraLua.Lua; + +namespace NLua +{ + class DelegateGenerator + { + private ObjectTranslator translator; + private Type delegateType; + + + public DelegateGenerator(ObjectTranslator objectTranslator, Type type) + { + translator = objectTranslator; + delegateType = type; + } + + public object ExtractGenerated(LuaState luaState, int stackPos) + { + return CodeGeneration.Instance.GetDelegate(delegateType, translator.GetFunction(luaState, stackPos)); + } + } +} \ No newline at end of file diff --git a/src/GenerateEventAssembly/ILuaGeneratedType.cs b/src/GenerateEventAssembly/ILuaGeneratedType.cs new file mode 100644 index 0000000000000000000000000000000000000000..37499e123ffb25fe256b563f74e6ec7e15c57c0f --- /dev/null +++ b/src/GenerateEventAssembly/ILuaGeneratedType.cs @@ -0,0 +1,11 @@ +namespace NLua +{ + /* + * Common interface for types generated from tables. The method + * returns the table that overrides some or all of the type's methods. + */ + public interface ILuaGeneratedType + { + LuaTable LuaInterfaceGetLuaTable(); + } +} \ No newline at end of file diff --git a/src/GenerateEventAssembly/LuaClassType.cs b/src/GenerateEventAssembly/LuaClassType.cs new file mode 100644 index 0000000000000000000000000000000000000000..8b861d7271973151ec1243045c5d9f07375ea743 --- /dev/null +++ b/src/GenerateEventAssembly/LuaClassType.cs @@ -0,0 +1,15 @@ +using System; + +namespace NLua +{ + /* + * Structure to store a type and the return types of + * its methods (the type of the returned value and out/ref + * parameters). + */ + struct LuaClassType + { + public Type klass; + public Type[][] returnTypes; + } +} \ No newline at end of file diff --git a/src/Lua.cs b/src/Lua.cs new file mode 100644 index 0000000000000000000000000000000000000000..3b7361b14376c89a675aa931a8435ae8839473ce --- /dev/null +++ b/src/Lua.cs @@ -0,0 +1,1234 @@ +using System; +using System.Linq; +using System.Reflection; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using KeraLua; + +using NLua.Event; +using NLua.Method; +using NLua.Exceptions; +using NLua.Extensions; + +#if __IOS__ || __TVOS__ || __WATCHOS__ + using ObjCRuntime; +#endif + +using LuaState = KeraLua.Lua; +using LuaNativeFunction = KeraLua.LuaFunction; + + +namespace NLua +{ + public class Lua : IDisposable + { + #region lua debug functions + /// + /// Event that is raised when an exception occures during a hook call. + /// + public event EventHandler HookException; + /// + /// Event when lua hook callback is called + /// + /// + /// Is only raised if SetDebugHook is called before. + /// + public event EventHandler DebugHook; + /// + /// lua hook calback delegate + /// + private LuaHookFunction hookCallback = null; + #endregion + #region Globals auto-complete + private readonly List globals = new List(); + private bool globalsSorted; + #endregion + private LuaState luaState; + /// + /// True while a script is being executed + /// + public bool IsExecuting { get { return executing; } } + + public LuaState State => luaState; + + private LuaNativeFunction panicCallback; + private ObjectTranslator translator; + /// + /// Used to protect the (global) object translator pool during add/remove + /// + private static readonly object translatorPoolLock = new object(); + + /// + /// Used to ensure multiple .net threads all get serialized by this single lock for access to the lua stack/objects + /// + //private object luaLock = new object(); + private bool _StatePassed; + private bool executing; + static string initLuanet = + @"local metatable = {} + local rawget = rawget + local import_type = luanet.import_type + local load_assembly = luanet.load_assembly + luanet.error, luanet.type = error, type + -- Lookup a .NET identifier component. + function metatable:__index(key) -- key is e.g. 'Form' + -- Get the fully-qualified name, e.g. 'System.Windows.Forms.Form' + local fqn = rawget(self,'.fqn') + fqn = ((fqn and fqn .. '.') or '') .. key + + -- Try to find either a luanet function or a CLR type + local obj = rawget(luanet,key) or import_type(fqn) + + -- If key is neither a luanet function or a CLR type, then it is simply + -- an identifier component. + if obj == nil then + -- It might be an assembly, so we load it too. + pcall(load_assembly,fqn) + obj = { ['.fqn'] = fqn } + setmetatable(obj, metatable) + end + + -- Cache this lookup + rawset(self, key, obj) + return obj + end + + -- A non-type has been called; e.g. foo = System.Foo() + function metatable:__call(...) + error('No such type: ' .. rawget(self,'.fqn'), 2) + end + + -- This is the root of the .NET namespace + luanet['.fqn'] = false + setmetatable(luanet, metatable) + + -- Preload the mscorlib assembly + luanet.load_assembly('mscorlib')"; + + static string clr_package = @"--- +--- This lua module provides auto importing of .net classes into a named package. +--- Makes for super easy use of LuaInterface glue +--- +--- example: +--- Threading = CLRPackage(""System"", ""System.Threading"") +--- Threading.Thread.Sleep(100) +--- +--- Extensions: +--- import() is a version of CLRPackage() which puts the package into a list which is used by a global __index lookup, +--- and thus works rather like C#'s using statement. It also recognizes the case where one is importing a local +--- assembly, which must end with an explicit .dll extension. + +--- Alternatively, luanet.namespace can be used for convenience without polluting the global namespace: +--- local sys,sysi = luanet.namespace {'System','System.IO'} +-- sys.Console.WriteLine(""we are at {0}"",sysi.Directory.GetCurrentDirectory()) + + +-- LuaInterface hosted with stock Lua interpreter will need to explicitly require this... +if not luanet then require 'luanet' end + +local import_type, load_assembly = luanet.import_type, luanet.load_assembly + +local mt = { + --- Lookup a previously unfound class and add it to our table + __index = function(package, classname) + local class = rawget(package, classname) + if class == nil then + class = import_type(package.packageName .. ""."" .. classname) + if class == nil then class = import_type(classname) end + package[classname] = class -- keep what we found around, so it will be shared + end + return class + end +} + +function luanet.namespace(ns) + if type(ns) == 'table' then + local res = {} + for i = 1,#ns do + res[i] = luanet.namespace(ns[i]) + end + return unpack(res) + end + -- FIXME - table.packageName could instead be a private index (see Lua 13.4.4) + local t = { packageName = ns } + setmetatable(t,mt) + return t +end + +local globalMT, packages + +local function set_global_mt() + packages = {} + globalMT = { + __index = function(T,classname) + for i,package in ipairs(packages) do + local class = package[classname] + if class then + _G[classname] = class + return class + end + end + end + } + setmetatable(_G, globalMT) +end + +--- Create a new Package class +function CLRPackage(assemblyName, packageName) + -- a sensible default... + packageName = packageName or assemblyName + local ok = pcall(load_assembly,assemblyName) -- Make sure our assembly is loaded + return luanet.namespace(packageName) +end + +function import (assemblyName, packageName) + if not globalMT then + set_global_mt() + end + if not packageName then + local i = assemblyName:find('%.dll$') + if i then packageName = assemblyName:sub(1,i-1) + else packageName = assemblyName end + end + local t = CLRPackage(assemblyName,packageName) + table.insert(packages,t) + return t +end + + +function luanet.make_array (tp,tbl) + local arr = tp[#tbl] + for i,v in ipairs(tbl) do + arr:SetValue(v,i-1) + end + return arr +end + +function luanet.each(o) + local e = o:GetEnumerator() + return function() + if e:MoveNext() then + return e.Current + end + end +end +"; + public bool UseTraceback { get; set; } = false; + + #region Globals auto-complete + /// + /// An alphabetically sorted list of all globals (objects, methods, etc.) externally added to this Lua instance + /// + /// Members of globals are also listed. The formatting is optimized for text input auto-completion. + public IEnumerable Globals { + get + { + // Only sort list when necessary + if (!globalsSorted) + { + globals.Sort(); + globalsSorted = true; + } + + return globals; + } + } + #endregion + + public Lua() + { + luaState = new LuaState(); + Init(); + // We need to keep this in a managed reference so the delegate doesn't get garbage collected + panicCallback = PanicCallback; + luaState.AtPanic(panicCallback); + } + + /* + * CAUTION: NLua.Lua instances can't share the same lua state! + */ + public Lua(LuaState luaState) + { + luaState.PushString("NLua_Loaded"); + luaState.GetTable((int)LuaRegistry.Index); + + if (luaState.ToBoolean(-1)) + { + luaState.SetTop(-2); + throw new LuaException("There is already a NLua.Lua instance associated with this Lua state"); + } + else + { + this.luaState = luaState; + _StatePassed = true; + luaState.SetTop(-2); + Init(); + } + } + + void Init() + { + luaState.PushString("NLua_Loaded"); + luaState.PushBoolean(true); + luaState.SetTable((int)LuaRegistry.Index); + if (_StatePassed == false) + { + luaState.NewTable(); + luaState.SetGlobal("luanet"); + } + luaState.PushGlobalTable(); + luaState.GetGlobal("luanet"); + luaState.PushString("getmetatable"); + luaState.GetGlobal("getmetatable"); + luaState.SetTable(-3); + luaState.PopGlobalTable(); + translator = new ObjectTranslator(this, luaState); + lock (translatorPoolLock) + { + ObjectTranslatorPool.Instance.Add(luaState, translator); + } + luaState.PopGlobalTable(); + luaState.DoString(initLuanet); + } + + public void Close() + { + if (_StatePassed) + return; + + if (luaState != null) + { + lock (translatorPoolLock) + { + luaState.Close(); + ObjectTranslatorPool.Instance.Remove(luaState); + luaState = null; + } + } + } + +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + static int PanicCallback(IntPtr state) + { + var luaState = LuaState.FromIntPtr(state); + string reason = string.Format("Unprotected error in call to Lua API ({0})", luaState.ToString(-1)); + throw new LuaException(reason); + } + + /// + /// Assuming we have a Lua error string sitting on the stack, throw a C# exception out to the user's app + /// + /// Thrown if the script caused an exception + private void ThrowExceptionFromError(int oldTop) + { + object err = translator.GetObject(luaState, -1); + luaState.SetTop(oldTop); + + // A pre-wrapped exception - just rethrow it (stack trace of InnerException will be preserved) + var luaEx = err as LuaScriptException; + + if (luaEx != null) + throw luaEx; + + // A non-wrapped Lua error (best interpreted as a string) - wrap it and throw it + if (err == null) + err = "Unknown Lua Error"; + + throw new LuaScriptException(err.ToString(), string.Empty); + } + + /// + /// Push a debug.traceback reference onto the stack, for a pcall function to use as error handler. (Remember to increment any top-of-stack markers!) + /// + private static int PushDebugTraceback(LuaState luaState, int argCount) + { + luaState.GetGlobal("debug"); + luaState.GetField(-1, "traceback"); + luaState.Remove(-2); + int errindex = -argCount - 2; + luaState.Insert(errindex); + return errindex; + } + + /// + /// Return a debug.traceback() call result (a multi-line string, containing a full stack trace, including C calls. + /// Note: it won't return anything unless the interpreter is in the middle of execution - that is, it only makes sense to call it from a method called from Lua, or during a coroutine yield. + /// + public string GetDebugTraceback() + { + int oldTop = luaState.GetTop(); + luaState.GetGlobal("debug"); // stack: debug + luaState.GetField(-1, "traceback"); // stack: debug,traceback + luaState.Remove(-2); // stack: traceback + luaState.PCall(0, -1, 0); + return translator.PopValues(luaState, oldTop)[0] as string; + } + + /// + /// Convert C# exceptions into Lua errors + /// + /// num of things on stack + /// null for no pending exception + internal int SetPendingException(Exception e) + { + var caughtExcept = e; + + if (caughtExcept != null) + { + translator.ThrowError(luaState, caughtExcept); + luaState.PushNil(); + return 1; + } + else + return 0; + } + + /// + /// + /// + /// + /// + /// + public LuaFunction LoadString(string chunk, string name) + { + int oldTop = luaState.GetTop(); + executing = true; + + try + { + if (luaState.LoadString(chunk, name) != LuaStatus.OK) + ThrowExceptionFromError(oldTop); + } + finally + { + executing = false; + } + + var result = translator.GetFunction(luaState, -1); + translator.PopValues(luaState, oldTop); + return result; + } + + /// + /// + /// + /// + /// + /// + public LuaFunction LoadString(byte[] chunk, string name) + { + int oldTop = luaState.GetTop(); + executing = true; + + try + { + if (luaState.LoadBuffer(chunk, name) != LuaStatus.OK) + ThrowExceptionFromError(oldTop); + } + finally + { + executing = false; + } + + var result = translator.GetFunction(luaState, -1); + translator.PopValues(luaState, oldTop); + return result; + } + + /// + /// Load a File on, and return a LuaFunction to execute the file loaded (useful to see if the syntax of a file is ok) + /// + /// + /// + public LuaFunction LoadFile(string fileName) + { + int oldTop = luaState.GetTop(); + + if (luaState.LoadFile(fileName) != LuaStatus.OK) + ThrowExceptionFromError(oldTop); + + var result = translator.GetFunction(luaState, -1); + translator.PopValues(luaState, oldTop); + return result; + } + + /// + /// Executes a Lua chunk and returns all the chunk's return values in an array. + /// + /// Chunk to execute + /// Name to associate with the chunk. Defaults to "chunk". + /// + public object[] DoString(byte[] chunk, string chunkName = "chunk") + { + int oldTop = luaState.GetTop(); + executing = true; + + if (luaState.LoadBuffer(chunk, chunkName) == LuaStatus.OK) + { + int errfunction = 0; + if (UseTraceback) + { + errfunction = PushDebugTraceback(luaState, 0); + oldTop++; + } + + try + { + if (luaState.PCall(0, -1, errfunction) == LuaStatus.OK) + return translator.PopValues(luaState, oldTop); + else + ThrowExceptionFromError(oldTop); + } + finally + { + executing = false; + } + } + else + ThrowExceptionFromError(oldTop); + + return null; + } + + /// + /// Executes a Lua chunk and returns all the chunk's return values in an array. + /// + /// Chunk to execute + /// Name to associate with the chunk. Defaults to "chunk". + /// + public object[] DoString(string chunk, string chunkName = "chunk") + { + int oldTop = luaState.GetTop(); + executing = true; + + if (luaState.LoadString(chunk, chunkName) == LuaStatus.OK) + { + int errfunction = 0; + if (UseTraceback) + { + errfunction = PushDebugTraceback(luaState, 0); + oldTop++; + } + + try + { + if (luaState.PCall(0, -1, errfunction) == LuaStatus.OK) + return translator.PopValues(luaState, oldTop); + else + ThrowExceptionFromError(oldTop); + } + finally + { + executing = false; + } + } + else + ThrowExceptionFromError(oldTop); + + return null; + } + + /* + * Excutes a Lua file and returns all the chunk's return + * values in an array + */ + public object[] DoFile(string fileName) + { + int oldTop = luaState.GetTop(); + + if (luaState.LoadFile(fileName) == LuaStatus.OK) + { + executing = true; + + int errfunction = 0; + if (UseTraceback) + { + errfunction = PushDebugTraceback(luaState, 0); + oldTop++; + } + + try + { + if (luaState.PCall(0, -1, errfunction) == LuaStatus.OK) + return translator.PopValues(luaState, oldTop); + else + ThrowExceptionFromError(oldTop); + } + finally + { + executing = false; + } + } + else + ThrowExceptionFromError(oldTop); + + return null; + } + + + /* + * Indexer for global variables from the LuaInterpreter + * Supports navigation of tables by using . operator + */ + public object this[string fullPath] { + get + { + object returnValue = null; + int oldTop = luaState.GetTop(); + string[] path = FullPathToArray(fullPath); + luaState.GetGlobal(path[0]); + returnValue = translator.GetObject(luaState, -1); + + if (path.Length > 1) + { + var dispose = returnValue as LuaBase; + string[] remainingPath = new string[path.Length - 1]; + Array.Copy(path, 1, remainingPath, 0, path.Length - 1); + returnValue = GetObject(remainingPath); + if (dispose != null) + dispose.Dispose(); + } + + luaState.SetTop(oldTop); + return returnValue; + } + set + { + int oldTop = luaState.GetTop(); + string[] path = FullPathToArray(fullPath); + if (path.Length == 1) + { + translator.Push(luaState, value); + luaState.SetGlobal(fullPath); + } + else + { + luaState.GetGlobal(path[0]); + string[] remainingPath = new string[path.Length - 1]; + Array.Copy(path, 1, remainingPath, 0, path.Length - 1); + SetObject(remainingPath, value); + } + + luaState.SetTop(oldTop); + + // Globals auto-complete + if (value == null) + { + // Remove now obsolete entries + globals.Remove(fullPath); + } + else + { + // Add new entries + if (!globals.Contains(fullPath)) + RegisterGlobal(fullPath, value.GetType(), 0); + } + } + } + + #region Globals auto-complete + /// + /// Adds an entry to (recursivley handles 2 levels of members) + /// + /// The index accessor path ot the entry + /// The type of the entry + /// How deep have we gone with recursion? + private void RegisterGlobal(string path, Type type, int recursionCounter) + { + // If the type is a global method, list it directly + if (type == typeof(LuaFunction)) + { + // Format for easy method invocation + globals.Add(path + "("); + } + // If the type is a class or an interface and recursion hasn't been running too long, list the members + else if ((type.IsClass || type.IsInterface) && type != typeof(string) && recursionCounter < 2) + { + #region Methods + foreach (var method in type.GetMethods(BindingFlags.Public | BindingFlags.Instance)) + { + string name = method.Name; + if ( + // Check that the LuaHideAttribute and LuaGlobalAttribute were not applied + (!method.GetCustomAttributes(typeof(LuaHideAttribute), false).Any()) && + (!method.GetCustomAttributes(typeof(LuaGlobalAttribute), false).Any()) && + // Exclude some generic .NET methods that wouldn't be very usefull in Lua + name != "GetType" && name != "GetHashCode" && name != "Equals" && + name != "ToString" && name != "Clone" && name != "Dispose" && + name != "GetEnumerator" && name != "CopyTo" && + !name.StartsWith("get_", StringComparison.Ordinal) && + !name.StartsWith("set_", StringComparison.Ordinal) && + !name.StartsWith("add_", StringComparison.Ordinal) && + !name.StartsWith("remove_", StringComparison.Ordinal)) + { + // Format for easy method invocation + string command = path + ":" + name + "("; + + if (method.GetParameters().Length == 0) + command += ")"; + globals.Add(command); + } + } + #endregion + + #region Fields + foreach (var field in type.GetFields(BindingFlags.Public | BindingFlags.Instance)) + { + if ( + // Check that the LuaHideAttribute and LuaGlobalAttribute were not applied + (!field.GetCustomAttributes(typeof(LuaHideAttribute), false).Any()) && + (!field.GetCustomAttributes(typeof(LuaGlobalAttribute), false).Any())) + { + // Go into recursion for members + RegisterGlobal(path + "." + field.Name, field.FieldType, recursionCounter + 1); + } + } + #endregion + + #region Properties + foreach (var property in type.GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + if ( + // Check that the LuaHideAttribute and LuaGlobalAttribute were not applied + (!property.GetCustomAttributes(typeof(LuaHideAttribute), false).Any()) && + (!property.GetCustomAttributes(typeof(LuaGlobalAttribute), false).Any()) + // Exclude some generic .NET properties that wouldn't be very useful in Lua + && property.Name != "Item") + { + // Go into recursion for members + RegisterGlobal(path + "." + property.Name, property.PropertyType, recursionCounter + 1); + } + } + #endregion + } + else + globals.Add(path); // Otherwise simply add the element to the list + + // List will need to be sorted on next access + globalsSorted = false; + } + #endregion + + /* + * Navigates a table in the top of the stack, returning + * the value of the specified field + */ + object GetObject(string[] remainingPath) + { + object returnValue = null; + + for (int i = 0; i < remainingPath.Length; i++) + { + luaState.PushString(remainingPath[i]); + luaState.GetTable(-2); + returnValue = translator.GetObject(luaState, -1); + + if (returnValue == null) + break; + } + + return returnValue; + } + + /* + * Gets a numeric global variable + */ + public double GetNumber(string fullPath) + { + return (double)this[fullPath]; + } + + /* + * Gets a string global variable + */ + public string GetString(string fullPath) + { + return this[fullPath].ToString(); + } + + /* + * Gets a table global variable + */ + public LuaTable GetTable(string fullPath) + { + return (LuaTable)this[fullPath]; + } + + /* + * Gets a table global variable as an object implementing + * the interfaceType interface + */ + public object GetTable(Type interfaceType, string fullPath) + { + return CodeGeneration.Instance.GetClassInstance(interfaceType, GetTable(fullPath)); + } + + /* + * Gets a function global variable + */ + public LuaFunction GetFunction(string fullPath) + { + object obj = this[fullPath]; + LuaFunction luaFunction = obj as LuaFunction; + if (luaFunction != null) + return luaFunction; + + luaFunction = new LuaFunction((LuaNativeFunction) obj, this); + return luaFunction; + } + + /* + * Register a delegate type to be used to convert Lua functions to C# delegates (useful for iOS where there is no dynamic code generation) + * type delegateType + */ + public void RegisterLuaDelegateType(Type delegateType, Type luaDelegateType) + { + CodeGeneration.Instance.RegisterLuaDelegateType(delegateType, luaDelegateType); + } + + public void RegisterLuaClassType(Type klass, Type luaClass) + { + CodeGeneration.Instance.RegisterLuaClassType(klass, luaClass); + } + + public void LoadCLRPackage() + { + luaState.DoString(Lua.clr_package); + } + /* + * Gets a function global variable as a delegate of + * type delegateType + */ + public Delegate GetFunction(Type delegateType, string fullPath) + { + return CodeGeneration.Instance.GetDelegate(delegateType, GetFunction(fullPath)); + } + + /* + * Calls the object as a function with the provided arguments, + * returning the function's returned values inside an array + */ + internal object[] CallFunction(object function, object[] args) + { + return CallFunction(function, args, null); + } + + /* + * Calls the object as a function with the provided arguments and + * casting returned values to the types in returnTypes before returning + * them in an array + */ + internal object[] CallFunction(object function, object[] args, Type[] returnTypes) + { + int nArgs = 0; + int oldTop = luaState.GetTop(); + + if (!luaState.CheckStack(args.Length + 6)) + throw new LuaException("Lua stack overflow"); + + translator.Push(luaState, function); + + if (args.Length > 0) + { + nArgs = args.Length; + + for (int i = 0; i < args.Length; i++) + translator.Push(luaState, args[i]); + } + + executing = true; + + try + { + int errfunction = 0; + if (UseTraceback) + { + errfunction = PushDebugTraceback(luaState, nArgs); + oldTop++; + } + + LuaStatus error = luaState.PCall(nArgs, -1, errfunction); + if (error != LuaStatus.OK) + ThrowExceptionFromError(oldTop); + } + finally + { + executing = false; + } + + if (returnTypes != null) + return translator.PopValues(luaState, oldTop, returnTypes); + + return translator.PopValues(luaState, oldTop); + } + + /* + * Navigates a table to set the value of one of its fields + */ + void SetObject(string[] remainingPath, object val) + { + for (int i = 0; i < remainingPath.Length - 1; i++) + { + luaState.PushString(remainingPath[i]); + luaState.GetTable(-2); + } + + luaState.PushString(remainingPath[remainingPath.Length - 1]); + translator.Push(luaState, val); + luaState.SetTable(-3); + } + + string[] FullPathToArray(string fullPath) + { + return fullPath.SplitWithEscape('.', '\\').ToArray(); + } + /* + * Creates a new table as a global variable or as a field + * inside an existing table + */ + public void NewTable(string fullPath) + { + string[] path = FullPathToArray(fullPath); + int oldTop = luaState.GetTop(); + + if (path.Length == 1) + { + luaState.NewTable(); + luaState.SetGlobal(fullPath); + } + else + { + luaState.GetGlobal(path[0]); + + for (int i = 1; i < path.Length - 1; i++) + { + luaState.PushString(path[i]); + luaState.GetTable(-2); + } + + luaState.PushString(path[path.Length - 1]); + luaState.NewTable(); + luaState.SetTable(-3); + } + + luaState.SetTop( oldTop); + } + + public Dictionary GetTableDict(LuaTable table) + { + var dict = new Dictionary(); + int oldTop = luaState.GetTop(); + translator.Push(luaState, table); + luaState.PushNil(); + + while (luaState.Next(-2)) + { + dict[translator.GetObject(luaState, -2)] = translator.GetObject(luaState, -1); + luaState.SetTop(-2); + } + + luaState.SetTop(oldTop); + return dict; + } + + /* + * Lets go of a previously allocated reference to a table, function + * or userdata + */ + #region lua debug functions + /// + /// Activates the debug hook + /// + /// Mask + /// Count + /// see lua docs. -1 if hook is already set + public int SetDebugHook(LuaHookMask mask, int count) + { + if (hookCallback == null) + { + hookCallback = new LuaHookFunction(Lua.DebugHookCallback); + luaState.SetHook(hookCallback, mask, count); + } + + return -1; + } + + /// + /// Removes the debug hook + /// + /// see lua docs + public void RemoveDebugHook() + { + hookCallback = null; + luaState.SetHook(null, LuaHookMask.Disabled, 0); + } + + /// + /// Gets the hook mask. + /// + /// hook mask + public LuaHookMask GetHookMask() + { + return luaState.HookMask; + } + + /// + /// Gets the hook count + /// + /// see lua docs + public int GetHookCount() + { + return luaState.HookCount; + } + + + /// + /// Gets local (see lua docs) + /// + /// lua debug structure + /// see lua docs + /// see lua docs + public string GetLocal(LuaDebug luaDebug, int n) + { + return luaState.GetLocal(luaDebug, n); + } + + /// + /// Sets local (see lua docs) + /// + /// lua debug structure + /// see lua docs + /// see lua docs + public string SetLocal(LuaDebug luaDebug, int n) + { + return luaState.SetLocal(luaDebug, n); + } + + public int GetStack(int level, ref LuaDebug ar) + { + return luaState.GetStack(level, ref ar); + } + + public bool GetInfo(string what, ref LuaDebug ar) + { + return luaState.GetInfo(what, ref ar); + } + + /// + /// Gets up value (see lua docs) + /// + /// see lua docs + /// see lua docs + /// see lua docs + public string GetUpValue(int funcindex, int n) + { + return luaState.GetUpValue(funcindex, n); + } + + /// + /// Sets up value (see lua docs) + /// + /// see lua docs + /// see lua docs + /// see lua docs + public string SetUpValue(int funcindex, int n) + { + return luaState.SetUpValue(funcindex, n); + } + + /// + /// Delegate that is called on lua hook callback + /// + /// lua state + /// Pointer to LuaDebug (lua_debug) structure + /// +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaHookFunction))] +#endif + static void DebugHookCallback(IntPtr luaState, IntPtr luaDebug) + { + var state = LuaState.FromIntPtr(luaState); + + state.GetStack(0, luaDebug); + + if (!state.GetInfo("Snlu", luaDebug)) + return; + + var debug = LuaDebug.FromIntPtr(luaDebug); + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(state); + Lua lua = translator.Interpreter; + lua.DebugHookCallbackInternal(state, debug); + } + + private void DebugHookCallbackInternal(LuaState luaState, LuaDebug luaDebug) + { + try + { + var temp = DebugHook; + + if (temp != null) + temp(this, new DebugHookEventArgs(luaDebug)); + } + catch (Exception ex) + { + OnHookException(new HookExceptionEventArgs(ex)); + } + } + + private void OnHookException(HookExceptionEventArgs e) + { + var temp = HookException; + if (temp != null) + temp(this, e); + } + + /// + /// Pops a value from the lua stack. + /// + /// Returns the top value from the lua stack. + public object Pop() + { + int top = luaState.GetTop(); + return translator.PopValues(luaState, top - 1)[0]; + } + + /// + /// Pushes a value onto the lua stack. + /// + /// Value to push. + public void Push(object value) + { + translator.Push(luaState, value); + } + #endregion + + internal void DisposeInternal(int reference) + { + if (luaState != null) + luaState.Unref(reference); + } + + /* + * Gets a field of the table corresponding to the provided reference + * using rawget (do not use metatables) + */ + internal object RawGetObject(int reference, string field) + { + int oldTop = luaState.GetTop(); + luaState.GetRef(reference); + luaState.PushString(field); + luaState.RawGet(-2); + object obj = translator.GetObject(luaState, -1); + luaState.SetTop(oldTop); + return obj; + } + + /* + * Gets a field of the table or userdata corresponding to the provided reference + */ + internal object GetObject(int reference, string field) + { + int oldTop = luaState.GetTop(); + luaState.GetRef(reference); + object returnValue = GetObject(FullPathToArray(field)); + luaState.SetTop(oldTop); + return returnValue; + } + + /* + * Gets a numeric field of the table or userdata corresponding the the provided reference + */ + internal object GetObject(int reference, object field) + { + int oldTop = luaState.GetTop(); + luaState.GetRef(reference); + translator.Push(luaState, field); + luaState.GetTable(-2); + object returnValue = translator.GetObject(luaState, -1); + luaState.SetTop(oldTop); + return returnValue; + } + + /* + * Sets a field of the table or userdata corresponding the the provided reference + * to the provided value + */ + internal void SetObject(int reference, string field, object val) + { + int oldTop = luaState.GetTop(); + luaState.GetRef(reference); + SetObject(FullPathToArray(field), val); + luaState.SetTop(oldTop); + } + + /* + * Sets a numeric field of the table or userdata corresponding the the provided reference + * to the provided value + */ + internal void SetObject(int reference, object field, object val) + { + int oldTop = luaState.GetTop(); + luaState.GetRef(reference); + translator.Push(luaState, field); + translator.Push(luaState, val); + luaState.SetTable(-3); + luaState.SetTop(oldTop); + } + + public LuaFunction RegisterFunction(string path, MethodBase function /*MethodInfo function*/) + { + return RegisterFunction(path, null, function); + } + + /* + * Registers an object's method as a Lua function (global or table field) + * The method may have any signature + */ + public LuaFunction RegisterFunction(string path, object target, MethodBase function /*MethodInfo function*/) //CP: Fix for struct constructor by Alexander Kappner (link: http://luaforge.net/forum/forum.php?thread_id = 2859&forum_id = 145) + { + // We leave nothing on the stack when we are done + int oldTop = luaState.GetTop(); + var wrapper = new LuaMethodWrapper(translator, target, new ProxyType(function.DeclaringType), function); + translator.Push(luaState, new LuaNativeFunction(wrapper.invokeFunction)); + this[path] = translator.GetObject(luaState, -1); + var f = GetFunction(path); + luaState.SetTop(oldTop); + return f; + } + + /* + * Compares the two values referenced by ref1 and ref2 for equality + */ + internal bool CompareRef(int ref1, int ref2) + { + int top = luaState.GetTop(); + luaState.GetRef(ref1); + luaState.GetRef(ref2); + bool equal = luaState.AreEqual(-1, -2); + luaState.SetTop(top); + return equal; + } + + internal void PushCSFunction(LuaNativeFunction function) + { + translator.PushFunction(luaState, function); + } + + #region IDisposable Members + public virtual void Dispose() + { + if (translator != null) + { + translator.pendingEvents.Dispose(); + translator = null; + } + + Close(); + GC.WaitForPendingFinalizers(); + } + #endregion + } +} diff --git a/src/LuaBase.cs b/src/LuaBase.cs new file mode 100644 index 0000000000000000000000000000000000000000..ca1d7367035b0d2252521e72fd557dc21b0d37f8 --- /dev/null +++ b/src/LuaBase.cs @@ -0,0 +1,58 @@ +using System; + +namespace NLua +{ + /// + /// Base class to provide consistent disposal flow across lua objects. Uses code provided by Yves Duhoux and suggestions by Hans Schmeidenbacher and Qingrui Li + /// + public abstract class LuaBase : IDisposable + { + private bool _Disposed; + protected int + _Reference; + protected Lua + _Interpreter; + + ~LuaBase() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + public virtual void Dispose(bool disposeManagedResources) + { + if (!_Disposed) + { + if (disposeManagedResources) + { + if (_Reference != 0) + _Interpreter.DisposeInternal(_Reference); + } + + _Interpreter = null; + _Disposed = true; + } + } + + public override bool Equals(object o) + { + if (o is LuaBase) + { + var l = (LuaBase)o; + return _Interpreter.CompareRef(l._Reference, _Reference); + } + else + return false; + } + + public override int GetHashCode() + { + return _Reference; + } + } +} \ No newline at end of file diff --git a/src/LuaFunction.cs b/src/LuaFunction.cs new file mode 100644 index 0000000000000000000000000000000000000000..7ac3d0888655fd21cd5615ec568a808d639c6bb6 --- /dev/null +++ b/src/LuaFunction.cs @@ -0,0 +1,81 @@ +using System; +using KeraLua; + +using LuaState = KeraLua.Lua; +using LuaNativeFunction = KeraLua.LuaFunction; + +namespace NLua +{ + public class LuaFunction : LuaBase + { + internal LuaNativeFunction function; + + public LuaFunction(int reference, Lua interpreter) + { + _Reference = reference; + function = null; + _Interpreter = interpreter; + } + + public LuaFunction(LuaNativeFunction nativeFunction, Lua interpreter) + { + _Reference = 0; + function = nativeFunction; + _Interpreter = interpreter; + } + + /* + * Calls the function casting return values to the types + * in returnTypes + */ + internal object[] Call(object[] args, Type[] returnTypes) + { + return _Interpreter.CallFunction(this, args, returnTypes); + } + + /* + * Calls the function and returns its return values inside + * an array + */ + public object[] Call(params object[] args) + { + return _Interpreter.CallFunction(this, args); + } + + /* + * Pushes the function into the Lua stack + */ + internal void Push(LuaState luaState) + { + if (_Reference != 0) + luaState.RawGetInteger(LuaRegistry.Index, _Reference); + else + _Interpreter.PushCSFunction(function); + } + + public override string ToString() + { + return "function"; + } + + public override bool Equals(object o) + { + if (o is LuaFunction) + { + var l = (LuaFunction)o; + + if (this._Reference != 0 && l._Reference != 0) + return _Interpreter.CompareRef(l._Reference, this._Reference); + else + return this.function == l.function; + } + else + return false; + } + + public override int GetHashCode() + { + return _Reference != 0 ? _Reference : function.GetHashCode(); + } + } +} \ No newline at end of file diff --git a/src/LuaGlobalAttribute.cs b/src/LuaGlobalAttribute.cs new file mode 100644 index 0000000000000000000000000000000000000000..27e63937e79c86b83252b0ffd8e8402e77ec8272 --- /dev/null +++ b/src/LuaGlobalAttribute.cs @@ -0,0 +1,23 @@ +using System; + +namespace NLua +{ + /// + /// Marks a method for global usage in Lua scripts + /// + /// + /// + [AttributeUsage(AttributeTargets.Method)] + public sealed class LuaGlobalAttribute : Attribute + { + /// + /// An alternative name to use for calling the function in Lua - leave empty for CLR name + /// + public string Name { get; set; } + + /// + /// A description of the function + /// + public string Description { get; set; } + } +} \ No newline at end of file diff --git a/src/LuaHideAttribute.cs b/src/LuaHideAttribute.cs new file mode 100644 index 0000000000000000000000000000000000000000..c5840fdc19db6d9ef4f4e0501a1b14a1bcd27d78 --- /dev/null +++ b/src/LuaHideAttribute.cs @@ -0,0 +1,12 @@ +using System; + +namespace NLua +{ + /// + /// Marks a method, field or property to be hidden from Lua auto-completion + /// + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] + public sealed class LuaHideAttribute : Attribute + { + } +} \ No newline at end of file diff --git a/src/LuaRegistrationHelper.cs b/src/LuaRegistrationHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..5ca4b33c1cdf2ff65980e1845a248c9d16679873 --- /dev/null +++ b/src/LuaRegistrationHelper.cs @@ -0,0 +1,100 @@ +using System; +using System.Reflection; +using System.Diagnostics.CodeAnalysis; +using NLua.Extensions; + + +namespace NLua +{ + public static class LuaRegistrationHelper + { + #region Tagged instance methods + /// + /// Registers all public instance methods in an object tagged with as Lua global functions + /// + /// The Lua VM to add the methods to + /// The object to get the methods from + public static void TaggedInstanceMethods(Lua lua, object o) + { + #region Sanity checks + if (lua == null) + throw new ArgumentNullException("lua"); + + if (o == null) + throw new ArgumentNullException("o"); + #endregion + + foreach (var method in o.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public)) + { + foreach (LuaGlobalAttribute attribute in method.GetCustomAttributes(typeof(LuaGlobalAttribute), true)) + { + if (string.IsNullOrEmpty(attribute.Name)) + lua.RegisterFunction(method.Name, o, method); // CLR name + else + lua.RegisterFunction(attribute.Name, o, method); // Custom name + } + } + } + #endregion + + #region Tagged static methods + /// + /// Registers all public static methods in a class tagged with as Lua global functions + /// + /// The Lua VM to add the methods to + /// The class type to get the methods from + public static void TaggedStaticMethods(Lua lua, Type type) + { + #region Sanity checks + if (lua == null) + throw new ArgumentNullException("lua"); + + if (type == null) + throw new ArgumentNullException("type"); + + if (!type.IsClass) + throw new ArgumentException("The type must be a class!", "type"); + #endregion + + foreach (var method in type.GetMethods(BindingFlags.Static | BindingFlags.Public)) + { + foreach (LuaGlobalAttribute attribute in method.GetCustomAttributes(typeof(LuaGlobalAttribute), false)) + { + if (string.IsNullOrEmpty(attribute.Name)) + lua.RegisterFunction(method.Name, null, method); // CLR name + else + lua.RegisterFunction(attribute.Name, null, method); // Custom name + } + } + } + #endregion + + /// + /// Registers an enumeration's values for usage as a Lua variable table + /// + /// The enum type to register + /// The Lua VM to add the enum to + [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "The type parameter is used to select an enum type")] + public static void Enumeration(Lua lua) + { + if (lua == null) + throw new ArgumentNullException("lua"); + + var type = typeof(T); + + if (!type.IsEnum) + throw new ArgumentException("The type must be an enumeration!"); + + + string[] names = Enum.GetNames(type); + var values = (T[])Enum.GetValues(type); + lua.NewTable(type.Name); + + for (int i = 0; i < names.Length; i++) + { + string path = type.Name + "." + names[i]; + lua[path] = values[i]; + } + } + } +} \ No newline at end of file diff --git a/src/LuaTable.cs b/src/LuaTable.cs new file mode 100644 index 0000000000000000000000000000000000000000..2d0df54c993f21d0b512c6e161016cdcbd0ef38b --- /dev/null +++ b/src/LuaTable.cs @@ -0,0 +1,81 @@ + +using System.Collections; + +using NLua.Extensions; + +using LuaState = KeraLua.Lua; + +namespace NLua +{ + public class LuaTable : LuaBase + { + public LuaTable(int reference, Lua interpreter) + { + _Reference = reference; + _Interpreter = interpreter; + } + + /* + * Indexer for string fields of the table + */ + public object this[string field] { + get + { + return _Interpreter.GetObject(_Reference, field); + } + set + { + _Interpreter.SetObject(_Reference, field, value); + } + } + + /* + * Indexer for numeric fields of the table + */ + public object this[object field] { + get + { + return _Interpreter.GetObject(_Reference, field); + } + set + { + _Interpreter.SetObject(_Reference, field, value); + } + } + + public IDictionaryEnumerator GetEnumerator() + { + return _Interpreter.GetTableDict(this).GetEnumerator(); + } + + public ICollection Keys { + get { return _Interpreter.GetTableDict(this).Keys; } + } + + public ICollection Values { + get { return _Interpreter.GetTableDict(this).Values; } + } + + /* + * Gets an string fields of a table ignoring its metatable, + * if it exists + */ + internal object RawGet(string field) + { + return _Interpreter.RawGetObject(_Reference, field); + } + + /* + * Pushes this table into the Lua stack + */ + internal void Push(LuaState luaState) + { + luaState.GetRef(_Reference); + } + + public override string ToString() + { + return "table"; + } + } +} \ No newline at end of file diff --git a/src/LuaUserData.cs b/src/LuaUserData.cs new file mode 100644 index 0000000000000000000000000000000000000000..a3fc6c2605f9f4c1f5f8446f752c7628fed2bfd2 --- /dev/null +++ b/src/LuaUserData.cs @@ -0,0 +1,54 @@ + +namespace NLua +{ + public class LuaUserData : LuaBase + { + public LuaUserData(int reference, Lua interpreter) + { + _Reference = reference; + _Interpreter = interpreter; + } + + /* + * Indexer for string fields of the userdata + */ + public object this[string field] { + get + { + return _Interpreter.GetObject(_Reference, field); + } + set + { + _Interpreter.SetObject(_Reference, field, value); + } + } + + /* + * Indexer for numeric fields of the userdata + */ + public object this[object field] { + get + { + return _Interpreter.GetObject(_Reference, field); + } + set + { + _Interpreter.SetObject(_Reference, field, value); + } + } + + /* + * Calls the userdata and returns its return values inside + * an array + */ + public object[] Call(params object[] args) + { + return _Interpreter.CallFunction(this, args); + } + + public override string ToString() + { + return "userdata"; + } + } +} \ No newline at end of file diff --git a/src/Metatables.cs b/src/Metatables.cs new file mode 100644 index 0000000000000000000000000000000000000000..cdcdb8a68cce6fa344f7dbef605ea68bce0b916d --- /dev/null +++ b/src/Metatables.cs @@ -0,0 +1,1446 @@ +using System; +using System.Linq; +using System.Collections; +using System.Reflection; +using System.Diagnostics; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +using KeraLua; + +using NLua.Method; +using NLua.Extensions; + +#if __IOS__ || __TVOS__ || __WATCHOS__ + using ObjCRuntime; +#endif + +using LuaState = KeraLua.Lua; +using LuaNativeFunction = KeraLua.LuaFunction; + +namespace NLua +{ + public class MetaFunctions + { + public LuaNativeFunction GcFunction { get; } + public LuaNativeFunction IndexFunction { get; } + public LuaNativeFunction NewIndexFunction { get; } + public LuaNativeFunction BaseIndexFunction { get; } + public LuaNativeFunction ClassIndexFunction { get; } + public LuaNativeFunction ClassNewIndexFunction { get; } + public LuaNativeFunction ExecuteDelegateFunction { get; } + public LuaNativeFunction CallConstructorFunction { get; } + public LuaNativeFunction ToStringFunction { get; } + public LuaNativeFunction CallDelegateFunction { get; } + + public LuaNativeFunction AddFunction { get; } + public LuaNativeFunction SubtractFunction { get; } + public LuaNativeFunction MultiplyFunction { get; } + public LuaNativeFunction DivisionFunction { get; } + public LuaNativeFunction ModulosFunction { get; } + public LuaNativeFunction UnaryNegationFunction { get; } + public LuaNativeFunction EqualFunction { get; } + public LuaNativeFunction LessThanFunction { get; } + public LuaNativeFunction LessThanOrEqualFunction { get; } + + Dictionary memberCache = new Dictionary(); + ObjectTranslator translator; + + /* + * __index metafunction for CLR objects. Implemented in Lua. + */ + static string luaIndexFunction = + @"local function index(obj,name) + local meta = getmetatable(obj) + local cached = meta.cache[name] + if cached ~= nil then + return cached + else + local value,isFunc = get_object_member(obj,name) + + if isFunc then + meta.cache[name]=value + end + return value + end + end + return index"; + + public static string LuaIndexFunction => luaIndexFunction; + public MetaFunctions(ObjectTranslator translator) + { + this.translator = translator; + GcFunction = CollectObject; + ToStringFunction = ToStringLua; + IndexFunction = GetMethod; + NewIndexFunction = SetFieldOrProperty; + BaseIndexFunction = GetBaseMethod; + CallConstructorFunction =CallConstructor; + ClassIndexFunction = GetClassMethod; + ClassNewIndexFunction = SetClassFieldOrProperty; + ExecuteDelegateFunction = RunFunctionDelegate; + CallDelegateFunction = CallDelegate; + AddFunction = AddLua; + SubtractFunction = SubtractLua; + MultiplyFunction = MultiplyLua; + DivisionFunction = DivideLua; + ModulosFunction = ModLua; + UnaryNegationFunction = UnaryNegationLua; + EqualFunction = EqualLua; + LessThanFunction = LessThanLua; + LessThanOrEqualFunction = LessThanOrEqualLua; + } + + /* + * __call metafunction of CLR delegates, retrieves and calls the delegate. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int RunFunctionDelegate(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + var func = (LuaNativeFunction)translator.GetRawNetObject(state, 1); + state.Remove(1); + return func(luaState); + } + + /* + * __gc metafunction of CLR objects. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int CollectObject(IntPtr state) + { + var luaState = LuaState.FromIntPtr(state); + var translator = ObjectTranslatorPool.Instance.Find(luaState); + return CollectObject(luaState, translator); + } + + private static int CollectObject(LuaState luaState, ObjectTranslator translator) + { + int udata = luaState.RawNetObj(1); + + if (udata != -1) + translator.CollectObject(udata); + + return 0; + } + + /* + * __tostring metafunction of CLR objects. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int ToStringLua(IntPtr state) + { + var luaState = LuaState.FromIntPtr(state); + var translator = ObjectTranslatorPool.Instance.Find(luaState); + return ToStringLua(luaState, translator); + } + + private static int ToStringLua(LuaState luaState, ObjectTranslator translator) + { + object obj = translator.GetRawNetObject(luaState, 1); + + if (obj != null) + translator.Push(luaState, obj + ": " + obj.GetHashCode()); + else + luaState.PushNil(); + + return 1; + } + + + /* + * __add metafunction of CLR objects. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + static int AddLua(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return MatchOperator(state, "op_Addition", translator); + } + + /* + * __sub metafunction of CLR objects. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + static int SubtractLua(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return MatchOperator(state, "op_Subtraction", translator); + } + + /* + * __mul metafunction of CLR objects. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + static int MultiplyLua(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return MatchOperator(state, "op_Multiply", translator); + } + + /* + * __div metafunction of CLR objects. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + static int DivideLua(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return MatchOperator(state, "op_Division", translator); + } + + /* + * __mod metafunction of CLR objects. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + static int ModLua(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return MatchOperator(state, "op_Modulus", translator); + } + + /* + * __unm metafunction of CLR objects. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + static int UnaryNegationLua(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return UnaryNegationLua(state, translator); + } + + static int UnaryNegationLua(LuaState luaState, ObjectTranslator translator) + { + object obj1 = translator.GetRawNetObject(luaState, 1); + + if (obj1 == null) + { + translator.ThrowError(luaState, "Cannot negate a nil object"); + luaState.PushNil(); + return 1; + } + + Type type = obj1.GetType(); + MethodInfo opUnaryNegation = type.GetMethod("op_UnaryNegation"); + + if (opUnaryNegation == null) + { + translator.ThrowError(luaState, "Cannot negate object (" + type.Name + " does not overload the operator -)"); + luaState.PushNil(); + return 1; + } + obj1 = opUnaryNegation.Invoke(obj1, new [] { obj1 }); + translator.Push(luaState, obj1); + return 1; + } + + + /* + * __eq metafunction of CLR objects. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + static int EqualLua(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return MatchOperator(state, "op_Equality", translator); + } + + /* + * __lt metafunction of CLR objects. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + static int LessThanLua(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return MatchOperator(state, "op_LessThan", translator); + } + + /* + * __le metafunction of CLR objects. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + static int LessThanOrEqualLua(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return MatchOperator(state, "op_LessThanOrEqual", translator); + } + + /// + /// Debug tool to dump the lua stack + /// + /// FIXME, move somewhere else + public static void DumpStack(ObjectTranslator translator, LuaState luaState) + { + int depth = luaState.GetTop(); + + Debug.WriteLine("lua stack depth: {0}", depth); + + for (int i = 1; i <= depth; i++) + { + var type = luaState.Type(i); + // we dump stacks when deep in calls, calling typename while the stack is in flux can fail sometimes, so manually check for key types + string typestr = (type == LuaType.Table) ? "table" : luaState.TypeName(type); + string strrep = luaState.ToString(i); + + if (type == LuaType.UserData) + { + object obj = translator.GetRawNetObject(luaState, i); + strrep = obj.ToString(); + } + + Debug.WriteLine("{0}: ({1}) {2}", i, typestr, strrep); + } + } + + /* + * Called by the __index metafunction of CLR objects in case the + * method is not cached or it is a field/property/event. + * Receives the object and the member name as arguments and returns + * either the value of the member or a delegate to call it. + * If the member does not exist returns nil. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int GetMethod(IntPtr state) + { + var luaState = LuaState.FromIntPtr(state); + var translator = ObjectTranslatorPool.Instance.Find(luaState); + var instance = translator.MetaFunctionsInstance; + return instance.GetMethodInternal(luaState); + } + + private int GetMethodInternal(LuaState luaState) + { + object obj = translator.GetRawNetObject(luaState, 1); + + if (obj == null) + { + translator.ThrowError(luaState, "Trying to index an invalid object reference"); + luaState.PushNil(); + return 1; + } + + object index = translator.GetObject(luaState, 2); + string methodName = index as string; // will be null if not a string arg + var objType = obj.GetType(); + var proxyType = new ProxyType(objType); + + // Handle the most common case, looking up the method by name. + // CP: This will fail when using indexers and attempting to get a value with the same name as a property of the object, + // ie: xmlelement['item'] <- item is a property of xmlelement + try + { + if (!string.IsNullOrEmpty(methodName) && IsMemberPresent(proxyType, methodName)) + return GetMember(luaState, proxyType, obj, methodName, BindingFlags.Instance); + } + catch + { + Debug.WriteLine("[Exception] Fail to fetch Member: {0}", methodName); + } + + // Try to access by array if the type is right and index is an int (lua numbers always come across as double) + if (objType.IsArray && index is double) + { + int intIndex = (int)((double)index); + + Type type = objType.UnderlyingSystemType; + + if (type == typeof(float[])) + { + float[] arr = (float[])obj; + translator.Push(luaState, arr[intIndex]); + } + else if (type == typeof(double[])) + { + double[] arr = (double[])obj; + translator.Push(luaState, arr[intIndex]); + } + else if (type == typeof(int[])) + { + int[] arr = (int[])obj; + translator.Push(luaState, arr[intIndex]); + } + else + { + object[] arr = (object[])obj; + translator.Push(luaState, arr[intIndex]); + } + } + else + { + if (!string.IsNullOrEmpty(methodName) && IsExtensionMethodPresent(objType, methodName)) + { + return GetExtensionMethod(luaState, objType, obj, methodName); + } + // Try to use get_Item to index into this .net object + var methods = objType.GetMethods(); + + foreach (var methodInfo in methods) + { + if (methodInfo.Name == "get_Item") + { + // Check if the signature matches the input + if (methodInfo.GetParameters().Length == 1) + { + var actualParams = methodInfo.GetParameters(); + + if (actualParams.Length != 1) + { + translator.ThrowError(luaState, "method not found (or no indexer): " + index); + luaState.PushNil(); + } + else + { + // Get the index in a form acceptable to the getter + index = translator.GetAsType(luaState, 2, actualParams[0].ParameterType); + object[] args = new object[1]; + + // Just call the indexer - if out of bounds an exception will happen + args[0] = index; + + try + { + object result = methodInfo.Invoke(obj, args); + translator.Push(luaState, result); + } + catch (TargetInvocationException e) + { + // Provide a more readable description for the common case of key not found + if (e.InnerException is KeyNotFoundException) + translator.ThrowError(luaState, "key '" + index + "' not found "); + else + translator.ThrowError(luaState, "exception indexing '" + index + "' " + e.Message); + + luaState.PushNil(); + } + } + } + } + } + } + luaState.PushBoolean(false); + return 2; + } + + /* + * __index metafunction of base classes (the base field of Lua tables). + * Adds a prefix to the method name to call the base version of the method. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int GetBaseMethod(IntPtr state) + { + var luaState = LuaState.FromIntPtr(state); + var translator = ObjectTranslatorPool.Instance.Find(luaState); + var instance = translator.MetaFunctionsInstance; + return instance.GetBaseMethodInternal(luaState); + } + + private int GetBaseMethodInternal(LuaState luaState) + { + object obj = translator.GetRawNetObject(luaState, 1); + + if (obj == null) + { + translator.ThrowError(luaState, "Trying to index an invalid object reference"); + luaState.PushNil(); + luaState.PushBoolean(false); + return 2; + } + + string methodName = luaState.ToString(2); + + if (string.IsNullOrEmpty(methodName)) + { + luaState.PushNil(); + luaState.PushBoolean(false); + return 2; + } + + GetMember(luaState, new ProxyType(obj.GetType()), obj, "__luaInterface_base_" + methodName, BindingFlags.Instance); + luaState.SetTop(-2); + + if (luaState.Type(-1) == LuaType.Nil) + { + luaState.SetTop(-2); + return GetMember(luaState, new ProxyType(obj.GetType()), obj, methodName, BindingFlags.Instance); + } + + luaState.PushBoolean(false); + return 2; + } + + /// + /// Does this method exist as either an instance or static? + /// + /// + /// + /// + bool IsMemberPresent(ProxyType objType, string methodName) + { + object cachedMember = CheckMemberCache(objType, methodName); + + if (cachedMember != null) + return true; + + var members = objType.GetMember(methodName, BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public); + return members.Length > 0; + } + + bool IsExtensionMethodPresent(Type type, string name) + { + object cachedMember = CheckMemberCache(type, name); + + if (cachedMember != null) + return true; + + return translator.IsExtensionMethodPresent(type, name); + } + + int GetExtensionMethod(LuaState luaState, Type type, object obj, string name) + { + var cachedMember = CheckMemberCache(type, name) as LuaNativeFunction; + + if (cachedMember != null) + { + translator.PushFunction(luaState, cachedMember); + translator.Push(luaState, true); + return 2; + } + + MethodInfo methodInfo = translator.GetExtensionMethod(type, name); + var methodWrapper = new LuaMethodWrapper(translator, obj, new ProxyType(type), methodInfo); + var invokeDelegate = new LuaNativeFunction(methodWrapper.invokeFunction); + + SetMemberCache(type, name, invokeDelegate); + + translator.PushFunction(luaState, invokeDelegate); + translator.Push(luaState, true); + return 2; + } + + /* + * Pushes the value of a member or a delegate to call it, depending on the type of + * the member. Works with static or instance members. + * Uses reflection to find members, and stores the reflected MemberInfo object in + * a cache (indexed by the type of the object and the name of the member). + */ + int GetMember(LuaState luaState, ProxyType objType, object obj, string methodName, BindingFlags bindingType) + { + bool implicitStatic = false; + MemberInfo member = null; + object cachedMember = CheckMemberCache(objType, methodName); + + if (cachedMember is LuaNativeFunction) + { + translator.PushFunction(luaState, (LuaNativeFunction)cachedMember); + translator.Push(luaState, true); + return 2; + } + if (cachedMember != null) + member = (MemberInfo)cachedMember; + else + { + var members = objType.GetMember(methodName, bindingType | BindingFlags.Public); + + if (members.Length > 0) + member = members[0]; + else + { + // If we can't find any suitable instance members, try to find them as statics - but we only want to allow implicit static + members = objType.GetMember(methodName, bindingType | BindingFlags.Static | BindingFlags.Public); + + if (members.Length > 0) + { + member = members[0]; + implicitStatic = true; + } + } + } + + if (member != null) + { + if (member.MemberType == MemberTypes.Field) + { + var field = (FieldInfo)member; + + if (cachedMember == null) + SetMemberCache(objType, methodName, member); + + try + { + var value = field.GetValue(obj); + translator.Push(luaState, value); + } + catch + { + Debug.WriteLine("[Exception] Fail to get field value"); + luaState.PushNil(); + } + } + else if (member.MemberType == MemberTypes.Property) + { + var property = (PropertyInfo)member; + if (cachedMember == null) + SetMemberCache(objType, methodName, member); + + try + { + object value = property.GetValue(obj, null); + translator.Push(luaState, value); + } + catch (ArgumentException) + { + // If we can't find the getter in our class, recurse up to the base class and see + // if they can help. + if (objType.UnderlyingSystemType != typeof(object)) + return GetMember(luaState, new ProxyType(objType.UnderlyingSystemType.BaseType), obj, methodName, bindingType); + luaState.PushNil(); + } + catch (TargetInvocationException e) + { // Convert this exception into a Lua error + ThrowError(luaState, e); + luaState.PushNil(); + } + } + else if (member.MemberType == MemberTypes.Event) + { + var eventInfo = (EventInfo)member; + if (cachedMember == null) + SetMemberCache(objType, methodName, member); + + translator.Push(luaState, new RegisterEventHandler(translator.pendingEvents, obj, eventInfo)); + } + else if (!implicitStatic) + { + if (member.MemberType == MemberTypes.NestedType) + { + if (cachedMember == null) + SetMemberCache(objType, methodName, member); + + // Find the name of our class + string name = member.Name; + var dectype = member.DeclaringType; + + // Build a new long name and try to find the type by name + string longname = dectype.FullName + "+" + name; + var nestedType = translator.FindType(longname); + translator.PushType(luaState, nestedType); + } + else + { + // Member type must be 'method' + var methodWrapper = new LuaMethodWrapper(translator, objType, methodName, bindingType); + var wrapper = methodWrapper.invokeFunction; + + if (cachedMember == null) + SetMemberCache(objType, methodName, wrapper); + + translator.PushFunction(luaState, wrapper); + translator.Push(luaState, true); + return 2; + } + } + else + { + // If we reach this point we found a static method, but can't use it in this context because the user passed in an instance + translator.ThrowError(luaState, "Can't pass instance to static method " + methodName); + luaState.PushNil(); + } + } + else + { + if (objType.UnderlyingSystemType != typeof(object)) + return GetMember(luaState, new ProxyType(objType.UnderlyingSystemType.BaseType), obj, methodName, bindingType); + + // We want to throw an exception because merely returning 'nil' in this case + // is not sufficient. valid data members may return nil and therefore there must be some + // way to know the member just doesn't exist. + translator.ThrowError(luaState, "Unknown member name " + methodName); + luaState.PushNil(); + } + + // Push false because we are NOT returning a function (see luaIndexFunction) + translator.Push(luaState, false); + return 2; + } + + /* + * Checks if a MemberInfo object is cached, returning it or null. + */ + object CheckMemberCache(Type objType, string memberName) + { + return CheckMemberCache(new ProxyType(objType), memberName); + } + + object CheckMemberCache(ProxyType objType, string memberName) + { + object members = null; + + if (memberCache.TryGetValue(objType, out members)) + { + var membersDict = members as Dictionary; + + object memberValue = null; + + if (members != null && membersDict.TryGetValue(memberName, out memberValue)) + { + return memberValue; + } + } + + return null; + } + + /* + * Stores a MemberInfo object in the member cache. + */ + void SetMemberCache(Type objType, string memberName, object member) + { + SetMemberCache(new ProxyType(objType), memberName, member); + } + + void SetMemberCache(ProxyType objType, string memberName, object member) + { + Dictionary members = null; + object memberCacheValue = null; + + if (memberCache.TryGetValue(objType, out memberCacheValue)) + { + members = (Dictionary)memberCacheValue; + } + else + { + members = new Dictionary(); + memberCache[objType] = members; + } + + members[memberName] = member; + } + + /* + * __newindex metafunction of CLR objects. Receives the object, + * the member name and the value to be stored as arguments. Throws + * and error if the assignment is invalid. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int SetFieldOrProperty(IntPtr state) + { + var luaState = LuaState.FromIntPtr(state); + var translator = ObjectTranslatorPool.Instance.Find(luaState); + var instance = translator.MetaFunctionsInstance; + return instance.SetFieldOrPropertyInternal(luaState); + } + + private int SetFieldOrPropertyInternal(LuaState luaState) + { + object target = translator.GetRawNetObject(luaState, 1); + + if (target == null) + { + translator.ThrowError(luaState, "trying to index and invalid object reference"); + return 0; + } + + var type = target.GetType(); + + // First try to look up the parameter as a property name + string detailMessage; + bool didMember = TrySetMember(luaState, new ProxyType(type), target, BindingFlags.Instance, out detailMessage); + + if (didMember) + return 0; // Must have found the property name + + // We didn't find a property name, now see if we can use a [] style this accessor to set array contents + try + { + if (type.IsArray && luaState.IsNumber(2)) + { + int index = (int)luaState.ToNumber(2); + var arr = (Array)target; + object val = translator.GetAsType(luaState, 3, arr.GetType().GetElementType()); + arr.SetValue(val, index); + } + else + { + // Try to see if we have a this[] accessor + var setter = type.GetMethod("set_Item"); + if (setter != null) + { + var args = setter.GetParameters(); + var valueType = args[1].ParameterType; + + // The new val ue the user specified + object val = translator.GetAsType(luaState, 3, valueType); + var indexType = args[0].ParameterType; + object index = translator.GetAsType(luaState, 2, indexType); + + object[] methodArgs = new object[2]; + + // Just call the indexer - if out of bounds an exception will happen + methodArgs[0] = index; + methodArgs[1] = val; + setter.Invoke(target, methodArgs); + } + else + translator.ThrowError(luaState, detailMessage); // Pass the original message from trySetMember because it is probably best + } +#if !SILVERLIGHT + } + catch (SEHException) + { + // If we are seeing a C++ exception - this must actually be for Lua's private use. Let it handle it + throw; +#endif + } + catch (Exception e) + { + ThrowError(luaState, e); + } + + return 0; + } + + /// + /// Tries to set a named property or field + /// + /// + /// + /// + /// + /// false if unable to find the named member, true for success + bool TrySetMember(LuaState luaState, ProxyType targetType, object target, BindingFlags bindingType, out string detailMessage) + { + detailMessage = null; // No error yet + + // If not already a string just return - we don't want to call tostring - which has the side effect of + // changing the lua typecode to string + // Note: We don't use isstring because the standard lua C isstring considers either strings or numbers to + // be true for isstring. + if (luaState.Type(2) != LuaType.String) + { + detailMessage = "property names must be strings"; + return false; + } + + // We only look up property names by string + string fieldName = luaState.ToString(2); + if (string.IsNullOrEmpty(fieldName) || !(char.IsLetter(fieldName[0]) || fieldName[0] == '_')) + { + detailMessage = "Invalid property name"; + return false; + } + + // Find our member via reflection or the cache + var member = (MemberInfo)CheckMemberCache(targetType, fieldName); + if (member == null) + { + var members = targetType.GetMember(fieldName, bindingType | BindingFlags.Public); + + if (members.Length > 0) + { + member = members[0]; + SetMemberCache(targetType, fieldName, member); + } + else + { + detailMessage = "field or property '" + fieldName + "' does not exist"; + return false; + } + } + + if (member.MemberType == MemberTypes.Field) + { + var field = (FieldInfo)member; + object val = translator.GetAsType(luaState, 3, field.FieldType); + + try + { + field.SetValue(target, val); + } + catch (Exception e) + { + ThrowError(luaState, e); + } + + return true; + } + if (member.MemberType == MemberTypes.Property) + { + var property = (PropertyInfo)member; + object val = translator.GetAsType(luaState, 3, property.PropertyType); + + try + { + property.SetValue(target, val, null); + } + catch (Exception e) + { + ThrowError(luaState, e); + } + + return true; + } + + detailMessage = "'" + fieldName + "' is not a .net field or property"; + return false; + } + + /* + * Writes to fields or properties, either static or instance. Throws an error + * if the operation is invalid. + */ + private int SetMember(LuaState luaState, ProxyType targetType, object target, BindingFlags bindingType) + { + string detail; + bool success = TrySetMember(luaState, targetType, target, bindingType, out detail); + + if (!success) + translator.ThrowError(luaState, detail); + + return 0; + } + + /// + /// Convert a C# exception into a Lua error + /// + /// + /// We try to look into the exception to give the most meaningful description + void ThrowError(LuaState luaState, Exception e) + { + // If we got inside a reflection show what really happened + var te = e as TargetInvocationException; + + if (te != null) + e = te.InnerException; + + translator.ThrowError(luaState, e); + } + + /* + * __index metafunction of type references, works on static members. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int GetClassMethod(IntPtr state) + { + var luaState = LuaState.FromIntPtr(state); + var translator = ObjectTranslatorPool.Instance.Find(luaState); + var instance = translator.MetaFunctionsInstance; + return instance.GetClassMethodInternal(luaState); + } + + private int GetClassMethodInternal(LuaState luaState) + { + ProxyType klass; + object obj = translator.GetRawNetObject(luaState, 1); + + if (obj == null || !(obj is ProxyType)) + { + translator.ThrowError(luaState, "Trying to index an invalid type reference"); + luaState.PushNil(); + return 1; + } + + klass = (ProxyType)obj; + + if (luaState.IsNumber(2)) + { + int size = (int)luaState.ToNumber(2); + translator.Push(luaState, Array.CreateInstance(klass.UnderlyingSystemType, size)); + return 1; + } + string methodName = luaState.ToString(2); + + if (string.IsNullOrEmpty(methodName)) + { + luaState.PushNil(); + return 1; + } + return GetMember(luaState, klass, null, methodName, BindingFlags.Static); + } + + /* + * __newindex function of type references, works on static members. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int SetClassFieldOrProperty(IntPtr state) + { + var luaState = LuaState.FromIntPtr(state); + var translator = ObjectTranslatorPool.Instance.Find(luaState); + var instance = translator.MetaFunctionsInstance; + return instance.SetClassFieldOrPropertyInternal(luaState); + } + + private int SetClassFieldOrPropertyInternal(LuaState luaState) + { + ProxyType target; + object obj = translator.GetRawNetObject(luaState, 1); + + if (obj == null || !(obj is ProxyType)) + { + translator.ThrowError(luaState, "trying to index an invalid type reference"); + return 0; + } + + target = (ProxyType)obj; + + return SetMember(luaState, target, null, BindingFlags.Static); + } + + /* + * __call metafunction of Delegates. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + static int CallDelegate(IntPtr state) + { + var luaState = LuaState.FromIntPtr(state); + var translator = ObjectTranslatorPool.Instance.Find(luaState); + var instance = translator.MetaFunctionsInstance; + return instance.CallDelegateInternal(luaState); + } + + int CallDelegateInternal(LuaState luaState) + { + object objDelegate = translator.GetRawNetObject(luaState, 1); + + if (objDelegate == null || !(objDelegate is Delegate)) + { + translator.ThrowError(luaState, "Trying to invoke a not delegate or callable value"); + luaState.PushNil(); + return 1; + } + + luaState.Remove(1); + + var validDelegate = new MethodCache(); + var del = (Delegate)objDelegate; + MethodBase methodDelegate = del.Method; + bool isOk = MatchParameters(luaState, methodDelegate, ref validDelegate); + + if (isOk) + { + object result; + + if (methodDelegate.IsStatic) + result = methodDelegate.Invoke(null, validDelegate.args); + else + result = methodDelegate.Invoke(del.Target, validDelegate.args); + + translator.Push(luaState, result); + return 1; + } + + translator.ThrowError(luaState, "Cannot invoke delegate (invalid arguments for " + methodDelegate.Name + ")"); + luaState.PushNil(); + return 1; + } + + /* + * __call metafunction of type references. Searches for and calls + * a constructor for the type. Returns nil if the constructor is not + * found or if the arguments are invalid. Throws an error if the constructor + * generates an exception. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int CallConstructor(IntPtr state) + { + var luaState = LuaState.FromIntPtr(state); + var translator = ObjectTranslatorPool.Instance.Find(luaState); + var instance = translator.MetaFunctionsInstance; + return instance.CallConstructorInternal(luaState); + } + + private int CallConstructorInternal(LuaState luaState) + { + var validConstructor = new MethodCache(); + ProxyType klass; + object obj = translator.GetRawNetObject(luaState, 1); + + if (obj == null || !(obj is ProxyType)) + { + translator.ThrowError(luaState, "Trying to call constructor on an invalid type reference"); + luaState.PushNil(); + return 1; + } + + klass = (ProxyType)obj; + + luaState.Remove(1); + ConstructorInfo[] constructors = klass.UnderlyingSystemType.GetConstructors(); + + foreach (var constructor in constructors) + { + bool isConstructor = MatchParameters(luaState, constructor, ref validConstructor); + + if (isConstructor) + { + try + { + translator.Push(luaState, constructor.Invoke(validConstructor.args)); + } + catch (TargetInvocationException e) + { + ThrowError(luaState, e); + luaState.PushNil(); + } + catch + { + luaState.PushNil(); + } + return 1; + } + } + + if (klass.UnderlyingSystemType.IsValueType) + { + int numLuaParams = luaState.GetTop(); + if (numLuaParams == 0) + { + translator.Push(luaState, Activator.CreateInstance(klass.UnderlyingSystemType)); + return 1; + } + } + + string constructorName = constructors.Length == 0 ? "unknown" : constructors[0].Name; + translator.ThrowError(luaState, string.Format("{0} does not contain constructor({1}) argument match", + klass.UnderlyingSystemType, constructorName)); + luaState.PushNil(); + return 1; + } + + static bool IsInteger(double x) + { + return Math.Ceiling(x) == x; + } + + static object GetTargetObject(LuaState luaState, string operation, ObjectTranslator translator) + { + Type t; + object target = translator.GetRawNetObject(luaState, 1); + if (target != null) + { + t = target.GetType(); + if (t.HasMethod(operation)) + return target; + } + target = translator.GetRawNetObject(luaState, 2); + if (target != null) + { + t = target.GetType(); + if (t.HasMethod(operation)) + return target; + } + return null; + } + + static int MatchOperator(LuaState luaState, string operation, ObjectTranslator translator) + { + var validOperator = new MethodCache(); + + object target = GetTargetObject(luaState, operation, translator); + + if (target == null) + { + translator.ThrowError(luaState, "Cannot call " + operation + " on a nil object"); + luaState.PushNil(); + return 1; + } + + Type type = target.GetType(); + var operators = type.GetMethods(operation, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static); + + foreach (var op in operators) + { + bool isOk = translator.MatchParameters(luaState, op, ref validOperator); + + if (!isOk) + continue; + + object result; + if (op.IsStatic) + result = op.Invoke(null, validOperator.args); + else + result = op.Invoke(target, validOperator.args); + translator.Push(luaState, result); + return 1; + } + + translator.ThrowError(luaState, "Cannot call (" + operation + ") on object type " + type.Name); + luaState.PushNil(); + return 1; + } + + internal Array TableToArray(Func luaParamValueExtractor, Type paramArrayType, int startIndex, int count) + { + Array paramArray; + + if (count == 0) + return Array.CreateInstance(paramArrayType, 0); + + var luaParamValue = luaParamValueExtractor(startIndex); + + if (luaParamValue is LuaTable) + { + LuaTable table = (LuaTable)luaParamValue; + IDictionaryEnumerator tableEnumerator = table.GetEnumerator(); + tableEnumerator.Reset(); + paramArray = Array.CreateInstance(paramArrayType, table.Values.Count); + + int paramArrayIndex = 0; + + while (tableEnumerator.MoveNext()) + { + object value = tableEnumerator.Value; + + if (paramArrayType == typeof(object)) + { + if (value != null && value.GetType() == typeof(double) && IsInteger((double)value)) + value = Convert.ToInt32((double)value); + } +#if SILVERLIGHT + paramArray.SetValue (Convert.ChangeType (value, paramArrayType, System.Globalization.CultureInfo.InvariantCulture), paramArrayIndex); +#else + paramArray.SetValue(Convert.ChangeType(value, paramArrayType), paramArrayIndex); +#endif + paramArrayIndex++; + } + } + else + { + + paramArray = Array.CreateInstance(paramArrayType, count); + + paramArray.SetValue(luaParamValue, 0); + + for (int i = 1; i < count; i++) + { + startIndex++; + var value = luaParamValueExtractor(startIndex); + paramArray.SetValue(value, i); + } + } + + return paramArray; + + } + + /* + * Matches a method against its arguments in the Lua stack. Returns + * if the match was successful. It it was also returns the information + * necessary to invoke the method. + */ + internal bool MatchParameters(LuaState luaState, MethodBase method, ref MethodCache methodCache) + { + ExtractValue extractValue; + bool isMethod = true; + var paramInfo = method.GetParameters(); + int currentLuaParam = 1; + int nLuaParams = luaState.GetTop(); + var paramList = new List(); + var outList = new List(); + var argTypes = new List(); + + foreach (var currentNetParam in paramInfo) + { + if (!currentNetParam.IsIn && currentNetParam.IsOut) // Skips out params + { + paramList.Add(null); + outList.Add(paramList.LastIndexOf(null)); + + } // Type does not match, ignore if the parameter is optional + else if (IsParamsArray(luaState, nLuaParams, currentLuaParam, currentNetParam, out extractValue)) + { + int count = (nLuaParams - currentLuaParam) + 1; + Type paramArrayType = currentNetParam.ParameterType.GetElementType(); + + Func extractDelegate = (currentParam) => { + currentLuaParam++; + return extractValue(luaState, currentParam); + }; + + Array paramArray = TableToArray(extractDelegate, paramArrayType, currentLuaParam, count); + paramList.Add(paramArray); + int index = paramList.LastIndexOf(paramArray); + var methodArg = new MethodArgs(); + methodArg.index = index; + methodArg.extractValue = extractValue; + methodArg.isParamsArray = true; + methodArg.paramsArrayType = paramArrayType; + argTypes.Add(methodArg); + + } + else if (IsTypeCorrect(luaState, currentLuaParam, currentNetParam, out extractValue)) + { // Type checking + var value = extractValue(luaState, currentLuaParam); + paramList.Add(value); + int index = paramList.LastIndexOf(value); + var methodArg = new MethodArgs(); + methodArg.index = index; + methodArg.extractValue = extractValue; + argTypes.Add(methodArg); + + if (currentNetParam.ParameterType.IsByRef) + outList.Add(index); + + currentLuaParam++; + } + else if (currentLuaParam > nLuaParams) + { // Adds optional parameters + if (currentNetParam.IsOptional) + paramList.Add(currentNetParam.DefaultValue); + else + { + isMethod = false; + break; + } + } + else if (currentNetParam.IsOptional) + paramList.Add(currentNetParam.DefaultValue); + else + { // No match + isMethod = false; + break; + } + } + + if (currentLuaParam != nLuaParams + 1) // Number of parameters does not match + isMethod = false; + + if (isMethod) + { + methodCache.args = paramList.ToArray(); + methodCache.cachedMethod = method; + methodCache.outList = outList.ToArray(); + methodCache.argTypes = argTypes.ToArray(); + } + return isMethod; + } + + /// + /// Returns true if the type is set and assigns the extract value + /// + /// + /// + /// + /// + /// + private bool IsTypeCorrect(LuaState luaState, int currentLuaParam, ParameterInfo currentNetParam, out ExtractValue extractValue) + { + try + { + return (extractValue = translator.typeChecker.CheckLuaType(luaState, currentLuaParam, currentNetParam.ParameterType)) != null; + } + catch + { + extractValue = null; + Debug.WriteLine("Type wasn't correct"); + return false; + } + } + + private bool IsParamsArray(LuaState luaState, int nLuaParams, int currentLuaParam, ParameterInfo currentNetParam, out ExtractValue extractValue) + { + extractValue = null; + bool isParamArray = false; + + if (currentNetParam.GetCustomAttributes(typeof(ParamArrayAttribute), false).Any()) + { + isParamArray = nLuaParams < currentLuaParam; + LuaType luaType; + + try + { + luaType = luaState.Type(currentLuaParam); + } + catch (Exception ex) + { + Debug.WriteLine("Could not retrieve lua type while attempting to determine params Array Status."); + Debug.WriteLine(ex.Message); + extractValue = null; + return false; + } + + if (luaType == LuaType.Table) + { + try + { + extractValue = translator.typeChecker.GetExtractor(typeof(LuaTable)); + } + catch (Exception) + { + Debug.WriteLine("An error occurred during an attempt to retrieve a LuaTable extractor while checking for params array status."); + } + + if (extractValue != null) + { + return true; + } + } + else + { + var paramElementType = currentNetParam.ParameterType.GetElementType(); + + try + { + extractValue = translator.typeChecker.CheckLuaType(luaState, currentLuaParam, paramElementType); + } + catch (Exception/* ex*/) + { + Debug.WriteLine(string.Format("An error occurred during an attempt to retrieve an extractor ({0}) while checking for params array status.", paramElementType.FullName)); + } + + if (extractValue != null) + { + return true; + } + } + } + return isParamArray; + } + } +} \ No newline at end of file diff --git a/src/Method/EventHandlerContainer.cs b/src/Method/EventHandlerContainer.cs new file mode 100644 index 0000000000000000000000000000000000000000..adf2517c43e95c149fb4bacd05c3e69dbf4d9d7e --- /dev/null +++ b/src/Method/EventHandlerContainer.cs @@ -0,0 +1,36 @@ +using System; +using System.Diagnostics; +using System.Collections.Generic; + +namespace NLua.Method +{ + /// + /// We keep track of what delegates we have auto attached to an event - to allow us to cleanly exit a NLua session + /// + class EventHandlerContainer : IDisposable + { + private Dictionary dict = new Dictionary(); + + public void Add(Delegate handler, RegisterEventHandler eventInfo) + { + dict.Add(handler, eventInfo); + } + + public void Remove(Delegate handler) + { + bool found = dict.Remove(handler); + Debug.Assert(found); + } + + /// + /// Remove any still registered handlers + /// + public void Dispose() + { + foreach (KeyValuePair pair in dict) + pair.Value.RemovePending(pair.Key); + + dict.Clear(); + } + } +} \ No newline at end of file diff --git a/src/Method/LuaClassHelper.cs b/src/Method/LuaClassHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..638250a8a7d4cf6ef38e2bc101a5afe370b858e2 --- /dev/null +++ b/src/Method/LuaClassHelper.cs @@ -0,0 +1,62 @@ +using System; + +namespace NLua.Method +{ + /* + * Static helper methods for Lua tables acting as CLR objects. + * + * Author: Fabio Mascarenhas + * Version: 1.0 + */ + public class LuaClassHelper + { + /* + * Gets the function called name from the provided table, + * returning null if it does not exist + */ + public static LuaFunction GetTableFunction(LuaTable luaTable, string name) + { + if (luaTable == null) + return null; + + object funcObj = luaTable.RawGet(name); + + if (funcObj is LuaFunction) + return (LuaFunction)funcObj; + else + return null; + } + + /* + * Calls the provided function with the provided parameters + */ + public static object CallFunction(LuaFunction function, object[] args, Type[] returnTypes, object[] inArgs, int[] outArgs) + { + // args is the return array of arguments, inArgs is the actual array + // of arguments passed to the function (with in parameters only), outArgs + // has the positions of out parameters + object returnValue; + int iRefArgs; + object[] returnValues = function.Call(inArgs, returnTypes); + + if (returnTypes[0] == typeof(void)) + { + returnValue = null; + iRefArgs = 0; + } + else + { + returnValue = returnValues[0]; + iRefArgs = 1; + } + + for (int i = 0; i < outArgs.Length; i++) + { + args[outArgs[i]] = returnValues[iRefArgs]; + iRefArgs++; + } + + return returnValue; + } + } +} \ No newline at end of file diff --git a/src/Method/LuaDelegate.cs b/src/Method/LuaDelegate.cs new file mode 100644 index 0000000000000000000000000000000000000000..bd57b23b6753d18abcdee4832f026bf050cb9421 --- /dev/null +++ b/src/Method/LuaDelegate.cs @@ -0,0 +1,47 @@ +using System; + +namespace NLua.Method +{ + public class LuaDelegate + { + public LuaFunction function; + public Type[] returnTypes; + + public LuaDelegate() + { + function = null; + returnTypes = null; + } + + public object CallFunction(object[] args, object[] inArgs, int[] outArgs) + { + // args is the return array of arguments, inArgs is the actual array + // of arguments passed to the function (with in parameters only), outArgs + // has the positions of out parameters + object returnValue; + int iRefArgs; + object[] returnValues = function.Call(inArgs, returnTypes); + + if (returnTypes[0] == typeof(void)) + { + returnValue = null; + iRefArgs = 0; + } + else + { + returnValue = returnValues[0]; + iRefArgs = 1; + } + + // Sets the value of out and ref parameters (from + // the values returned by the Lua function). + for (int i = 0; i < outArgs.Length; i++) + { + args[outArgs[i]] = returnValues[iRefArgs]; + iRefArgs++; + } + + return returnValue; + } + } +} \ No newline at end of file diff --git a/src/Method/LuaEventHandler.cs b/src/Method/LuaEventHandler.cs new file mode 100644 index 0000000000000000000000000000000000000000..e467bb91159eb2851354b51e348e771a570912ed --- /dev/null +++ b/src/Method/LuaEventHandler.cs @@ -0,0 +1,14 @@ +namespace NLua.Method +{ + public class LuaEventHandler + { + public LuaFunction handler = null; + + // CP: Fix provided by Ben Bryant for delegates with one param + // link: http://luaforge.net/forum/message.php?msg_id=9318 + public void HandleEvent(object[] args) + { + handler.Call(args); + } + } +} \ No newline at end of file diff --git a/src/Method/LuaMethodWrapper.cs b/src/Method/LuaMethodWrapper.cs new file mode 100644 index 0000000000000000000000000000000000000000..2c8b0f98d67de32b791cb725112e50f498e61822 --- /dev/null +++ b/src/Method/LuaMethodWrapper.cs @@ -0,0 +1,312 @@ +using System; +using System.Reflection; +using System.Collections.Generic; +using System.Linq; + +using NLua.Exceptions; +using NLua.Extensions; + +using LuaState = KeraLua.Lua; +using LuaNativeFunction = KeraLua.LuaFunction; + +namespace NLua.Method +{ + /* + * Argument extraction with type-conversion function + */ + delegate object ExtractValue(LuaState luaState, int stackPos); + + /* + * Wrapper class for methods/constructors accessed from Lua. + * + */ + class LuaMethodWrapper + { + internal LuaNativeFunction invokeFunction; + ObjectTranslator _Translator; + MethodBase _Method; + MethodCache _LastCalledMethod = new MethodCache(); + string _MethodName; + MemberInfo[] _Members; + ExtractValue _ExtractTarget; + object _Target; + bool _IsStatic; + + /* + * Constructs the wrapper for a known MethodBase instance + */ + public LuaMethodWrapper(ObjectTranslator translator, object target, ProxyType targetType, MethodBase method) + { + invokeFunction = Call; + _Translator = translator; + _Target = target; + + if (targetType != null) + _ExtractTarget = translator.typeChecker.GetExtractor(targetType); + + _Method = method; + _MethodName = method.Name; + _IsStatic = method.IsStatic; + } + + /* + * Constructs the wrapper for a known method name + */ + public LuaMethodWrapper(ObjectTranslator translator, ProxyType targetType, string methodName, BindingFlags bindingType) + { + invokeFunction = Call; + + _Translator = translator; + _MethodName = methodName; + + if (targetType != null) + _ExtractTarget = translator.typeChecker.GetExtractor(targetType); + + _IsStatic = (bindingType & BindingFlags.Static) == BindingFlags.Static; + _Members = GetMethodsRecursively(targetType.UnderlyingSystemType, methodName, bindingType | BindingFlags.Public); + } + + MethodInfo[] GetMethodsRecursively(Type type, string methodName, BindingFlags bindingType) + { + if (type == typeof(object)) + return type.GetMethods(methodName, bindingType); + + var methods = type.GetMethods(methodName, bindingType); + var baseMethods = GetMethodsRecursively(type.BaseType, methodName, bindingType); + + return methods.Concat(baseMethods).ToArray(); + } + + /// + /// Convert C# exceptions into Lua errors + /// + /// num of things on stack + /// null for no pending exception + int SetPendingException(Exception e) + { + return _Translator.interpreter.SetPendingException(e); + } + + /* + * Calls the method. Receives the arguments from the Lua stack + * and returns values in it. + */ + int Call(IntPtr state) + { + var luaState = LuaState.FromIntPtr(state); + var methodToCall = _Method; + object targetObject = _Target; + bool failedCall = true; + int nReturnValues = 0; + + if (!luaState.CheckStack(5)) + throw new LuaException("Lua stack overflow"); + + bool isStatic = _IsStatic; + SetPendingException(null); + + if (methodToCall == null) + { // Method from name + if (isStatic) + targetObject = null; + else + targetObject = _ExtractTarget(luaState, 1); + + if (_LastCalledMethod.cachedMethod != null) + { // Cached? + int numStackToSkip = isStatic ? 0 : 1; // If this is an instance invoe we will have an extra arg on the stack for the targetObject + int numArgsPassed = luaState.GetTop() - numStackToSkip; + MethodBase method = _LastCalledMethod.cachedMethod; + + if (numArgsPassed == _LastCalledMethod.argTypes.Length) + { // No. of args match? + if (!luaState.CheckStack(_LastCalledMethod.outList.Length + 6)) + throw new LuaException("Lua stack overflow"); + + object[] args = _LastCalledMethod.args; + + try + { + for (int i = 0; i < _LastCalledMethod.argTypes.Length; i++) + { + MethodArgs type = _LastCalledMethod.argTypes[i]; + + int index = i + 1 + numStackToSkip; + + Func valueExtractor = currentParam => { + return type.extractValue(luaState, currentParam); + }; + + if (_LastCalledMethod.argTypes[i].isParamsArray) + { + int count = _LastCalledMethod.argTypes.Length - i; + Array paramArray = _Translator.TableToArray(valueExtractor, type.paramsArrayType, index, count); + args[_LastCalledMethod.argTypes[i].index] = paramArray; + } + else + { + args[type.index] = valueExtractor(index); + } + + if (_LastCalledMethod.args[_LastCalledMethod.argTypes[i].index] == null && + !luaState.IsNil(i + 1 + numStackToSkip)) + throw new LuaException(string.Format("Argument number {0} is invalid", (i + 1))); + } + + if (_IsStatic) + _Translator.Push(luaState, method.Invoke(null, _LastCalledMethod.args)); + else + { + if (method.IsConstructor) + _Translator.Push(luaState, ((ConstructorInfo)method).Invoke(_LastCalledMethod.args)); + else + _Translator.Push(luaState, method.Invoke(targetObject, _LastCalledMethod.args)); + } + + failedCall = false; + } + catch (TargetInvocationException e) + { + // Failure of method invocation + if (_Translator.interpreter.UseTraceback) e.GetBaseException().Data["Traceback"] = _Translator.interpreter.GetDebugTraceback(); + return SetPendingException(e.GetBaseException()); + } + catch (Exception e) + { + if (_Members.Length == 1) // Is the method overloaded? + // No, throw error + return SetPendingException(e); + } + } + } + + // Cache miss + if (failedCall) + { + // System.Diagnostics.Debug.WriteLine("cache miss on " + methodName); + // If we are running an instance variable, we can now pop the targetObject from the stack + if (!isStatic) + { + if (targetObject == null) + { + _Translator.ThrowError(luaState, string.Format("instance method '{0}' requires a non null target object", _MethodName)); + luaState.PushNil(); + return 1; + } + + luaState.Remove(1); // Pops the receiver + } + + bool hasMatch = false; + string candidateName = null; + + foreach (var member in _Members) + { + candidateName = member.ReflectedType.Name + "." + member.Name; + var m = (MethodInfo)member; + bool isMethod = _Translator.MatchParameters(luaState, m, ref _LastCalledMethod); + + if (isMethod) + { + hasMatch = true; + break; + } + } + + if (!hasMatch) + { + string msg = (candidateName == null) ? "Invalid arguments to method call" : ("Invalid arguments to method: " + candidateName); + _Translator.ThrowError(luaState, msg); + luaState.PushNil(); + return 1; + } + } + } + else + { // Method from MethodBase instance + if (methodToCall.ContainsGenericParameters) + { + _Translator.MatchParameters(luaState, methodToCall, ref _LastCalledMethod); + + if (methodToCall.IsGenericMethodDefinition) + { + //need to make a concrete type of the generic method definition + var typeArgs = new List(); + + foreach (object arg in _LastCalledMethod.args) + typeArgs.Add(arg.GetType()); + + var concreteMethod = ((MethodInfo)methodToCall).MakeGenericMethod(typeArgs.ToArray()); + _Translator.Push(luaState, concreteMethod.Invoke(targetObject, _LastCalledMethod.args)); + failedCall = false; + } + else if (methodToCall.ContainsGenericParameters) + { + _Translator.ThrowError(luaState, "Unable to invoke method on generic class as the current method is an open generic method"); + luaState.PushNil(); + return 1; + } + } + else + { + if (!methodToCall.IsStatic && !methodToCall.IsConstructor && targetObject == null) + { + targetObject = _ExtractTarget(luaState, 1); + luaState.Remove(1); // Pops the receiver + } + + if (!_Translator.MatchParameters(luaState, methodToCall, ref _LastCalledMethod)) + { + _Translator.ThrowError(luaState, "Invalid arguments to method call"); + luaState.PushNil(); + return 1; + } + } + } + + if (failedCall) + { + if (!luaState.CheckStack(_LastCalledMethod.outList.Length + 6)) + throw new LuaException("Lua stack overflow"); + + try + { + if (isStatic) + _Translator.Push(luaState, _LastCalledMethod.cachedMethod.Invoke(null, _LastCalledMethod.args)); + else + { + if (_LastCalledMethod.cachedMethod.IsConstructor) + _Translator.Push(luaState, ((ConstructorInfo)_LastCalledMethod.cachedMethod).Invoke(_LastCalledMethod.args)); + else + _Translator.Push(luaState, _LastCalledMethod.cachedMethod.Invoke(targetObject, _LastCalledMethod.args)); + } + } + catch (TargetInvocationException e) + { + if (_Translator.interpreter.UseTraceback) e.GetBaseException().Data["Traceback"] = _Translator.interpreter.GetDebugTraceback(); + return SetPendingException(e.GetBaseException()); + } + catch (Exception e) + { + return SetPendingException(e); + } + } + + // Pushes out and ref return values + for (int index = 0; index < _LastCalledMethod.outList.Length; index++) + { + nReturnValues++; + _Translator.Push(luaState, _LastCalledMethod.args[_LastCalledMethod.outList[index]]); + } + + + // If not return void,we need add 1, + // or we will lost the function's return value + // when call dotnet function like "int foo(arg1,out arg2,out arg3)" in Lua code + if (!_LastCalledMethod.IsReturnVoid && nReturnValues > 0) + nReturnValues++; + + return nReturnValues < 1 ? 1 : nReturnValues; + } + } +} \ No newline at end of file diff --git a/src/Method/MethodArgs.cs b/src/Method/MethodArgs.cs new file mode 100644 index 0000000000000000000000000000000000000000..27037b0039a119ffd5e35945a973c8e0f27b17cf --- /dev/null +++ b/src/Method/MethodArgs.cs @@ -0,0 +1,17 @@ +using System; + +namespace NLua.Method +{ + /* + * Parameter information + */ + struct MethodArgs + { + // Position of parameter + public int index; + // Type-conversion function + public ExtractValue extractValue; + public bool isParamsArray; + public Type paramsArrayType; + } +} \ No newline at end of file diff --git a/src/Method/MethodCache.cs b/src/Method/MethodCache.cs new file mode 100644 index 0000000000000000000000000000000000000000..4298e112bd4be08b641d2b8f3c1a4651fd33d317 --- /dev/null +++ b/src/Method/MethodCache.cs @@ -0,0 +1,36 @@ +using System; +using System.Reflection; +using NLua.Extensions; + +namespace NLua.Method +{ + struct MethodCache + { + private MethodBase _cachedMethod; + + public MethodBase cachedMethod { + get + { + return _cachedMethod; + } + set + { + _cachedMethod = value; + var mi = value as MethodInfo; + + if (mi != null) + { + IsReturnVoid = mi.ReturnType == typeof(void); + } + } + } + + public bool IsReturnVoid; + // List or arguments + public object[] args; + // Positions of out parameters + public int[] outList; + // Types of parameters + public MethodArgs[] argTypes; + } +} \ No newline at end of file diff --git a/src/Method/RegisterEventHandler.cs b/src/Method/RegisterEventHandler.cs new file mode 100644 index 0000000000000000000000000000000000000000..5379c6be120b6c074ee81be413906eaef2d29821 --- /dev/null +++ b/src/Method/RegisterEventHandler.cs @@ -0,0 +1,50 @@ +using System; +using System.Reflection; + +namespace NLua.Method +{ + class RegisterEventHandler + { + private EventHandlerContainer pendingEvents; + private EventInfo eventInfo; + private object target; + + public RegisterEventHandler(EventHandlerContainer pendingEvents, object target, EventInfo eventInfo) + { + this.target = target; + this.eventInfo = eventInfo; + this.pendingEvents = pendingEvents; + } + + /* + * Adds a new event handler + */ + public Delegate Add(LuaFunction function) + { + //CP: Fix by Ben Bryant for event handling with one parameter + //link: http://luaforge.net/forum/message.php?msg_id=9266 + Delegate handlerDelegate = CodeGeneration.Instance.GetDelegate(eventInfo.EventHandlerType, function); + eventInfo.AddEventHandler(target, handlerDelegate); + pendingEvents.Add(handlerDelegate, this); + + return handlerDelegate; + } + + /* + * Removes an existing event handler + */ + public void Remove(Delegate handlerDelegate) + { + RemovePending(handlerDelegate); + pendingEvents.Remove(handlerDelegate); + } + + /* + * Removes an existing event handler (without updating the pending handlers list) + */ + internal void RemovePending(Delegate handlerDelegate) + { + eventInfo.RemoveEventHandler(target, handlerDelegate); + } + } +} \ No newline at end of file diff --git a/src/NLua.Core.projitems b/src/NLua.Core.projitems new file mode 100644 index 0000000000000000000000000000000000000000..425830600d889a5cf4f9333d55b7d5bf4c5f1d67 --- /dev/null +++ b/src/NLua.Core.projitems @@ -0,0 +1,46 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + {BD205AD6-760E-48F3-BAB2-21447396BD17} + + + NLua + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/NLua.Shared.shproj b/src/NLua.Shared.shproj new file mode 100644 index 0000000000000000000000000000000000000000..90af1668c5e236c709cfc76c25907639b21badb3 --- /dev/null +++ b/src/NLua.Shared.shproj @@ -0,0 +1,11 @@ + + + + {BD205AD6-760E-48F3-BAB2-21447396BD17} + + + + + + + \ No newline at end of file diff --git a/src/NLua.Shared.shproj.user b/src/NLua.Shared.shproj.user new file mode 100644 index 0000000000000000000000000000000000000000..baf24173ca1a70b3c845967bfc1ed86ed309b6b7 --- /dev/null +++ b/src/NLua.Shared.shproj.user @@ -0,0 +1,6 @@ + + + + false + + \ No newline at end of file diff --git a/src/ObjectTranslator.cs b/src/ObjectTranslator.cs new file mode 100644 index 0000000000000000000000000000000000000000..4d3f45e0c8526977b34dc2c69733bbd79d88508c --- /dev/null +++ b/src/ObjectTranslator.cs @@ -0,0 +1,1121 @@ +using System; +using System.IO; +using System.Reflection; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using KeraLua; + +using NLua.Method; +using NLua.Exceptions; +using NLua.Extensions; + +#if __IOS__ || __TVOS__ || __WATCHOS__ + using ObjCRuntime; +#endif + +using LuaState = KeraLua.Lua; +using LuaNativeFunction = KeraLua.LuaFunction; + +namespace NLua +{ + public class ObjectTranslator + { + // Compare cache entries by exact reference to avoid unwanted aliases + private class ReferenceComparer : IEqualityComparer + { + public new bool Equals(object x, object y) + { + if (x != null && y != null && x.GetType() == y.GetType() && x.GetType().IsValueType && y.GetType().IsValueType) + return x.Equals(y); // Special case for boxed value types + return ReferenceEquals(x, y); + } + + public int GetHashCode(object obj) + { + return obj.GetHashCode(); + } + } + + readonly LuaNativeFunction registerTableFunction; + readonly LuaNativeFunction unregisterTableFunction; + readonly LuaNativeFunction getMethodSigFunction; + readonly LuaNativeFunction getConstructorSigFunction; + readonly LuaNativeFunction importTypeFunction; + readonly LuaNativeFunction loadAssemblyFunction; + readonly LuaNativeFunction ctypeFunction; + readonly LuaNativeFunction enumFromIntFunction; + + // object to object # + readonly Dictionary objectsBackMap = new Dictionary(new ReferenceComparer()); + // object # to object (FIXME - it should be possible to get object address as an object #) + readonly Dictionary objects = new Dictionary(); + internal EventHandlerContainer pendingEvents = new EventHandlerContainer(); + MetaFunctions metaFunctions; + List assemblies; + internal CheckType typeChecker; + internal Lua interpreter; + /// + /// We want to ensure that objects always have a unique ID + /// + int nextObj = 0; + + public MetaFunctions MetaFunctionsInstance => metaFunctions; + public Lua Interpreter => interpreter; + public IntPtr Tag => _tagPtr; + + readonly IntPtr _tagPtr; + + public ObjectTranslator(Lua interpreter, LuaState luaState) + { + _tagPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int))); + this.interpreter = interpreter; + typeChecker = new CheckType(this); + metaFunctions = new MetaFunctions(this); + assemblies = new List(); + + importTypeFunction = ImportType; + loadAssemblyFunction = LoadAssembly; + registerTableFunction = RegisterTable; + unregisterTableFunction = UnregisterTable; + getMethodSigFunction = GetMethodSignature; + getConstructorSigFunction = GetConstructorSignature; + ctypeFunction = CType; + enumFromIntFunction = EnumFromInt; + + CreateLuaObjectList(luaState); + CreateIndexingMetaFunction(luaState); + CreateBaseClassMetatable(luaState); + CreateClassMetatable(luaState); + CreateFunctionMetatable(luaState); + SetGlobalFunctions(luaState); + + } + + /* + * Sets up the list of objects in the Lua side + */ + private void CreateLuaObjectList(LuaState luaState) + { + luaState.PushString("luaNet_objects"); + luaState.NewTable(); + luaState.NewTable(); + luaState.PushString("__mode"); + luaState.PushString("v"); + luaState.SetTable(-3); + luaState.SetMetaTable(-2); + luaState.SetTable((int)LuaRegistry.Index); + } + + /* + * Registers the indexing function of CLR objects + * passed to Lua + */ + private void CreateIndexingMetaFunction(LuaState luaState) + { + luaState.PushString("luaNet_indexfunction"); + luaState.DoString(MetaFunctions.LuaIndexFunction); + luaState.RawSet((int)LuaRegistry.Index); + } + + /* + * Creates the metatable for superclasses (the base + * field of registered tables) + */ + private void CreateBaseClassMetatable(LuaState luaState) + { + luaState.NewMetaTable("luaNet_searchbase"); + luaState.PushString("__gc"); + luaState.PushCFunction(metaFunctions.GcFunction); + luaState.SetTable(-3); + luaState.PushString("__tostring"); + luaState.PushCFunction(metaFunctions.ToStringFunction); + luaState.SetTable(-3); + luaState.PushString("__index"); + luaState.PushCFunction(metaFunctions.BaseIndexFunction); + luaState.SetTable(-3); + luaState.PushString("__newindex"); + luaState.PushCFunction(metaFunctions.NewIndexFunction); + luaState.SetTable(-3); + luaState.SetTop(-2); + } + + /* + * Creates the metatable for type references + */ + private void CreateClassMetatable(LuaState luaState) + { + luaState.NewMetaTable("luaNet_class"); + luaState.PushString("__gc"); + luaState.PushCFunction(metaFunctions.GcFunction); + luaState.SetTable(-3); + luaState.PushString("__tostring"); + luaState.PushCFunction(metaFunctions.ToStringFunction); + luaState.SetTable(-3); + luaState.PushString("__index"); + luaState.PushCFunction(metaFunctions.ClassIndexFunction); + luaState.SetTable(-3); + luaState.PushString("__newindex"); + luaState.PushCFunction(metaFunctions.ClassNewIndexFunction); + luaState.SetTable(-3); + luaState.PushString("__call"); + luaState.PushCFunction(metaFunctions.CallConstructorFunction); + luaState.SetTable(-3); + luaState.SetTop(-2); + } + + /* + * Registers the global functions used by NLua + */ + private void SetGlobalFunctions(LuaState luaState) + { + luaState.PushCFunction(metaFunctions.IndexFunction); + luaState.SetGlobal("get_object_member"); + luaState.PushCFunction(importTypeFunction); + luaState.SetGlobal("import_type"); + luaState.PushCFunction(loadAssemblyFunction); + luaState.SetGlobal("load_assembly"); + luaState.PushCFunction(registerTableFunction); + luaState.SetGlobal("make_object"); + luaState.PushCFunction(unregisterTableFunction); + luaState.SetGlobal("free_object"); + luaState.PushCFunction(getMethodSigFunction); + luaState.SetGlobal("get_method_bysig"); + luaState.PushCFunction(getConstructorSigFunction); + luaState.SetGlobal("get_constructor_bysig"); + luaState.PushCFunction(ctypeFunction); + luaState.SetGlobal("ctype"); + luaState.PushCFunction(enumFromIntFunction); + luaState.SetGlobal("enum"); + } + + /* + * Creates the metatable for delegates + */ + private void CreateFunctionMetatable(LuaState luaState) + { + luaState.NewMetaTable("luaNet_function"); + luaState.PushString("__gc"); + luaState.PushCFunction(metaFunctions.GcFunction); + luaState.SetTable(-3); + luaState.PushString("__call"); + luaState.PushCFunction(metaFunctions.ExecuteDelegateFunction); + luaState.SetTable(-3); + luaState.SetTop(-2); + } + + /* + * Passes errors (argument e) to the Lua interpreter + */ + internal void ThrowError(LuaState luaState, object e) + { + // We use this to remove anything pushed by luaL_where + int oldTop = luaState.GetTop(); + + // Stack frame #1 is our C# wrapper, so not very interesting to the user + // Stack frame #2 must be the lua code that called us, so that's what we want to use + luaState.Where(1); + var curlev = PopValues(luaState, oldTop); + + // Determine the position in the script where the exception was triggered + string errLocation = string.Empty; + + if (curlev.Length > 0) + errLocation = curlev[0].ToString(); + + string message = e as string; + + if (message != null) + { + // Wrap Lua error (just a string) and store the error location + if (interpreter.UseTraceback) message += Environment.NewLine + interpreter.GetDebugTraceback(); + e = new LuaScriptException(message, errLocation); + } + else + { + var ex = e as Exception; + + if (ex != null) + { + // Wrap generic .NET exception as an InnerException and store the error location + if (interpreter.UseTraceback) ex.Data["Traceback"] = interpreter.GetDebugTraceback(); + e = new LuaScriptException(ex, errLocation); + } + } + + Push(luaState, e); + luaState.Error(); + } + + /* + * Implementation of load_assembly. Throws an error + * if the assembly is not found. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int LoadAssembly(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return translator.LoadAssemblyInternal(state); + } + + private int LoadAssemblyInternal(LuaState luaState) + { + try + { + string assemblyName = luaState.ToString(1); + Assembly assembly = null; + Exception exception = null; + + try + { + assembly = Assembly.Load(assemblyName); + } + catch (BadImageFormatException) + { + // The assemblyName was invalid. It is most likely a path. + } + catch (FileNotFoundException e) + { + exception = e; + } + + if (assembly == null) + { + try + { + assembly = Assembly.Load(AssemblyName.GetAssemblyName(assemblyName)); + } + catch (FileNotFoundException e) + { + exception = e; + } + if (assembly == null) + { + AssemblyName mscor = assemblies[0].GetName(); + AssemblyName name = new AssemblyName(); + name.Name = assemblyName; + name.CultureInfo = mscor.CultureInfo; + name.Version = mscor.Version; + name.SetPublicKeyToken(mscor.GetPublicKeyToken()); + name.SetPublicKey(mscor.GetPublicKey()); + assembly = Assembly.Load(name); + + if (assembly != null) + exception = null; + } + if (exception != null) + ThrowError(luaState, exception); + } + if (assembly != null && !assemblies.Contains(assembly)) + assemblies.Add(assembly); + } + catch (Exception e) + { + ThrowError(luaState, e); + } + return 0; + } + + internal Type FindType(string className) + { + foreach (var assembly in assemblies) + { + var klass = assembly.GetType(className); + + if (klass != null) + return klass; + } + return null; + } + + public bool IsExtensionMethodPresent(Type type, string name) + { + return GetExtensionMethod(type, name) != null; + } + + public MethodInfo GetExtensionMethod(Type type, string name) + { + return type.GetExtensionMethod(name, assemblies); + } + + /* + * Implementation of import_type. Returns nil if the + * type is not found. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int ImportType(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return translator.ImportTypeInternal(state); + } + + private int ImportTypeInternal(LuaState luaState) + { + string className = luaState.ToString(1); + var klass = FindType(className); + + if (klass != null) + PushType(luaState, klass); + else + luaState.PushNil(); + + return 1; + } + + /* + * Implementation of make_object. Registers a table (first + * argument in the stack) as an object subclassing the + * type passed as second argument in the stack. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int RegisterTable(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return translator.RegisterTableInternal(state); + } + + private int RegisterTableInternal(LuaState luaState) + { + if (luaState.Type(1) == LuaType.Table) + { + var luaTable = GetTable(luaState, 1); + string superclassName = luaState.ToString(2).ToString(); + + if (superclassName != null) + { + var klass = FindType(superclassName); + + if (klass != null) + { + // Creates and pushes the object in the stack, setting + // it as the metatable of the first argument + object obj = CodeGeneration.Instance.GetClassInstance(klass, luaTable); + PushObject(luaState, obj, "luaNet_metatable"); + luaState.NewTable(); + luaState.PushString("__index"); + luaState.PushCopy(-3);; + luaState.SetTable(-3); + luaState.PushString("__newindex"); + luaState.PushCopy(-3); + luaState.SetTable(-3); + luaState.SetMetaTable(1); + + // Pushes the object again, this time as the base field + // of the table and with the luaNet_searchbase metatable + luaState.PushString("base"); + int index = AddObject(obj); + PushNewObject(luaState, obj, index, "luaNet_searchbase"); + luaState.RawSet(1); + } + else + ThrowError(luaState, "register_table: can not find superclass '" + superclassName + "'"); + } + else + ThrowError(luaState, "register_table: superclass name can not be null"); + } + else + ThrowError(luaState, "register_table: first arg is not a table"); + + return 0; + } + + /* + * Implementation of free_object. Clears the metatable and the + * base field, freeing the created object for garbage-collection + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int UnregisterTable(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return translator.UnregisterTableInternal(state); + } + + private int UnregisterTableInternal(LuaState luaState) + { + try + { + if (luaState.GetMetaTable(1)) + { + luaState.PushString("__index"); + luaState.GetTable(-2); + object obj = GetRawNetObject(luaState, -1); + + if (obj == null) + ThrowError(luaState, "unregister_table: arg is not valid table"); + + var luaTableField = obj.GetType().GetField("__luaInterface_luaTable"); + + if (luaTableField == null) + ThrowError(luaState, "unregister_table: arg is not valid table"); + + luaTableField.SetValue(obj, null); + luaState.PushNil(); + luaState.SetMetaTable(1); + luaState.PushString("base"); + luaState.PushNil(); + luaState.SetTable(1); + } + else + ThrowError(luaState, "unregister_table: arg is not valid table"); + } + catch (Exception e) + { + ThrowError(luaState, e.Message); + } + + return 0; + } + + /* + * Implementation of get_method_bysig. Returns nil + * if no matching method is not found. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int GetMethodSignature(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return translator.GetMethodSignatureInternal(state); + } + + private int GetMethodSignatureInternal(LuaState luaState) + { + ProxyType klass; + object target; + int udata = luaState.CheckUObject(1, "luaNet_class"); + + if (udata != -1) + { + klass = (ProxyType)objects[udata]; + target = null; + } + else + { + target = GetRawNetObject(luaState, 1); + + if (target == null) + { + ThrowError(luaState, "get_method_bysig: first arg is not type or object reference"); + luaState.PushNil(); + return 1; + } + + klass = new ProxyType(target.GetType()); + } + + string methodName = luaState.ToString(2, false); + var signature = new Type[luaState.GetTop() - 2]; + + for (int i = 0; i < signature.Length; i++) + signature[i] = FindType(luaState.ToString(i + 3, false)); + + try + { + var method = klass.GetMethod(methodName, BindingFlags.Public | BindingFlags.Static | + BindingFlags.Instance, signature); + var wrapper = new LuaMethodWrapper(this, target, klass, method); + LuaNativeFunction invokeDelegate = wrapper.invokeFunction; + PushFunction(luaState, invokeDelegate); + } + catch (Exception e) + { + ThrowError(luaState, e); + luaState.PushNil(); + } + + return 1; + } + + /* + * Implementation of get_constructor_bysig. Returns nil + * if no matching constructor is found. + */ +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int GetConstructorSignature(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return translator.GetConstructorSignatureInternal(state); + } + + private int GetConstructorSignatureInternal(LuaState luaState) + { + ProxyType klass = null; + int udata = luaState.CheckUObject(1, "luaNet_class"); + + if (udata != -1) + klass = (ProxyType)objects[udata]; + + if (klass == null) + ThrowError(luaState, "get_constructor_bysig: first arg is invalid type reference"); + + var signature = new Type[luaState.GetTop() - 1]; + + for (int i = 0; i < signature.Length; i++) + signature[i] = FindType(luaState.ToString(i + 2)); + + try + { + ConstructorInfo constructor = klass.UnderlyingSystemType.GetConstructor(signature); + var wrapper = new LuaMethodWrapper(this, null, klass, constructor); + var invokeDelegate = wrapper.invokeFunction; + PushFunction(luaState, invokeDelegate); + } + catch (Exception e) + { + ThrowError(luaState, e); + luaState.PushNil(); + } + return 1; + } + + /* + * Pushes a type reference into the stack + */ + internal void PushType(LuaState luaState, Type t) + { + PushObject(luaState, new ProxyType(t), "luaNet_class"); + } + + /* + * Pushes a delegate into the stack + */ + internal void PushFunction(LuaState luaState, LuaNativeFunction func) + { + PushObject(luaState, func, "luaNet_function"); + } + + + /* + * Pushes a CLR object into the Lua stack as an userdata + * with the provided metatable + */ + internal void PushObject(LuaState luaState, object o, string metatable) + { + int index = -1; + + // Pushes nil + if (o == null) + { + luaState.PushNil(); + return; + } + + // Object already in the list of Lua objects? Push the stored reference. + bool found = (!o.GetType().IsValueType || o.GetType().IsEnum) && objectsBackMap.TryGetValue(o, out index); + + if (found) + { + luaState.GetMetaTable("luaNet_objects"); + luaState.RawGetInteger(-1, index); + + // Note: starting with lua5.1 the garbage collector may remove weak reference items (such as our luaNet_objects values) when the initial GC sweep + // occurs, but the actual call of the __gc finalizer for that object may not happen until a little while later. During that window we might call + // this routine and find the element missing from luaNet_objects, but collectObject() has not yet been called. In that case, we go ahead and call collect + // object here + // did we find a non nil object in our table? if not, we need to call collect object + var type = luaState.Type(-1); + if (type != LuaType.Nil) + { + luaState.Remove(-2); // drop the metatable - we're going to leave our object on the stack + return; + } + + // MetaFunctions.dumpStack(this, luaState); + luaState.Remove(-1); // remove the nil object value + luaState.Remove(-1); // remove the metatable + CollectObject(o, index); // Remove from both our tables and fall out to get a new ID + } + + index = AddObject(o); + PushNewObject(luaState, o, index, metatable); + } + + /* + * Pushes a new object into the Lua stack with the provided + * metatable + */ + private void PushNewObject(LuaState luaState, object o, int index, string metatable) + { + if (metatable == "luaNet_metatable") + { + // Gets or creates the metatable for the object's type + luaState.GetMetaTable(o.GetType().AssemblyQualifiedName); + + if (luaState.IsNil(-1)) + { + luaState.SetTop(-2); + luaState.NewMetaTable(o.GetType().AssemblyQualifiedName); + luaState.PushString("cache"); + luaState.NewTable(); + luaState.RawSet(-3); + luaState.PushLightUserData(_tagPtr); + luaState.PushNumber(1); + luaState.RawSet(-3); + luaState.PushString("__index"); + luaState.PushString("luaNet_indexfunction"); + luaState.RawGet(LuaRegistry.Index); + luaState.RawSet(-3); + luaState.PushString("__gc"); + luaState.PushCFunction(metaFunctions.GcFunction); + luaState.RawSet(-3); + luaState.PushString("__tostring"); + luaState.PushCFunction(metaFunctions.ToStringFunction); + luaState.RawSet(-3); + luaState.PushString("__newindex"); + luaState.PushCFunction(metaFunctions.NewIndexFunction); + luaState.RawSet(-3); + // Bind C# operator with Lua metamethods (__add, __sub, __mul) + RegisterOperatorsFunctions(luaState, o.GetType()); + RegisterCallMethodForDelegate(luaState, o); + } + } + else + luaState.GetMetaTable(metatable); + + // Stores the object index in the Lua list and pushes the + // index into the Lua stack + luaState.GetMetaTable("luaNet_objects"); + luaState.NewUData(index); + luaState.PushCopy(-3); + luaState.Remove(-4); + luaState.SetMetaTable(-2); + luaState.PushCopy(-1); + luaState.RawSetInteger(-3, index); + luaState.Remove(-2); + } + + void RegisterCallMethodForDelegate(LuaState luaState, object o) + { + if (!(o is Delegate)) + return; + + luaState.PushString("__call"); + luaState.PushCFunction(metaFunctions.CallDelegateFunction); + luaState.RawSet(-3); + } + + void RegisterOperatorsFunctions(LuaState luaState, Type type) + { + if (type.HasAdditionOperator()) + { + luaState.PushString("__add"); + luaState.PushCFunction(metaFunctions.AddFunction); + luaState.RawSet(-3); + } + if (type.HasSubtractionOperator()) + { + luaState.PushString("__sub"); + luaState.PushCFunction(metaFunctions.SubtractFunction); + luaState.RawSet(-3); + } + if (type.HasMultiplyOperator()) + { + luaState.PushString("__mul"); + luaState.PushCFunction(metaFunctions.MultiplyFunction); + luaState.RawSet(-3); + } + if (type.HasDivisionOperator()) + { + luaState.PushString("__div"); + luaState.PushCFunction(metaFunctions.DivisionFunction); + luaState.RawSet(-3); + } + if (type.HasModulusOperator()) + { + luaState.PushString("__mod"); + luaState.PushCFunction(metaFunctions.ModulosFunction); + luaState.RawSet(-3); + } + if (type.HasUnaryNegationOperator()) + { + luaState.PushString("__unm"); + luaState.PushCFunction(metaFunctions.UnaryNegationFunction); + luaState.RawSet(-3); + } + if (type.HasEqualityOperator()) + { + luaState.PushString("__eq"); + luaState.PushCFunction(metaFunctions.EqualFunction); + luaState.RawSet(-3); + } + if (type.HasLessThanOperator()) + { + luaState.PushString("__lt"); + luaState.PushCFunction(metaFunctions.LessThanFunction); + luaState.RawSet(-3); + } + if (type.HasLessThanOrEqualOperator()) + { + luaState.PushString("__le"); + luaState.PushCFunction(metaFunctions.LessThanOrEqualFunction); + luaState.RawSet(-3); + } + } + + /* + * Gets an object from the Lua stack with the desired type, if it matches, otherwise + * returns null. + */ + internal object GetAsType(LuaState luaState, int stackPos, Type paramType) + { + var extractor = typeChecker.CheckLuaType(luaState, stackPos, paramType); + return extractor != null ? extractor(luaState, stackPos) : null; + } + + /// + /// Given the Lua int ID for an object remove it from our maps + /// + /// + internal void CollectObject(int udata) + { + object o; + bool found = objects.TryGetValue(udata, out o); + + // The other variant of collectObject might have gotten here first, in that case we will silently ignore the missing entry + if (found) + CollectObject(o, udata); + } + + /// + /// Given an object reference, remove it from our maps + /// + /// + private void CollectObject(object o, int udata) + { + objects.Remove(udata); +#if NETFX_CORE + if (!o.GetType ().GetTypeInfo ().IsValueType || o.GetType().GetTypeInfo().IsEnum) +#else + if (!o.GetType().IsValueType || o.GetType().IsEnum) +#endif + objectsBackMap.Remove(o); + } + + private int AddObject(object obj) + { + // New object: inserts it in the list + int index = nextObj++; + objects[index] = obj; + + if (!obj.GetType().IsValueType || obj.GetType().IsEnum) + objectsBackMap[obj] = index; + + return index; + } + + /* + * Gets an object from the Lua stack according to its Lua type. + */ + internal object GetObject(LuaState luaState, int index) + { + var type = luaState.Type(index); + + switch (type) + { + case LuaType.Number: + { + return luaState.ToNumber(index); + } + case LuaType.String: + { + return luaState.ToString(index); + } + case LuaType.Boolean: + { + return luaState.ToBoolean(index); + } + case LuaType.Table: + { + return GetTable(luaState, index); + } + case LuaType.Function: + { + return GetFunction(luaState, index); + } + case LuaType.UserData: + { + int udata = luaState.ToNetObject(index, Tag); + return udata != -1 ? objects[udata] : GetUserData(luaState, index); + } + default: + return null; + } + } + + /* + * Gets the table in the index positon of the Lua stack. + */ + internal LuaTable GetTable(LuaState luaState, int index) + { + luaState.PushCopy(index); + int reference = luaState.Ref(LuaRegistry.Index); + if (reference == -1) + return null; + return new LuaTable(reference, interpreter); + } + + /* + * Gets the userdata in the index positon of the Lua stack. + */ + internal LuaUserData GetUserData(LuaState luaState, int index) + { + luaState.PushCopy(index); + int reference = luaState.Ref(LuaRegistry.Index); + if (reference == -1) + return null; + return new LuaUserData(reference, interpreter); + } + + /* + * Gets the function in the index positon of the Lua stack. + */ + internal LuaFunction GetFunction(LuaState luaState, int index) + { + luaState.PushCopy(index); + var x = luaState.Type(1); + int reference = luaState.Ref(LuaRegistry.Index); + if (reference == -1) + return null; + return new LuaFunction(reference, interpreter); + } + + /* + * Gets the CLR object in the index positon of the Lua stack. Returns + * delegates as Lua functions. + */ + internal object GetNetObject(LuaState luaState, int index) + { + int idx = luaState.ToNetObject(index, Tag); + return idx != -1 ? objects[idx] : null; + } + + /* + * Gets the CLR object in the index position of the Lua stack. Returns + * delegates as is. + */ + internal object GetRawNetObject(LuaState luaState, int index) + { + int udata = luaState.RawNetObj(index); + return udata != -1 ? objects[udata] : null; + } + + + /* + * Gets the values from the provided index to + * the top of the stack and returns them in an array. + */ + internal object[] PopValues(LuaState luaState, int oldTop) + { + int newTop = luaState.GetTop(); + + if (oldTop == newTop) + return null; + else + { + var returnValues = new List(); + for (int i = oldTop + 1; i <= newTop; i++) + returnValues.Add(GetObject(luaState, i)); + + luaState.SetTop(oldTop); + return returnValues.ToArray(); + } + } + + /* + * Gets the values from the provided index to + * the top of the stack and returns them in an array, casting + * them to the provided types. + */ + internal object[] PopValues(LuaState luaState, int oldTop, Type[] popTypes) + { + int newTop = luaState.GetTop(); + + if (oldTop == newTop) + return null; + + int iTypes; + var returnValues = new List(); + + if (popTypes[0] == typeof(void)) + iTypes = 1; + else + iTypes = 0; + + for (int i = oldTop + 1; i <= newTop; i++) + { + returnValues.Add(GetAsType(luaState, i, popTypes[iTypes])); + iTypes++; + } + + luaState.SetTop(oldTop); + return returnValues.ToArray(); + } + + // The following line doesn't work for remoting proxies - they always return a match for 'is' + // else if (o is ILuaGeneratedType) + private static bool IsILua(object o) + { + if (o is ILuaGeneratedType) + { + // Make sure we are _really_ ILuaGenerated + var typ = o.GetType(); + return typ.GetInterface("ILuaGeneratedType", true) != null; + } + return false; + } + + /* + * Pushes the object into the Lua stack according to its type. + */ + internal void Push(LuaState luaState, object o) + { + if (o == null) + luaState.PushNil(); + else if (o is sbyte || o is byte || o is short || o is ushort || + o is int || o is uint || o is long || o is float || + o is ulong || o is decimal || o is double) + { + double d = Convert.ToDouble(o); + luaState.PushNumber(d); + } + else if (o is char) + { + double d = (char)o; + luaState.PushNumber(d); + } + else if (o is string) + { + string str = (string)o; + luaState.PushString(str); + } + else if (o is bool) + { + bool b = (bool)o; + luaState.PushBoolean(b); + } + else if (IsILua(o)) + ((ILuaGeneratedType)o).LuaInterfaceGetLuaTable().Push(luaState); + else if (o is LuaTable) + ((LuaTable)o).Push(luaState); + else if (o is LuaNativeFunction) + PushFunction(luaState, (LuaNativeFunction)o); + else if (o is LuaFunction) + ((LuaFunction)o).Push(luaState); + else + PushObject(luaState, o, "luaNet_metatable"); + } + + /* + * Checks if the method matches the arguments in the Lua stack, getting + * the arguments if it does. + */ + internal bool MatchParameters(LuaState luaState, MethodBase method, ref MethodCache methodCache) + { + return metaFunctions.MatchParameters(luaState, method, ref methodCache); + } + + internal Array TableToArray(Func luaParamValue, Type paramArrayType, int startIndex, int count) + { + return metaFunctions.TableToArray(luaParamValue, paramArrayType, startIndex, count); + } + + private Type TypeOf(LuaState luaState, int idx) + { + int udata = luaState.CheckUObject(1, "luaNet_class"); + if (udata == -1) + return null; + + var pt = (ProxyType)objects[udata]; + return pt.UnderlyingSystemType; + } + + static int PushError(LuaState luaState, string msg) + { + luaState.PushNil(); + luaState.PushString(msg); + return 2; + } + +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int CType(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return translator.CTypeInternal(state); + } + + int CTypeInternal(LuaState luaState) + { + Type t = TypeOf(luaState,1); + if (t == null) + return PushError(luaState, "Not a CLR Class"); + + PushObject(luaState, t, "luaNet_metatable"); + return 1; + } + +#if __IOS__ || __TVOS__ || __WATCHOS__ + [MonoPInvokeCallback(typeof(LuaNativeFunction))] +#endif + private static int EnumFromInt(IntPtr luaState) + { + var state = LuaState.FromIntPtr(luaState); + var translator = ObjectTranslatorPool.Instance.Find(state); + return translator.EnumFromIntInternal(state); + } + + int EnumFromIntInternal(LuaState luaState) + { + Type t = TypeOf(luaState, 1); + if (t == null || !t.IsEnum) + return PushError(luaState, "Not an Enum."); + + object res = null; + LuaType lt = luaState.Type(2); + if (lt == LuaType.Number) + { + int ival = (int)luaState.ToNumber(2); + res = Enum.ToObject(t, ival); + } + else if (lt == LuaType.String) + { + string sflags = luaState.ToString(2); + string err = null; + try + { + res = Enum.Parse(t, sflags, true); + } + catch (ArgumentException e) + { + err = e.Message; + } + if (err != null) + return PushError(luaState, err); + } + else + { + return PushError(luaState, "Second argument must be a integer or a string."); + } + PushObject(luaState, res, "luaNet_metatable"); + return 1; + } + } +} \ No newline at end of file diff --git a/src/ObjectTranslatorPool.cs b/src/ObjectTranslatorPool.cs new file mode 100644 index 0000000000000000000000000000000000000000..c4003976dba302201779a5b5e4f96408f03944a7 --- /dev/null +++ b/src/ObjectTranslatorPool.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Concurrent; +using System.Diagnostics; +using LuaState = KeraLua.Lua; + +namespace NLua +{ + internal class ObjectTranslatorPool + { + private static volatile ObjectTranslatorPool instance = new ObjectTranslatorPool(); + + private ConcurrentDictionary translators = new ConcurrentDictionary(); + + public static ObjectTranslatorPool Instance { + get + { + return instance; + } + } + + public ObjectTranslatorPool() + { + } + + public void Add(LuaState luaState, ObjectTranslator translator) + { + if(!translators.TryAdd(luaState, translator)) + throw new ArgumentException("An item with the same key has already been added. ", "luaState"); + } + + public ObjectTranslator Find(LuaState luaState) + { + ObjectTranslator translator; + + if(!translators.TryGetValue(luaState, out translator)) + { + LuaState main = luaState.MainThread; + + if (!translators.TryGetValue(main, out translator)) + return null; + } + return translator; + } + + public void Remove(LuaState luaState) + { + ObjectTranslator translator; + translators.TryRemove(luaState, out translator); + } + } +} + diff --git a/src/Properties/AssemblyInfo.cs b/src/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000000000000000000000000000000..f14ab27e1cc04bdc813638d1c023ce647cc9d3fa --- /dev/null +++ b/src/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +using System.Reflection; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +#if NETFRAMEWORK +[assembly: AssemblyTitle ("NLua (.NET Framework 4.5)")] +#elif __ANDROID__ +[assembly: AssemblyTitle ("NLua (Xamarin.Android)")] +#elif NETCOREAPP +[assembly: AssemblyTitle ("NLua (.NET Core)")] +#elif NETSTANDARD +[assembly: AssemblyTitle ("NLua (.NET Standard)")] +#elif __TVOS__ +[assembly: AssemblyTitle ("NLua (Xamarin.tvOS)")] +#elif __WATCHOS__ +[assembly: AssemblyTitle ("NLua (Xamarin.watchOS)")] +#elif __IOS__ +[assembly: AssemblyTitle ("NLua (Xamarin.iOS)")] +#elif __MACOS__ +[assembly: AssemblyTitle ("NLua (Xamarin.Mac)")] +#else +[assembly: AssemblyTitle ("NLua (.NET Framework)")] +#endif + +[assembly: AssemblyDescription ("Library to create simple Mazes")] +[assembly: AssemblyCompany ("NLua.org")] +[assembly: AssemblyProduct ("NLua")] +[assembly: AssemblyCopyright ("Copyright © Vinicius Jarina 2019")] +[assembly: AssemblyCulture ("")] + + +[assembly: AssemblyVersion("1.4.1.0")] +[assembly: AssemblyInformationalVersion("1.0.7+Branch.master.Sha.80a328a64f12ed9032a0f14a75e6ecad967514d0")] +[assembly: AssemblyFileVersion("1.4.1.0")] + + diff --git a/src/ProxyType.cs b/src/ProxyType.cs new file mode 100644 index 0000000000000000000000000000000000000000..3896e4c62bc023301f052a6f8e50912ff51d4cd9 --- /dev/null +++ b/src/ProxyType.cs @@ -0,0 +1,59 @@ +using System; +using System.Reflection; + +namespace NLua +{ + /// + /// Summary description for ProxyType. + /// + public class ProxyType + { + private Type proxy; + + public ProxyType(Type proxy) + { + this.proxy = proxy; + } + + /// + /// Provide human readable short hand for this proxy object + /// + /// + public override string ToString() + { + return "ProxyType(" + UnderlyingSystemType + ")"; + } + + public Type UnderlyingSystemType { + get { return proxy; } + } + + public override bool Equals(object obj) + { + if (obj is Type) + return proxy.Equals((Type)obj); + if (obj is ProxyType) + return proxy.Equals(((ProxyType)obj).UnderlyingSystemType); + return proxy.Equals(obj); + } + + public override int GetHashCode() + { + return proxy.GetHashCode(); + } + + public MemberInfo[] GetMember(string name, BindingFlags bindingAttr) + { + return proxy.GetMember(name, bindingAttr); + } + + public MethodInfo GetMethod(string name, BindingFlags bindingAttr, Type[] signature) + { +#if NETFX_CORE + return proxy.GetMethod (name, bindingAttr, signature); +#else + return proxy.GetMethod(name, bindingAttr, null, signature, null); +#endif + } + } +} \ No newline at end of file diff --git a/tests/Core.cs b/tests/Core.cs deleted file mode 100755 index e7731fc4dc4a2239a0bac9a71059af918ee3c205..0000000000000000000000000000000000000000 --- a/tests/Core.cs +++ /dev/null @@ -1,137 +0,0 @@ - -using System; -using NLua; -using NLua.Exceptions; -using System.IO; - -#if WINDOWS_PHONE -using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; -using SetUp = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestInitializeAttribute; -using TearDown = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestCleanupAttribute; -using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute; -using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute; -#else -using NUnit.Framework; -#endif - -#if MONOTOUCH -using Foundation; -#endif - -namespace NLuaTest -{ - [TestFixture] - #if MONOTOUCH - [Preserve (AllMembers = true)] - #endif - public class Core - { - Lua lua = null; - - string GetTestPath(string name) - { - string filePath = Path.Combine (Path.Combine ("LuaTests", "core"), name + ".lua"); - return filePath; - } - - void AssertFile (string path) - { - lua.DoFile (path); - } - - void TestLuaFile (string name) - { - string path = GetTestPath (name); - AssertFile (path); - } - - [SetUp] - public void Setup() - { - lua = new Lua (); - lua.RegisterFunction ("WriteLineString", typeof (Console).GetMethod ("WriteLine", new Type [] { typeof (String) })); - - lua.DoString (@" - function print (param) - WriteLineString (tostring(param)) - end - "); - } - - [TearDown] - public void TearDown () - { - lua.Dispose (); - lua = null; - } - - [Test] - public void Bisect () - { - TestLuaFile ("bisect"); - } - - [Test] - public void CF () - { - TestLuaFile ("cf"); - } - - [Test] - [Ignore] - public void Env () - { - TestLuaFile ("env"); - } - - [Test] - public void Factorial () - { - TestLuaFile ("factorial"); - } - - [Test] - public void FibFor () - { - TestLuaFile ("fibfor"); - } - - [Test] - public void Life () - { - TestLuaFile ("life"); - } - - [Test] - public void Printf () - { - TestLuaFile ("printf"); - } - - [Test] - [Ignore] - public void ReadOnly () - { - TestLuaFile ("readonly"); - } - - [Test] - public void Sieve () - { - TestLuaFile ("sieve"); - } - - [Test] - public void Sort () - { - TestLuaFile ("sort"); - } - - [Test] - [Ignore] - public void TraceGlobals () - { - TestLuaFile ("trace-globals"); - } - } -} diff --git a/tests/Entity.cs b/tests/Entity.cs deleted file mode 100644 index ae1b841d2972cf8b65bc196b1a19ab73c78ffcfc..0000000000000000000000000000000000000000 --- a/tests/Entity.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace NLuaTest.Mock -{ - public class Entity - { - public event EventHandler Clicked; - - protected virtual void OnEntityClicked (EventArgs e) - { - EventHandler handler = Clicked; - - if (handler != null) { - // Use the () operator to raise the event. - handler (this, e); - } - } - - public string Property { - get; - set; - } - - // default ctor - public Entity () - { - Property = "Default"; - } - // string ctor - public Entity (string param) - { - Property = "String"; - - } - - public Entity (int param) - { - Property = "Int"; - } - - public void Click () - { - OnEntityClicked (new EventArgs ()); - } - } -} diff --git a/tests/LuaTests b/tests/LuaTests deleted file mode 160000 index ec14ccfa5cc2f0cda6781029d145abc99f7a9728..0000000000000000000000000000000000000000 --- a/tests/LuaTests +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ec14ccfa5cc2f0cda6781029d145abc99f7a9728 diff --git a/tests/LuaTests.cs b/tests/LuaTests.cs deleted file mode 100755 index 0a78b69cca846fe8f4d7bba49caffac9b7be8497..0000000000000000000000000000000000000000 --- a/tests/LuaTests.cs +++ /dev/null @@ -1,2564 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using NLuaTest.Mock; -using System.Reflection; -using System.Threading; -using NLua; -using NLua.Exceptions; -#if MONOTOUCH -using Foundation; -#endif - -#if WINDOWS_PHONE -using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; -using SetUp = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestInitializeAttribute; -using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute; -using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute; -#else -using NUnit.Framework; -#endif - -namespace NLuaTest -{ - public class parameter - { - public string field1 = "parameter-field1"; - } - - #if MONOTOUCH - [Preserve (AllMembers = true)] - #endif - public class master - { - public static string read() - { - return "test-master"; - } - - public static string read( parameter test ) - { - return test.field1; - } - } - - #if MONOTOUCH - [Preserve (AllMembers = true)] - #endif - public class testClass : master - { - public String strData; - public int intData; - public static string read2() - { - return "test"; - } - - public static string read( int test ) - { - return "int-test"; - } - } - - #if MONOTOUCH - [Preserve (AllMembers = true)] - #endif - public class DefaultElementModel - { - public Action DrawMe{ get; set; } - } - - #if MONOTOUCH - [Preserve (AllMembers = true)] - #endif - public class TestCaseName { - public string name = "name"; - public string Name { - get { - return "**" + name + "**"; - } - } - } - - - -#if MONOTOUCH - [Preserve (AllMembers = true)] -#endif - public class Vector - { - public double x; - public double y; - public static Vector operator * (float k, Vector v) - { - var r = new Vector (); - r.x = v.x * k; - r.y = v.y * k; - return r; - } - - public static Vector operator * (Vector v, float k) - { - var r = new Vector (); - r.x = v.x * k; - r.y = v.y * k; - return r; - } - - public void Func () - { - Console.WriteLine ("Func"); - } - } - - public static class VectorExtension - { - public static double Length (this Vector v) - { - return v.x * v.x + v.y * v.y; - } - } - -#if MONOTOUCH - [Preserve (AllMembers = true)] -#endif - public class Person - { - public string firstName; - } - -#if MONOTOUCH - [Preserve (AllMembers = true)] -#endif - public class Employee : Person - { - public string occupation; - } - - public static class PersonExentsions - { - public static string GetFirstName (this Person argPerson) - { - return argPerson.firstName; - } - } - - [TestFixture] - #if MONOTOUCH - [Preserve (AllMembers = true)] - #endif - public class LuaTests - { - public static readonly char UnicodeChar = '\uE007'; - public static string UnicodeString - { - get - { - return Convert.ToString (UnicodeChar); - } - } - public static string UnicodeStringRussian - { - get - { - return "Файл"; - } - } - /* - * Tests capturing an exception - */ - [Test] - public void ThrowException () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('mscorlib')"); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("err,errMsg=pcall(test.exceptionMethod,test)"); - bool err = (bool)lua ["err"]; - Exception errMsg = (Exception)lua ["errMsg"]; - Assert.AreEqual (false , err); - Assert.AreNotEqual (null, errMsg.InnerException); - Assert.AreEqual ("exception test", errMsg.InnerException.Message); - } - } - - /* - * Tests passing a LuaFunction - */ - [Test] - public void CallLuaFunction() - { - using (Lua lua = new Lua ()) { - lua.DoString ("function someFunc(v1,v2) return v1 + v2 end"); - lua ["funcObject"] = lua.GetFunction ("someFunc"); - - lua.DoString ("luanet.load_assembly('mscorlib')"); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("b = TestClass():TestLuaFunction(funcObject)[0]"); - Assert.AreEqual (3, lua ["b"]); - lua.DoString ("a = TestClass():TestLuaFunction(nil)"); - Assert.AreEqual (null, lua ["a"]); - } - } - - /* - * Tests capturing an exception - */ - [Test] - public void ThrowUncaughtException () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('mscorlib')"); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - - try { - lua.DoString ("test:exceptionMethod()"); - //failed - Assert.AreEqual(false, true); - } catch (Exception) { - //passed - Assert.AreEqual (true, true); - } - } - } - - - /* - * Tests nullable fields - */ - [Test] - public void TestNullable () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('mscorlib')"); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("val=test.NullableBool"); - Assert.AreEqual (null, (object)lua ["val"]); - lua.DoString ("test.NullableBool = true"); - lua.DoString ("val=test.NullableBool"); - Assert.AreEqual (true, (bool)lua ["val"]); - } - } - - /* - * Tests structure assignment - */ - [Test] - public void TestStructs () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("TestStruct=luanet.import_type('NLuaTest.Mock.TestStruct')"); - lua.DoString ("struct=TestStruct(2)"); - lua.DoString ("test.Struct = struct"); - lua.DoString ("val=test.Struct.val"); - Assert.AreEqual (2.0d, (double)lua ["val"]); - } - } - - /* - * Tests structure creation via the default constructor - */ - [Test] - public void TestStructDefaultConstructor () - { - using (Lua lua = new Lua ()) - { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestStruct=luanet.import_type('NLuaTest.Mock.TestStruct')"); - lua.DoString ("struct=TestStruct()"); - Assert.AreEqual (new TestStruct(), (TestStruct)lua ["struct"]); - } - } - - [Test] - public void TestStructHashesEqual() - { - using (Lua lua = new Lua()) - { - lua.DoString("luanet.load_assembly('NLuaTest')"); - lua.DoString("TestStruct=luanet.import_type('NLuaTest.Mock.TestStruct')"); - lua.DoString("struct1=TestStruct(0)"); - lua.DoString("struct2=TestStruct(0)"); - lua.DoString("struct2.val=1"); - Assert.AreEqual(0, (double)lua["struct1.val"]); - } - } - - [Test] - public void TestEnumEqual() - { - using (Lua lua = new Lua()) - { - lua.DoString("luanet.load_assembly('NLuaTest')"); - lua.DoString("TestEnum=luanet.import_type('NLuaTest.Mock.TestEnum')"); - lua.DoString("enum1=TestEnum.ValueA"); - lua.DoString("enum2=TestEnum.ValueB"); - Assert.AreEqual(true, (bool)lua.DoString("return enum1 ~= enum2")[0]); - Assert.AreEqual(false, (bool)lua.DoString("return enum1 == enum2")[0]); - } - } - - [Test] - public void TestMethodOverloads () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('mscorlib')"); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("test:MethodOverload()"); - lua.DoString ("test:MethodOverload(test)"); - lua.DoString ("test:MethodOverload(1,1,1)"); - lua.DoString ("test:MethodOverload(2,2,i)\r\nprint(i)"); - } - } - - [Test] - public void TestDispose () - { - System.GC.Collect (); -#if !WINDOWS_PHONE - long startingMem = System.Diagnostics.Process.GetCurrentProcess ().WorkingSet64; - - for (int i = 0; i < 100; i++) { - using (Lua lua = new Lua ()) { - _Calc (lua, i); - } - } - - //TODO: make this test assert so that it is useful - Console.WriteLine ("Was using " + startingMem / 1024 / 1024 + "MB, now using: " + System.Diagnostics.Process.GetCurrentProcess ().WorkingSet64 / 1024 / 1024 + "MB"); -#endif - } - - private void _Calc (Lua lua, int i) - { - lua.DoString ( - "sqrt = math.sqrt;" + - "sqr = function(x) return math.pow(x,2); end;" + - "log = math.log;" + - "log10 = math.log10;" + - "exp = math.exp;" + - "sin = math.sin;" + - "cos = math.cos;" + - "tan = math.tan;" + - "abs = math.abs;" - ); - lua.DoString ("function calcVP(a,b) return a+b end"); - LuaFunction lf = lua.GetFunction ("calcVP"); - lf.Call (i, 20); - } - - [Test] - public void TestThreading () - { - using (Lua lua = new Lua ()) { - object lua_locker = new object (); - DoWorkClass doWork = new DoWorkClass (); - lua.RegisterFunction ("dowork", doWork, typeof(DoWorkClass).GetMethod ("DoWork")); - bool failureDetected = false; - int completed = 0; - int iterations = 10; - - for (int i = 0; i < iterations; i++) { - ThreadPool.QueueUserWorkItem (new WaitCallback (delegate (object o) { - try { - lock (lua_locker) { - lua.DoString ("dowork()"); - } - } catch (Exception e) { - Console.Write (e); - failureDetected = true; - } - - completed++; - })); - } - - while (completed < iterations && !failureDetected) - Thread.Sleep (50); - - Assert.AreEqual (false, failureDetected); - } - } - - [Test] - public void TestPrivateMethod () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('mscorlib')"); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - - try { - lua.DoString ("test:_PrivateMethod()"); - } catch { - Assert.AreEqual (true, true); - return; - } - - Assert.AreEqual(true, false); - } - } - - /* - * Tests functions - */ - [Test] - public void TestFunctions () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('mscorlib')"); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.RegisterFunction ("p", null, typeof(System.Console).GetMethod ("WriteLine", new Type [] { typeof(String) })); - /// Lua command that works (prints to console) - lua.DoString ("p('Foo')"); - /// Yet this works... - lua.DoString ("string.gsub('some string', '(%w+)', function(s) p(s) end)"); - /// This fails if you don't fix Lua5.1 lstrlib.c/add_value to treat LUA_TUSERDATA the same as LUA_FUNCTION - lua.DoString ("string.gsub('some string', '(%w+)', p)"); - } - } - - - /* - * Tests making an object from a Lua table and calling one of - * methods the table overrides. - */ - [Test] - public void LuaTableOverridedMethod () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test={}"); - lua.DoString ("function test:overridableMethod(x,y) return x*y; end"); - lua.DoString ("luanet.make_object(test,'NLuaTest.Mock.TestClass')"); - lua.DoString ("a=TestClass.callOverridable(test,2,3)"); - int a = (int)lua.GetNumber ("a"); - lua.DoString ("luanet.free_object(test)"); - Assert.AreEqual (6, a); - } - } - - - /* - * Tests making an object from a Lua table and calling a method - * the table does not override. - */ - [Test] - public void LuaTableInheritedMethod () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test={}"); - lua.DoString ("function test:overridableMethod(x,y) return x*y; end"); - lua.DoString ("luanet.make_object(test,'NLuaTest.Mock.TestClass')"); - lua.DoString ("test:setVal(3)"); - lua.DoString ("a=test.testval"); - int a = (int)lua.GetNumber ("a"); - lua.DoString ("luanet.free_object(test)"); - Assert.AreEqual (3, a); - //Console.WriteLine("interface returned: "+a); - } - } - - - /// - /// Basic multiply method which expects 2 floats - /// - /// - /// - /// - private float _TestException (float val, float val2) - { - return val * val2; - } - - class LuaEventArgsHandler : NLua.Method.LuaDelegate - { - void CallFunction (object sender, EventArgs eventArgs) - { - object [] args = new object [] {sender, eventArgs }; - object [] inArgs = new object [] { sender, eventArgs }; - int [] outArgs = new int [] { }; - base.CallFunction (args, inArgs, outArgs); - } - } - - [Test] - public void TestEventException () - { - using (Lua lua = new Lua ()) { - //Register a C# function - MethodInfo testException = this.GetType ().GetMethod ("_TestException", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance, null, new Type [] { - typeof(float), - typeof(float) - }, null); - lua.RegisterFunction ("Multiply", this, testException); - lua.RegisterLuaDelegateType (typeof(EventHandler), typeof(LuaEventArgsHandler)); - //create the lua event handler code for the entity - //includes the bad code! - lua.DoString ("function OnClick(sender, eventArgs)\r\n" + - "--Multiply expects 2 floats, but instead receives 2 strings\r\n" + - "Multiply(asd, es)\r\n" + - "end"); - //create the lua event handler code for the entity - //good code - //lua.DoString("function OnClick(sender, eventArgs)\r\n" + - // "--Multiply expects 2 floats\r\n" + - // "Multiply(2, 50)\r\n" + - // "end"); - //Create the event handler script - lua.DoString ("function SubscribeEntity(e)\r\ne.Clicked:Add(OnClick)\r\nend"); - //Create the entity object - Entity entity = new Entity (); - //Register the entity object with the event handler inside lua - LuaFunction lf = lua.GetFunction ("SubscribeEntity"); - lf.Call (new object [1] { entity }); - - try { - //Cause the event to be fired - entity.Click (); - //failed - Assert.AreEqual(true, false); - } catch (LuaException) { - //passed - Assert.AreEqual (true, true); - } - } - } - - [Test] - public void TestExceptionWithChunkOverload () - { - using (Lua lua = new Lua ()) { - try { - lua.DoString ("thiswillthrowanerror", "MyChunk"); - } catch (Exception e) { - Assert.AreEqual (true, e.Message.StartsWith ("[string \"MyChunk\"]")); - } - } - } - - [Test] - public void TestGenerics () - { - //Im not sure support for generic classes is possible to implement, see: http://msdn.microsoft.com/en-us/library/system.reflection.methodinfo.containsgenericparameters.aspx - //specifically the line that says: "If the ContainsGenericParameters property returns true, the method cannot be invoked" - //TestClassGeneric genericClass = new TestClassGeneric(); - //lua.RegisterFunction("genericMethod", genericClass, typeof(TestClassGeneric<>).GetMethod("GenericMethod")); - //lua.RegisterFunction("regularMethod", genericClass, typeof(TestClassGeneric<>).GetMethod("RegularMethod")); - using (Lua lua = new Lua ()) { - TestClassWithGenericMethod classWithGenericMethod = new TestClassWithGenericMethod (); - - //////////////////////////////////////////////////////////////////////////// - /// //////////////////////////////////////////////////////////////////////// - /// IMPORTANT: Use generic method with the type you will call or generic methods will fail with iOS - /// //////////////////////////////////////////////////////////////////////// - classWithGenericMethod.GenericMethod(99.0); - classWithGenericMethod.GenericMethod(new TestClass (99)); - //////////////////////////////////////////////////////////////////////////// - /// //////////////////////////////////////////////////////////////////////// - - lua.RegisterFunction ("genericMethod2", classWithGenericMethod, typeof(TestClassWithGenericMethod).GetMethod ("GenericMethod")); - - try { - lua.DoString ("genericMethod2(100)"); - } catch { - } - - Assert.AreEqual (true, classWithGenericMethod.GenericMethodSuccess); - Assert.AreEqual (true, classWithGenericMethod.Validate (100)); //note the gotcha: numbers are all being passed to generic methods as doubles - - try { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass(56)"); - lua.DoString ("genericMethod2(test)"); - } catch { - } - - Assert.AreEqual (true, classWithGenericMethod.GenericMethodSuccess); - Assert.AreEqual (56, (classWithGenericMethod.PassedValue as TestClass).val); - } - } - - [Test] - public void RegisterFunctionStressTest () - { - const int Count = 200; // it seems to work with 41 - using (Lua lua = new Lua ()) { - MyClass t = new MyClass (); - - for (int i = 1; i < Count - 1; ++i) { - lua.RegisterFunction ("func" + i, t, typeof(MyClass).GetMethod ("Func1")); - } - - lua.RegisterFunction ("func" + (Count - 1), t, typeof(MyClass).GetMethod ("Func1")); - lua.DoString ("print(func1())"); - } - } - - [Test] - public void TestMultipleOutParameters () - { - using (Lua lua = new Lua ()) { - TestClass t1 = new TestClass (); - lua ["netobj"] = t1; - lua.DoString ("a,b,c=netobj:outValMutiple(2)"); - int a = (int)lua.GetNumber ("a"); - string b = (string)lua.GetString ("b"); - string c = (string)lua.GetString ("c"); - Assert.AreEqual (2, a); - Assert.AreNotEqual (null, b); - Assert.AreNotEqual (null, c); - } - } - - [Test] - public void TestLoadStringLeak () - { - //Test to prevent stack overflow - //See: http://code.google.com/p/nlua/issues/detail?id=5 - //number of iterations to test - int count = 1000; - using (Lua lua = new Lua ()) { - for (int i = 0; i < count; i++) { - lua.LoadString ("abc = 'def'", string.Empty); - } - } - //any thrown exceptions cause the test run to fail - } - - [Test] - public void TestLoadFileLeak () - { - //Test to prevent stack overflow - //See: http://code.google.com/p/nlua/issues/detail?id=5 - //number of iterations to test - int count = 1000; - using (Lua lua = new Lua ()) { - for (int i = 0; i < count; i++) { - lua.LoadFile (Environment.CurrentDirectory + System.IO.Path.DirectorySeparatorChar + "test.lua"); - } - } - //any thrown exceptions cause the test run to fail - } - - [Test] - public void TestRegisterFunction () - { - using (Lua lua = new Lua ()) { - lua.RegisterFunction ("func1", null, typeof(TestClass2).GetMethod ("func")); - object[] vals1 = lua.GetFunction ("func1").Call (2, 3); - Assert.AreEqual (5.0f, Convert.ToSingle (vals1 [0])); - TestClass2 obj = new TestClass2 (); - lua.RegisterFunction ("func2", obj, typeof(TestClass2).GetMethod ("funcInstance")); - vals1 = lua.GetFunction ("func2").Call (2, 3); - Assert.AreEqual (5.0f, Convert.ToSingle (vals1 [0])); - } - } - - /* - * Tests passing a null object as a parameter to a - * method that accepts a nullable. - */ - [Test] - public void TestNullableParameter () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a = test:NullableMethod(nil)"); - Assert.AreEqual (null, lua ["a"]); - lua ["timeVal"] = TimeSpan.FromSeconds (5); - lua.DoString ("b = test:NullableMethod(timeVal)"); - Assert.AreEqual (TimeSpan.FromSeconds (5), lua ["b"]); - lua.DoString ("d = test:NullableMethod2(2)"); - Assert.AreEqual (2, lua ["d"]); - lua.DoString ("c = test:NullableMethod2(nil)"); - Assert.AreEqual (null, lua ["c"]); - } - } - - /* - * Tests if DoString is correctly returning values - */ - [Test] - public void DoString () - { - using (Lua lua = new Lua ()) { - object[] res = lua.DoString ("a=2\nreturn a,3"); - //Console.WriteLine("a="+res[0]+", b="+res[1]); - Assert.AreEqual (res [0], 2d); - Assert.AreEqual (res [1], 3d); - } - } - /* - * Tests getting of global numeric variables - */ - [Test] - public void GetGlobalNumber () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a=2"); - double num = lua.GetNumber ("a"); - //Console.WriteLine("a="+num); - Assert.AreEqual (num, 2d); - } - } - /* - * Tests setting of global numeric variables - */ - [Test] - public void SetGlobalNumber () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a=2"); - lua ["a"] = 3; - double num = lua.GetNumber ("a"); - //Console.WriteLine("a="+num); - Assert.AreEqual (num, 3d); - } - } - /* - * Tests getting of numeric variables from tables - * by specifying variable path - */ - [Test] - public void GetNumberInTable () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=2}}"); - double num = lua.GetNumber ("a.b.c"); - //Console.WriteLine("a.b.c="+num); - Assert.AreEqual (num, 2d); - } - } - /* - * Tests setting of numeric variables from tables - * by specifying variable path - */ - [Test] - public void SetNumberInTable () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=2}}"); - lua ["a.b.c"] = 3; - double num = lua.GetNumber ("a.b.c"); - //Console.WriteLine("a.b.c="+num); - Assert.AreEqual (num, 3d); - } - } - /* - * Tests getting of global string variables - */ - [Test] - public void GetGlobalString () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a=\"test\""); - string str = lua.GetString ("a"); - //Console.WriteLine("a="+str); - Assert.AreEqual (str, "test"); - } - } - /* - * Tests setting of global string variables - */ - [Test] - public void SetGlobalString () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a=\"test\""); - lua ["a"] = "new test"; - string str = lua.GetString ("a"); - //Console.WriteLine("a="+str); - Assert.AreEqual (str, "new test"); - } - } - /* - * Tests getting of string variables from tables - * by specifying variable path - */ - [Test] - public void GetStringInTable () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=\"test\"}}"); - string str = lua.GetString ("a.b.c"); - //Console.WriteLine("a.b.c="+str); - Assert.AreEqual (str, "test"); - } - } - /* - * Tests setting of string variables from tables - * by specifying variable path - */ - [Test] - public void SetStringInTable () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=\"test\"}}"); - lua ["a.b.c"] = "new test"; - string str = lua.GetString ("a.b.c"); - //Console.WriteLine("a.b.c="+str); - Assert.AreEqual (str, "new test"); - } - } - /* - * Tests getting and setting of global table variables - */ - [Test] - public void GetAndSetTable () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=2}}\nb={c=3}"); - LuaTable tab = lua.GetTable ("b"); - lua ["a.b"] = tab; - double num = lua.GetNumber ("a.b.c"); - //Console.WriteLine("a.b.c="+num); - Assert.AreEqual (num, 3d); - } - } - /* - * Tests getting of numeric field of a table - */ - [Test] - public void GetTableNumericField1 () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=2}}"); - LuaTable tab = lua.GetTable ("a.b"); - double num = (double)tab ["c"]; - //Console.WriteLine("a.b.c="+num); - Assert.AreEqual (num, 2d); - } - } - /* - * Tests getting of numeric field of a table - * (the field is inside a subtable) - */ - [Test] - public void GetTableNumericField2 () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=2}}"); - LuaTable tab = lua.GetTable ("a"); - double num = (double)tab ["b.c"]; - //Console.WriteLine("a.b.c="+num); - Assert.AreEqual (num, 2d); - } - } - /* - * Tests setting of numeric field of a table - */ - [Test] - public void SetTableNumericField1 () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=2}}"); - LuaTable tab = lua.GetTable ("a.b"); - tab ["c"] = 3; - double num = lua.GetNumber ("a.b.c"); - //Console.WriteLine("a.b.c="+num); - Assert.AreEqual (num, 3d); - } - } - /* - * Tests setting of numeric field of a table - * (the field is inside a subtable) - */ - [Test] - public void SetTableNumericField2 () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=2}}"); - LuaTable tab = lua.GetTable ("a"); - tab ["b.c"] = 3; - double num = lua.GetNumber ("a.b.c"); - //Console.WriteLine("a.b.c="+num); - Assert.AreEqual (num, 3d); - } - } - /* - * Tests getting of string field of a table - */ - [Test] - public void GetTableStringField1 () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=\"test\"}}"); - LuaTable tab = lua.GetTable ("a.b"); - string str = (string)tab ["c"]; - //Console.WriteLine("a.b.c="+str); - Assert.AreEqual (str, "test"); - } - } - /* - * Tests getting of string field of a table - * (the field is inside a subtable) - */ - [Test] - public void GetTableStringField2 () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=\"test\"}}"); - LuaTable tab = lua.GetTable ("a"); - string str = (string)tab ["b.c"]; - //Console.WriteLine("a.b.c="+str); - Assert.AreEqual (str, "test"); - } - } - /* - * Tests setting of string field of a table - */ - [Test] - public void SetTableStringField1 () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=\"test\"}}"); - LuaTable tab = lua.GetTable ("a.b"); - tab ["c"] = "new test"; - string str = lua.GetString ("a.b.c"); - //Console.WriteLine("a.b.c="+str); - Assert.AreEqual (str, "new test"); - } - } - /* - * Tests setting of string field of a table - * (the field is inside a subtable) - */ - [Test] - public void SetTableStringField2 () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=\"test\"}}"); - LuaTable tab = lua.GetTable ("a"); - tab ["b.c"] = "new test"; - string str = lua.GetString ("a.b.c"); - //Console.WriteLine("a.b.c="+str); - Assert.AreEqual (str, "new test"); - } - } - /* - * Tests calling of a global function with zero arguments - */ - [Test] - public void CallGlobalFunctionNoArgs () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a=2\nfunction f()\na=3\nend"); - lua.GetFunction ("f").Call (); - double num = lua.GetNumber ("a"); - //Console.WriteLine("a="+num); - Assert.AreEqual (num, 3d); - } - } - /* - * Tests calling of a global function with one argument - */ - [Test] - public void CallGlobalFunctionOneArg () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a=2\nfunction f(x)\na=a+x\nend"); - lua.GetFunction ("f").Call (1); - double num = lua.GetNumber ("a"); - //Console.WriteLine("a="+num); - Assert.AreEqual (num, 3d); - } - } - /* - * Tests calling of a global function with two arguments - */ - [Test] - public void CallGlobalFunctionTwoArgs () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a=2\nfunction f(x,y)\na=x+y\nend"); - lua.GetFunction ("f").Call (1, 3); - double num = lua.GetNumber ("a"); - //Console.WriteLine("a="+num); - Assert.AreEqual (num, 4d); - } - } - /* - * Tests calling of a global function that returns one value - */ - [Test] - public void CallGlobalFunctionOneReturn () - { - using (Lua lua = new Lua ()) { - lua.DoString ("function f(x)\nreturn x+2\nend"); - object[] ret = lua.GetFunction ("f").Call (3); - //Console.WriteLine("ret="+ret[0]); - Assert.AreEqual (1, ret.Length); - Assert.AreEqual (5, (double)ret [0]); - } - } - /* - * Tests calling of a global function that returns two values - */ - [Test] - public void CallGlobalFunctionTwoReturns () - { - using (Lua lua = new Lua ()) { - lua.DoString ("function f(x,y)\nreturn x,x+y\nend"); - object[] ret = lua.GetFunction ("f").Call (3, 2); - //Console.WriteLine("ret="+ret[0]+","+ret[1]); - Assert.AreEqual (2, ret.Length); - Assert.AreEqual (3, (double)ret [0]); - Assert.AreEqual (5, (double)ret [1]); - } - } - /* - * Tests calling of a function inside a table - */ - [Test] - public void CallTableFunctionTwoReturns () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={}\nfunction a.f(x,y)\nreturn x,x+y\nend"); - object[] ret = lua.GetFunction ("a.f").Call (3, 2); - //Console.WriteLine("ret="+ret[0]+","+ret[1]); - Assert.AreEqual (2, ret.Length); - Assert.AreEqual (3, (double)ret [0]); - Assert.AreEqual (5, (double)ret [1]); - } - } - /* - * Tests setting of a global variable to a CLR object value - */ - [Test] - public void SetGlobalObject () - { - using (Lua lua = new Lua ()) { - TestClass t1 = new TestClass (); - t1.testval = 4; - lua ["netobj"] = t1; - object o = lua ["netobj"]; - Assert.AreEqual (true, o is TestClass); - TestClass t2 = (TestClass)lua ["netobj"]; - Assert.AreEqual (t2.testval, 4); - Assert.AreEqual (t1 , t2); - } - } - ///* - // * Tests if CLR object is being correctly collected by Lua - // */ - //[Test] - //public void GarbageCollection() - //{ - // using (Lua lua = new Lua()) - // { - // TestClass t1 = new TestClass(); - // t1.testval = 4; - // lua["netobj"] = t1; - // TestClass t2 = (TestClass)lua["netobj"]; - // Assert.True(lua[0] != null); - // lua.DoString("netobj=nil;collectgarbage();"); - // Assert.True(lua.translator.objects[0] == null); - // } - //} - /* - * Tests setting of a table field to a CLR object value - */ - [Test] - public void SetTableObjectField1 () - { - using (Lua lua = new Lua ()) { - lua.DoString ("a={b={c=\"test\"}}"); - LuaTable tab = lua.GetTable ("a.b"); - TestClass t1 = new TestClass (); - t1.testval = 4; - tab ["c"] = t1; - TestClass t2 = (TestClass)lua ["a.b.c"]; - //Console.WriteLine("a.b.c="+t2.testval); - Assert.AreEqual (4, t2.testval); - Assert.AreEqual (t1 , t2); - } - } - /* - * Tests reading and writing of an object's field - */ - [Test] - public void AccessObjectField () - { - using (Lua lua = new Lua ()) { - TestClass t1 = new TestClass (); - t1.val = 4; - lua ["netobj"] = t1; - lua.DoString ("var=netobj.val"); - double var = (double)lua ["var"]; - //Console.WriteLine("value from Lua="+var); - Assert.AreEqual (4, var); - lua.DoString ("netobj.val=3"); - Assert.AreEqual (3, t1.val); - //Console.WriteLine("new val (from Lua)="+t1.val); - } - } - /* - * Tests reading and writing of an object's non-indexed - * property - */ - [Test] - public void AccessObjectProperty () - { - using (Lua lua = new Lua ()) { - TestClass t1 = new TestClass (); - t1.testval = 4; - lua ["netobj"] = t1; - lua.DoString ("var=netobj.testval"); - double var = (double)lua ["var"]; - //Console.WriteLine("value from Lua="+var); - Assert.AreEqual (4, var); - lua.DoString ("netobj.testval=3"); - Assert.AreEqual (3, t1.testval); - //Console.WriteLine("new val (from Lua)="+t1.testval); - } - } - - [Test] - public void AccessObjectStringProperty () - { - using (Lua lua = new Lua ()) { - TestClass t1 = new TestClass (); - t1.teststrval = "This is a string test"; - lua ["netobj"] = t1; - lua.DoString ("var=netobj.teststrval"); - string var = (string)lua ["var"]; - - Assert.AreEqual ("This is a string test", var); - lua.DoString ("netobj.teststrval='Another String'"); - Assert.AreEqual ("Another String", t1.teststrval); - //Console.WriteLine("new val (from Lua)="+t1.testval); - } - } - /* - * Tests calling of an object's method with no overloads - */ - [Test] - public void CallObjectMethod () - { - using (Lua lua = new Lua ()) { - TestClass t1 = new TestClass (); - t1.testval = 4; - lua ["netobj"] = t1; - lua.DoString ("netobj:setVal(3)"); - Assert.AreEqual (3, t1.testval); - //Console.WriteLine("new val(from C#)="+t1.testval); - lua.DoString ("val=netobj:getVal()"); - int val = (int)lua.GetNumber ("val"); - Assert.AreEqual (3, val); - //Console.WriteLine("new val(from Lua)="+val); - } - } - /* - * Tests calling of an object's method with overloading - */ - [Test] - public void CallObjectMethodByType () - { - using (Lua lua = new Lua ()) { - TestClass t1 = new TestClass (); - lua ["netobj"] = t1; - lua.DoString ("netobj:setVal('str')"); - Assert.AreEqual ("str", t1.getStrVal ()); - //Console.WriteLine("new val(from C#)="+t1.getStrVal()); - } - } - /* - * Tests calling of an object's method with no overloading - * and out parameters - */ - [Test] - public void CallObjectMethodOutParam () - { - using (Lua lua = new Lua ()) { - TestClass t1 = new TestClass (); - lua ["netobj"] = t1; - lua.DoString ("a,b=netobj:outVal()"); - int a = (int)lua.GetNumber ("a"); - int b = (int)lua.GetNumber ("b"); - Assert.AreEqual (3, a); - Assert.AreEqual (5, b); - //Console.WriteLine("function returned (from lua)="+a+","+b); - } - } - /* - * Tests calling of an object's method with overloading and - * out params - */ - [Test] - public void CallObjectMethodOverloadedOutParam () - { - using (Lua lua = new Lua ()) { - TestClass t1 = new TestClass (); - lua ["netobj"] = t1; - lua.DoString ("a,b=netobj:outVal(2)"); - int a = (int)lua.GetNumber ("a"); - int b = (int)lua.GetNumber ("b"); - Assert.AreEqual (2, a); - Assert.AreEqual (5, b); - //Console.WriteLine("function returned (from lua)="+a+","+b); - } - } - /* - * Tests calling of an object's method with ref params - */ - [Test] - public void CallObjectMethodByRefParam () - { - using (Lua lua = new Lua ()) { - TestClass t1 = new TestClass (); - lua ["netobj"] = t1; - lua.DoString ("a,b=netobj:outVal(2,3)"); - int a = (int)lua.GetNumber ("a"); - int b = (int)lua.GetNumber ("b"); - Assert.AreEqual (2, a); - Assert.AreEqual (5, b); - //Console.WriteLine("function returned (from lua)="+a+","+b); - } - } - /* - * Tests calling of two versions of an object's method that have - * the same name and signature but implement different interfaces - */ - [Test] - public void CallObjectMethodDistinctInterfaces () - { - using (Lua lua = new Lua ()) { - TestClass t1 = new TestClass (); - lua ["netobj"] = t1; - lua.DoString ("a=netobj:foo()"); - lua.DoString ("b=netobj['NLuaTest.Mock.IFoo1.foo']"); - int a = (int)lua.GetNumber ("a"); - int b = (int)lua.GetNumber ("b"); - Assert.AreEqual (5, a); - Assert.AreEqual (1, b); - //Console.WriteLine("function returned (from lua)="+a+","+b); - } - } - /* - * Tests instantiating an object with no-argument constructor - */ - [Test] - public void CreateNetObjectNoArgsCons () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly(\"NLuaTest\")"); - lua.DoString ("TestClass=luanet.import_type(\"NLuaTest.Mock.TestClass\")"); - lua.DoString ("test=TestClass()"); - lua.DoString ("test:setVal(3)"); - object[] res = lua.DoString ("return test"); - TestClass test = (TestClass)res [0]; - //Console.WriteLine("returned: "+test.testval); - Assert.AreEqual (3, test.testval); - } - } - /* - * Tests instantiating an object with one-argument constructor - */ - [Test] - public void CreateNetObjectOneArgCons () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly(\"NLuaTest\")"); - lua.DoString ("TestClass=luanet.import_type(\"NLuaTest.Mock.TestClass\")"); - lua.DoString ("test=TestClass(3)"); - object[] res = lua.DoString ("return test"); - TestClass test = (TestClass)res [0]; - //Console.WriteLine("returned: "+test.testval); - Assert.AreEqual (3, test.testval); - } - } - /* - * Tests instantiating an object with overloaded constructor - */ - [Test] - public void CreateNetObjectOverloadedCons () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly(\"NLuaTest\")"); - lua.DoString ("TestClass=luanet.import_type(\"NLuaTest.Mock.TestClass\")"); - lua.DoString ("test=TestClass('str')"); - object[] res = lua.DoString ("return test"); - TestClass test = (TestClass)res [0]; - //Console.WriteLine("returned: "+test.getStrVal()); - Assert.AreEqual ("str", test.getStrVal ()); - } - } - /* - * Tests getting item of a CLR array - */ - [Test] - public void ReadArrayField () - { - using (Lua lua = new Lua ()) { - string[] arr = new string [] { "str1", "str2", "str3" }; - lua ["netobj"] = arr; - lua.DoString ("val=netobj[1]"); - string val = lua.GetString ("val"); - Assert.AreEqual ("str2", val); - //Console.WriteLine("new val(from array to Lua)="+val); - } - } - /*G - * Tests setting item of a CLR array - */ - [Test] - public void WriteArrayField () - { - using (Lua lua = new Lua ()) { - string[] arr = new string [] { "str1", "str2", "str3" }; - lua ["netobj"] = arr; - lua.DoString ("netobj[1]='test'"); - Assert.AreEqual ("test", arr [1]); - //Console.WriteLine("new val(from Lua to array)="+arr[1]); - } - } - /* - * Tests creating a new CLR array - */ - [Test] - public void CreateArray () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly(\"NLuaTest\")"); - lua.DoString ("TestClass=luanet.import_type(\"NLuaTest.Mock.TestClass\")"); - lua.DoString ("arr=TestClass[3]"); - lua.DoString ("for i=0,2 do arr[i]=TestClass(i+1) end"); - TestClass[] arr = (TestClass[])lua ["arr"]; - Assert.AreEqual (arr [1].testval, 2); - } - } - /* - * Tests passing a Lua function to a delegate - * with value-type arguments - */ - [Test] - public void LuaDelegateValueTypes () - { - using (Lua lua = new Lua ()) { - lua.RegisterLuaDelegateType (typeof(TestDelegate1), typeof(LuaTestDelegate1Handler)); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x,y) return x+y; end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callDelegate1(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("delegate returned: "+a); - } - } - /* - * Tests passing a Lua function to a delegate - * with value-type arguments and out params - */ - [Test] - public void LuaDelegateValueTypesOutParam () - { - using (Lua lua = new Lua ()) { - lua.RegisterLuaDelegateType (typeof(TestDelegate2), typeof(LuaTestDelegate2Handler)); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x) return x,x*2; end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callDelegate2(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (6, a); - //Console.WriteLine("delegate returned: "+a); - } - } - /* - * Tests passing a Lua function to a delegate - * with value-type arguments and ref params - */ - [Test] - public void LuaDelegateValueTypesByRefParam () - { - using (Lua lua = new Lua ()) { - lua.RegisterLuaDelegateType (typeof(TestDelegate3), typeof(LuaTestDelegate3Handler)); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x,y) return x+y; end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callDelegate3(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("delegate returned: "+a); - } - } - /* - * Tests passing a Lua function to a delegate - * with value-type arguments that returns a reference type - */ - [Test] - public void LuaDelegateValueTypesReturnReferenceType () - { - using (Lua lua = new Lua ()) { - lua.RegisterLuaDelegateType (typeof(TestDelegate4), typeof(LuaTestDelegate4Handler)); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x,y) return TestClass(x+y); end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callDelegate4(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("delegate returned: "+a); - } - } - /* - * Tests passing a Lua function to a delegate - * with reference type arguments - */ - [Test] - public void LuaDelegateReferenceTypes () - { - using (Lua lua = new Lua ()) { - lua.RegisterLuaDelegateType (typeof(TestDelegate5), typeof(LuaTestDelegate5Handler)); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x,y) return x.testval+y.testval; end"); - lua.DoString ("a=test:callDelegate5(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("delegate returned: "+a); - } - } - /* - * Tests passing a Lua function to a delegate - * with reference type arguments and an out param - */ - [Test] - public void LuaDelegateReferenceTypesOutParam () - { - using (Lua lua = new Lua ()) { - lua.RegisterLuaDelegateType (typeof(TestDelegate6), typeof(LuaTestDelegate6Handler)); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x) return x,TestClass(x*2); end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callDelegate6(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (6, a); - //Console.WriteLine("delegate returned: "+a); - } - } - /* - * Tests passing a Lua function to a delegate - * with reference type arguments and a ref param - */ - [Test] - public void LuaDelegateReferenceTypesByRefParam () - { - using (Lua lua = new Lua ()) { - lua.RegisterLuaDelegateType (typeof(TestDelegate7), typeof(LuaTestDelegate7Handler)); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("function func(x,y) return TestClass(x+y.testval); end"); - lua.DoString ("a=test:callDelegate7(func)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("delegate returned: "+a); - } - } - - - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with value-type params - */ - [Test] - public void NLuaAAValueTypes () - { - using (Lua lua = new Lua ()) { - lua.RegisterLuaClassType (typeof(ITest), typeof(LuaITestClassHandler)); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("itest={}"); - lua.DoString ("function itest:test1(x,y) return x+y; end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callInterface1(itest)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("interface returned: "+a); - } - } - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with value-type params - * and an out param - */ - [Test] - public void NLuaValueTypesOutParam () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("itest={}"); - lua.DoString ("function itest:test2(x) return x,x*2; end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callInterface2(itest)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (6, a); - //Console.WriteLine("interface returned: "+a); - } - } - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with value-type params - * and a ref param - */ - [Test] - public void NLuaValueTypesByRefParam () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("itest={}"); - lua.DoString ("function itest:test3(x,y) return x+y; end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callInterface3(itest)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("interface returned: "+a); - } - } - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with value-type params - * returning a reference type param - */ - [Test] - public void NLuaValueTypesReturnReferenceType () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("itest={}"); - lua.DoString ("function itest:test4(x,y) return TestClass(x+y); end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callInterface4(itest)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("interface returned: "+a); - } - } - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with reference type params - */ - [Test] - public void NLuaReferenceTypes () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("itest={}"); - lua.DoString ("function itest:test5(x,y) return x.testval+y.testval; end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callInterface5(itest)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("interface returned: "+a); - } - } - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with reference type params - * and an out param - */ - [Test] - public void NLuaReferenceTypesOutParam () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("itest={}"); - lua.DoString ("function itest:test6(x) return x,TestClass(x*2); end"); - lua.DoString ("test=TestClass()"); - lua.DoString ("a=test:callInterface6(itest)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (6, a); - //Console.WriteLine("interface returned: "+a); - } - } - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with reference type params - * and a ref param - */ - [Test] - public void NLuaReferenceTypesByRefParam () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("itest={}"); - lua.DoString ("function itest:test7(x,y) return TestClass(x+y.testval); end"); - lua.DoString ("a=test:callInterface7(itest)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (5, a); - //Console.WriteLine("interface returned: "+a); - } - } - - -#region LUA_BOILERPLATE_CLASS - /*** This class is used to bind the .NET world with the Lua world, this boilerplate code is pratically the same, get values call Lua function return value back, - * this class is usually dynamic generated using System.Reflection.Emit, but this will not work on iOS. */ - - class LuaTestClassHandler: TestClass, ILuaGeneratedType - { - public LuaTable __luaInterface_luaTable; - public Type[][] __luaInterface_returnTypes; - - public LuaTestClassHandler (LuaTable luaTable, Type[][] returnTypes) - { - __luaInterface_luaTable = luaTable; - __luaInterface_returnTypes = returnTypes; - } - - public LuaTable LuaInterfaceGetLuaTable () - { - return __luaInterface_luaTable; - } - - public override int overridableMethod (int x, int y) - { - object [] args = new object [] { - __luaInterface_luaTable, - x, - y - }; - object [] inArgs = new object [] { - __luaInterface_luaTable, - x, - y - }; - int [] outArgs = new int [] { }; - Type [] returnTypes = __luaInterface_returnTypes [0]; - LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction (__luaInterface_luaTable, "overridableMethod"); - object ret = NLua.Method.LuaClassHelper.CallFunction (function, args, returnTypes, inArgs, outArgs); - return (int)ret; - } - } - - class LuaITestClassHandler : ILuaGeneratedType, ITest - { - public LuaTable __luaInterface_luaTable; - public Type[][] __luaInterface_returnTypes; - - public LuaITestClassHandler (LuaTable luaTable, Type[][] returnTypes) - { - __luaInterface_luaTable = luaTable; - __luaInterface_returnTypes = returnTypes; - } - - public LuaTable LuaInterfaceGetLuaTable () - { - return __luaInterface_luaTable; - } - - public int intProp { - get { - object [] args = new object [] { __luaInterface_luaTable }; - object [] inArgs = new object [] { __luaInterface_luaTable }; - int [] outArgs = new int [] { }; - Type [] returnTypes = __luaInterface_returnTypes [0]; - LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction (__luaInterface_luaTable, "get_intProp"); - object ret = NLua.Method.LuaClassHelper.CallFunction (function, args, returnTypes, inArgs, outArgs); - return (int)ret; - } - set { - int i = value; - object [] args = new object [] { - __luaInterface_luaTable , - i - }; - object [] inArgs = new object [] { - __luaInterface_luaTable, - i - }; - int [] outArgs = new int [] { }; - Type [] returnTypes = __luaInterface_returnTypes [1]; - LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction (__luaInterface_luaTable, "set_intProp"); - NLua.Method.LuaClassHelper.CallFunction (function, args, returnTypes, inArgs, outArgs); - } - } - - public TestClass refProp { - get { - object [] args = new object [] { __luaInterface_luaTable }; - object [] inArgs = new object [] { __luaInterface_luaTable }; - int [] outArgs = new int [] { }; - Type [] returnTypes = __luaInterface_returnTypes [2]; - LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction (__luaInterface_luaTable, "get_refProp"); - object ret = NLua.Method.LuaClassHelper.CallFunction (function, args, returnTypes, inArgs, outArgs); - return (TestClass)ret; - } - set { - TestClass test = value; - object [] args = new object [] { - __luaInterface_luaTable , - test - }; - object [] inArgs = new object [] { - __luaInterface_luaTable, - test - }; - int [] outArgs = new int [] { }; - Type [] returnTypes = __luaInterface_returnTypes [3]; - LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction (__luaInterface_luaTable, "set_refProp"); - NLua.Method.LuaClassHelper.CallFunction (function, args, returnTypes, inArgs, outArgs); - } - } - - public int test1 (int a, int b) - { - object [] args = new object [] { - __luaInterface_luaTable, - a, - b - }; - object [] inArgs = new object [] { - __luaInterface_luaTable, - a, - b - }; - int [] outArgs = new int [] { }; - Type [] returnTypes = __luaInterface_returnTypes [4]; - LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction (__luaInterface_luaTable, "test1"); - object ret = NLua.Method.LuaClassHelper.CallFunction (function, args, returnTypes, inArgs, outArgs); - return (int)ret; - } - - public int test2 (int a, out int b) - { - object [] args = new object [] { - __luaInterface_luaTable, - a, - 0 - }; - object [] inArgs = new object [] { - __luaInterface_luaTable, - a - }; - int [] outArgs = new int [] { 1 }; - Type [] returnTypes = __luaInterface_returnTypes [5]; - LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction (__luaInterface_luaTable, "test2"); - object ret = NLua.Method.LuaClassHelper.CallFunction (function, args, returnTypes, inArgs, outArgs); - b = (int)args [1]; - return (int)ret; - } - - public void test3 (int a, ref int b) - { - object [] args = new object [] { - __luaInterface_luaTable, - a, - b - }; - object [] inArgs = new object [] { - __luaInterface_luaTable, - a, - b - }; - int [] outArgs = new int [] { 1 }; - Type [] returnTypes = __luaInterface_returnTypes [6]; - LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction (__luaInterface_luaTable, "test3"); - NLua.Method.LuaClassHelper.CallFunction (function, args, returnTypes, inArgs, outArgs); - b = (int)args [1]; - } - - public TestClass test4 (int a, int b) - { - object [] args = new object [] { - __luaInterface_luaTable, - a, - b - }; - object [] inArgs = new object [] { - __luaInterface_luaTable, - a, - b - }; - int [] outArgs = new int [] { }; - Type [] returnTypes = __luaInterface_returnTypes [7]; - LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction (__luaInterface_luaTable, "test4"); - object ret = NLua.Method.LuaClassHelper.CallFunction (function, args, returnTypes, inArgs, outArgs); - return (TestClass)ret; - } - - public int test5 (TestClass a, TestClass b) - { - object [] args = new object [] { - __luaInterface_luaTable, - a, - b - }; - object [] inArgs = new object [] { - __luaInterface_luaTable, - a, - b - }; - int [] outArgs = new int [] { }; - Type [] returnTypes = __luaInterface_returnTypes [8]; - LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction (__luaInterface_luaTable, "test5"); - object ret = NLua.Method.LuaClassHelper.CallFunction (function, args, returnTypes, inArgs, outArgs); - return (int)ret; - } - - public int test6 (int a, out TestClass b) - { - object [] args = new object [] { - __luaInterface_luaTable, - a, - null - }; - object [] inArgs = new object [] { - __luaInterface_luaTable, - a, - }; - int [] outArgs = new int [] { 1}; - Type [] returnTypes = __luaInterface_returnTypes [9]; - LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction (__luaInterface_luaTable, "test6"); - object ret = NLua.Method.LuaClassHelper.CallFunction (function, args, returnTypes, inArgs, outArgs); - b = (TestClass)args [1]; - - return (int)ret; - } - - public void test7 (int a, ref TestClass b) - { - object [] args = new object [] { - __luaInterface_luaTable, - a, - b - }; - object [] inArgs = new object [] { - __luaInterface_luaTable, - a, - b - }; - int [] outArgs = new int [] { 1 }; - Type [] returnTypes = __luaInterface_returnTypes [10]; - LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction (__luaInterface_luaTable, "test7"); - NLua.Method.LuaClassHelper.CallFunction (function, args, returnTypes, inArgs, outArgs); - b = (TestClass)args [1]; - } - } -#endregion - - /* - * Tests passing a Lua table as an interface and - * accessing one of its value-type properties - */ - [Test] - public void NLuaValueProperty () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("itest={}"); - lua.DoString ("function itest:get_intProp() return itest.int_prop; end"); - lua.DoString ("function itest:set_intProp(val) itest.int_prop=val; end"); - lua.DoString ("a=test:callInterface8(itest)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (3, a); - //Console.WriteLine("interface returned: "+a); - } - } - /* - * Tests passing a Lua table as an interface and - * accessing one of its reference type properties - */ - [Test] - public void NLuaReferenceProperty () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("itest={}"); - lua.DoString ("function itest:get_refProp() return TestClass(itest.int_prop); end"); - lua.DoString ("function itest:set_refProp(val) itest.int_prop=val.testval; end"); - lua.DoString ("a=test:callInterface9(itest)"); - int a = (int)lua.GetNumber ("a"); - Assert.AreEqual (3, a); - //Console.WriteLine("interface returned: "+a); - } - } - - - /* - * Tests making an object from a Lua table and calling the base - * class version of one of the methods the table overrides. - */ - [Test] - public void LuaTableBaseMethod () - { - using (Lua lua = new Lua ()) { - lua.RegisterLuaClassType (typeof(TestClass), typeof(LuaTestClassHandler)); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test={}"); - lua.DoString ("function test:overridableMethod(x,y) print(self[base]); return 6 end"); - lua.DoString ("luanet.make_object(test,'NLuaTest.Mock.TestClass')"); - lua.DoString ("a=TestClass.callOverridable(test,2,3)"); - int a = (int)lua.GetNumber ("a"); - lua.DoString ("luanet.free_object(test)"); - Assert.AreEqual (6, a); - // lua.DoString("luanet.load_assembly('NLuaTest')"); - // lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - // lua.DoString("test={}"); - // - // lua.DoString("luanet.make_object(test,'NLuaTest.Mock.TestClass')"); - // lua.DoString ("function test.overridableMethod(test,x,y) return 2*test.base.overridableMethod(test,x,y); end"); - // lua.DoString("a=TestClass.callOverridable(test,2,3)"); - // int a = (int)lua.GetNumber("a"); - // lua.DoString("luanet.free_object(test)"); - // Assert.AreEqual(10, a); - //Console.WriteLine("interface returned: "+a); - } - } - /* - * Tests getting an object's method by its signature - * (from object) - */ - [Test] - public void GetMethodBySignatureFromObj () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('mscorlib')"); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("setMethod=luanet.get_method_bysig(test,'setVal','System.String')"); - lua.DoString ("setMethod('test')"); - TestClass test = (TestClass)lua ["test"]; - Assert.AreEqual ("test", test.getStrVal ()); - //Console.WriteLine("interface returned: "+test.getStrVal()); - } - } - /* - * Tests getting an object's method by its signature - * (from type) - */ - [Test] - public void GetMethodBySignatureFromType () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('mscorlib')"); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("setMethod=luanet.get_method_bysig(TestClass,'setVal','System.String')"); - lua.DoString ("setMethod(test,'test')"); - TestClass test = (TestClass)lua ["test"]; - Assert.AreEqual ("test", test.getStrVal ()); - //Console.WriteLine("interface returned: "+test.getStrVal()); - } - } - /* - * Tests getting a type's method by its signature - */ - [Test] - public void GetStaticMethodBySignature () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('mscorlib')"); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("make_method=luanet.get_method_bysig(TestClass,'makeFromString','System.String')"); - lua.DoString ("test=make_method('test')"); - TestClass test = (TestClass)lua ["test"]; - Assert.AreEqual ("test", test.getStrVal ()); - //Console.WriteLine("interface returned: "+test.getStrVal()); - } - } - /* - * Tests getting an object's constructor by its signature - */ - [Test] - public void GetConstructorBySignature () - { - using (Lua lua = new Lua ()) { - lua.DoString ("luanet.load_assembly('mscorlib')"); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test_cons=luanet.get_constructor_bysig(TestClass,'System.String')"); - lua.DoString ("test=test_cons('test')"); - TestClass test = (TestClass)lua ["test"]; - Assert.AreEqual ("test", test.getStrVal ()); - //Console.WriteLine("interface returned: "+test.getStrVal()); - } - } - - [Test] - public void TestVarargs() - { - using(Lua lua = new Lua()){ - lua.DoString ("luanet.load_assembly('mscorlib')"); - lua.DoString ("luanet.load_assembly('NLuaTest')"); - lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); - lua.DoString ("test=TestClass()"); - lua.DoString ("test:Print('this will pass')"); - lua.DoString ("test:Print('this will ','fail')"); - } - } - - [Test] - public void TestCtype () - { - using (Lua lua = new Lua ()) { - lua.LoadCLRPackage (); - lua.DoString ("import'System'"); - var x = lua.DoString ("return luanet.ctype(String)")[0]; - Assert.AreEqual (x, typeof(String), "#1 String ctype test"); - } - } - - [Test] - public void TestPrintChars () - { - using (Lua lua = new Lua ()) { - lua.DoString (@"print(""waüäq?=()[&]ß"")"); - Assert.IsTrue (true); - } - } - - [Test] - public void TestUnicodeChars () - { - using (Lua lua = new Lua ()) { - lua.LoadCLRPackage (); - lua.DoString ("import('NLuaTest')"); - lua.DoString ("res = LuaTests.UnicodeString"); - string res = (string)lua ["res"]; - - Assert.AreEqual (LuaTests.UnicodeString, res); - } - } - - [Test] - public void TestUnicodeCharsInDoString() - { - using (Lua lua = new Lua ()) { - lua.DoString("res = 'Файл'"); - string res = (string)lua["res"]; - - Assert.AreEqual(LuaTests.UnicodeStringRussian, res); - } - } - - [Test] - public void TestCoroutine () - { - using (Lua lua = new Lua ()) { - lua.LoadCLRPackage (); - lua.RegisterFunction ("func1", null, typeof (TestClass2).GetMethod ("func")); - lua.DoString ("function yielder() " + - "a=1;" + "coroutine.yield();" + - "func1(3,2);" + "coroutine.yield();" + // This line triggers System.NullReferenceException - "a=2;" + "coroutine.yield();" + - "end;" + - "co_routine = coroutine.create(yielder);" + - "while coroutine.resume(co_routine) do end;"); - - double num = lua.GetNumber ("a"); - //Console.WriteLine("a="+num); - Assert.AreEqual (num, 2d); - } - } - - [Test] - public void TestDebugHook () - { - int [] lines = { 1, 2, 1, 3 }; - int line = 0; - - using (Lua lua = new Lua ()) { - lua.DebugHook += (sender,args) => { - Assert.AreEqual (args.LuaDebug.currentline,lines [line]); - line ++; - }; - lua.SetDebugHook (NLua.Event.EventMasks.LUA_MASKLINE, 0); - - lua.DoString (@"function testing_hooks() return 10 end - val = testing_hooks() - val = val + 1"); - } - } - - [Test] - public void TestKeyWithDots () - { - using (Lua lua = new Lua ()) { - lua.DoString (@"g_dot = {} - g_dot['key.with.dot'] = 42"); - - Assert.AreEqual (42, (int)(double)lua ["g_dot.key\\.with\\.dot"]); - } - } -#if !WINDOWS_PHONE && !NET_3_5 - [Test] - public void TestOperatorAdd () - { - using (Lua lua = new Lua ()) { - var a = new System.Numerics.Complex (10, 0); - var b = new System.Numerics.Complex (0, 3); - var x = a + b; - - lua ["a"] = a; - lua ["b"] = b; - var res = lua.DoString (@"return a + b") [0]; - Assert.AreEqual (x, res); - } - } - - [Test] - public void TestOperatorMinus () - { - using (Lua lua = new Lua ()) { - var a = new System.Numerics.Complex (10, 0); - var b = new System.Numerics.Complex (0, 3); - var x = a - b; - - lua ["a"] = a; - lua ["b"] = b; - var res = lua.DoString (@"return a - b") [0]; - Assert.AreEqual (x, res); - } - } - - [Test] - public void TestOperatorMultiply () - { - using (Lua lua = new Lua ()) { - var a = new System.Numerics.Complex (10, 0); - var b = new System.Numerics.Complex (0, 3); - var x = a * b; - - lua ["a"] = a; - lua ["b"] = b; - var res = lua.DoString (@"return a * b") [0]; - Assert.AreEqual (x, res); - } - } - - [Test] - public void TestOperatorEqual () - { - using (Lua lua = new Lua ()) { - var a = new System.Numerics.Complex (10, 0); - var b = new System.Numerics.Complex (0, 3); - var x = a == b; - - lua ["a"] = a; - lua ["b"] = b; - var res = lua.DoString (@"return a == b") [0]; - Assert.AreEqual (x, res); - } - } - - [Test] - public void TestOperatorNotEqual () - { - using (Lua lua = new Lua ()) { - var a = new System.Numerics.Complex (10, 0); - var b = new System.Numerics.Complex (0, 3); - var x = a != b; - - lua ["a"] = a; - lua ["b"] = b; - var res = lua.DoString (@"return a ~= b") [0]; - Assert.AreEqual (x, res); - } - } - - [Test] - public void TestUnaryMinus () - { - using (Lua lua = new Lua ()) { - - lua.LoadCLRPackage (); - lua.DoString (@" import ('System.Numerics') - c = Complex (10, 5) - c = -c "); - - var expected = new System.Numerics.Complex (-10, -5); - - var res = lua ["c"]; - Assert.AreEqual (expected, res); - } - } -#endif - [Test] - public void TestCaseFields () - { - using (Lua lua = new Lua ()) { - lua.LoadCLRPackage (); - - lua.DoString (@" import ('NLuaTest') - x = TestCaseName() - name = x.name; - name2 = x.Name; - Name = x.Name; - Name2 = x.name"); - - Assert.AreEqual ("name", lua ["name"]); - Assert.AreEqual ("**name**", lua ["name2"]); - Assert.AreEqual ("**name**", lua ["Name"]); - Assert.AreEqual ("name", lua ["Name2"]); - } - } - - [Test] - public void TestStaticOperators () - { - using (Lua lua = new Lua ()) { - lua.LoadCLRPackage (); - - lua.DoString (@" import ('NLuaTest') - v = Vector() - v.x = 10 - v.y = 3 - v = v*2 "); - - var v = (Vector)lua ["v"]; - - Assert.AreEqual (20, v.x, "#1"); - Assert.AreEqual (6, v.y, "#2"); - - lua.DoString (@" x = 2 * v"); - var x = (Vector)lua ["x"]; - - Assert.AreEqual (40, x.x, "#3"); - Assert.AreEqual (12, x.y, "#4"); - } - } - - [Test] - public void TestExtensionMethods () - { - using (Lua lua = new Lua ()) { - lua.LoadCLRPackage (); - - lua.DoString (@" import ('NLuaTest') - v = Vector() - v.x = 10 - v.y = 3 - v = v*2 "); - - var v = (Vector)lua ["v"]; - - double len = v.Length (); - lua.DoString (" v:Length() "); - lua.DoString (@" len2 = v:Length()"); - double len2 = (double)lua ["len2"]; - Assert.AreEqual (len, len2, "#1"); - } - } - - [Test] - public void TestBaseClassExtensionMethods () - { - using (Lua lua = new Lua ()) { - lua.LoadCLRPackage (); - - lua.DoString (@" import ('NLuaTest') - p = Employee() - p.firstName = 'Paulo' - p.occupation = 'Programmer'"); - - var p = (Person)lua ["p"]; - - string name = p.GetFirstName(); - lua.DoString (" p:GetFirstName() "); - lua.DoString (@" name2 = p:GetFirstName()"); - string name2 = (string)lua ["name2"]; - Assert.AreEqual (name, name2, "#1"); - } - } - - [Test] - public void TestOverloadedMethods () - { - using (Lua lua = new Lua ()) { - var obj = new TestClassWithOverloadedMethod (); - lua ["obj"] = obj; - lua.DoString (@" - obj:Func (10) - obj:Func ('10') - obj:Func (10) - obj:Func ('10') - obj:Func (10) - "); - Assert.AreEqual (3, obj.CallsToIntFunc,"#integer"); - Assert.AreEqual (2, obj.CallsToStringFunc, "#string"); - } - } - - [Test] - public void TestGetStack () - { - using (Lua lua = new Lua ()) { - lua.LoadCLRPackage (); - m_lua = lua; - lua.DoString (@" - import ('NLuaTest') - function f1 () - f2 () - end - - function f2() - f3() - end - - function f3() - LuaTests.func() - end - - f1 () - "); - } - m_lua = null; - } - - public static void func() - { -#if USE_KOPILUA - string expected = "[0] [C]:-1 -- func [field]\n[1] [string \"chunk\"]:12 -- f3 [global]\n[2] [string \"chunk\"]:8 -- f2 [global]\n[3] [string \"chunk\"]:4 -- f1 [global]\n[4] [string \"chunk\"]:15 -- []\n"; - KopiLua.LuaDebug info = new KopiLua.LuaDebug (); -#else - //string expected = "[0] func:-1 -- [func]\n[1] f3:12 -- [f3]\n[2] f2:8 -- [f2]\n[3] f1:4 -- [f1]\n[4] :15 -- []\n"; - KeraLua.LuaDebug info = new KeraLua.LuaDebug (); -#endif - - int level = 0; - StringBuilder sb = new StringBuilder (); - while (m_lua.GetStack (level,ref info) != 0) { - m_lua.GetInfo ("nSl", ref info); - string name = ""; - if (info.name != null && !string.IsNullOrEmpty(info.name.ToString())) - name = info.name.ToString (); - - sb.AppendFormat ("[{0}] {1}:{2} -- {3} [{4}]\n", - level, info.shortsrc, info.currentline, - name, info.namewhat); - ++level; - } - string x = sb.ToString (); - Assert.True (!string.IsNullOrEmpty(x)); - } - - [Test] - public void TestCallImplicitBaseMethod () - { - using (var l = new Lua ()) { - l.LoadCLRPackage (); - l.DoString ("import ('NLuaTest')"); - l.DoString ("res = testClass.read() "); - string res = (string)l ["res"]; - Assert.AreEqual (testClass.read (), res); - } - } - - [Test] - public void TestPushLuaFunctionWhenReadingDelegateProperty () - { - bool called = false; - var _model = new DefaultElementModel (); - _model.DrawMe = (x) => { - called = true; - }; - using (var l = new Lua ()) { - l ["model"] = _model; - l.DoString (@" model.DrawMe (0) "); - } - - Assert.True (called); - } - - [Test] - public void TestCallDelegateWithParameters () - { - string sval = ""; - int nval = 0; - using (var l = new Lua ()) { - Action c = (s, n) => { sval = s; nval = n; }; - l ["d"] = c; - l.DoString (" d ('string', 10) "); - } - - Assert.AreEqual ("string", sval, "#1"); - Assert.AreEqual (10 , nval, "#2"); - } - - [Test] - public void TestCallSimpleDelegate () - { - bool called = false; - using (var l = new Lua ()) { - Action c = () => { called = true; }; - l ["d"] = c; - l.DoString (" d () "); - } - - Assert.True (called); - } - - [Test] - public void TestCallDelegateWithWrongParametersShouldFail () - { - bool fail = false; - using (var l = new Lua ()) { - Action c = () => { fail = false; }; - l ["d"] = c; - try { - l.DoString (" d (10) "); - } - catch (LuaScriptException ) { - fail = true; - } - } - - Assert.True (fail); - } - - [Test] - public void TestOverloadedMethodCallOnBase () - { - using (var l = new Lua ()) { - l.LoadCLRPackage (); - l.DoString (" import ('NLuaTest') "); - l.DoString (@" - p=parameter() - r1 = testClass.read(p) -- is not working. it is also not working if the method in base class has two parameters instead of one - r2 = testClass.read(1) -- is working - "); - string r1 = (string) l ["r1"]; - string r2 = (string) l ["r2"]; - Assert.AreEqual ("parameter-field1", r1, "#1"); - Assert.AreEqual ("int-test" , r2, "#2"); - } - } - - [Test] - public void TestCallMethodWithParams2 () - { - using (var l = new Lua ()) { - l.LoadCLRPackage (); - l.DoString (" import ('NLuaTest','NLuaTest.Mock') "); - l.DoString (@" - r = TestClass.MethodWithParams(2) - "); - int r = (int)l.GetNumber ("r"); - Assert.AreEqual (0, r, "#1"); - } - } - - [Test] - public void TestCallMethodWithParamsOptional() - { - using (var l = new Lua()) - { - l.LoadCLRPackage(); - l.DoString(" import ('NLuaTest','NLuaTest.Mock') "); - l.DoString(@" - r = TestClass.MethodWithParams(2, 7, 4) - "); - int r = (int)l.GetNumber("r"); - Assert.AreEqual(2, r, "#1"); - } - } - - [Test] - public void TestCallMethodWithObjectParams() - { - using (var l = new Lua()) - { - l.LoadCLRPackage(); - l.DoString(" import ('NLuaTest','NLuaTest.Mock') "); - l.DoString(@" - r = TestClass.MethodWithObjectParams(2, nil, 4, 'abc') - "); - int r = (int)l.GetNumber("r"); - Assert.AreEqual(4, r, "#1"); - } - } - - [Test] - public void TestCallMethodWithObjectParamsAndNilAsFirstArgument() - { - using (var l = new Lua()) - { - l.LoadCLRPackage(); - l.DoString(" import ('NLuaTest','NLuaTest.Mock') "); - l.DoString(@" - r = TestClass.MethodWithObjectParams(nil, 4, 'abc') - "); - int r = (int)l.GetNumber("r"); - Assert.AreEqual(3, r, "#1"); - } - } - - [Test] - public void TestConstructorOverload () - { - using (var l = new Lua ()) { - l.LoadCLRPackage (); - l.DoString (" import ('NLuaTest','NLuaTest.Mock') "); - l.DoString (@" - e1 = Entity() - e2 = Entity ('str_param') - e3 = Entity (10) - p1 = e1.Property - p2 = e2.Property - p3 = e3.Property - "); - string p1 = l.GetString ("p1"); - string p2 = l.GetString ("p2"); - string p3 = l.GetString ("p3"); - Assert.AreEqual ("Default", p1, "#1"); - Assert.AreEqual ("String", p2, "#1"); - Assert.AreEqual ("Int", p3, "#1"); - } - } - - static Lua m_lua; - - } -} diff --git a/tests/TestLua.cs b/tests/TestLua.cs deleted file mode 100755 index bafa24b11a4a489fc5449d9be57b59335737286c..0000000000000000000000000000000000000000 --- a/tests/TestLua.cs +++ /dev/null @@ -1,645 +0,0 @@ -//note: this should be cleaned up and replaced with moq mocks where possible - -namespace NLuaTest.Mock -{ - using System; - using NLua; - using System.Threading; - using System.Diagnostics; - using System.Reflection; - - /* - * Delegates used for testing Lua function -> delegate translation - */ - public delegate int TestDelegate1 (int a, int b); - - public delegate int TestDelegate2 (int a, out int b); - - public delegate void TestDelegate3 (int a, ref int b); - - public delegate TestClass TestDelegate4 (int a, int b); - - public delegate int TestDelegate5 (TestClass a, TestClass b); - - public delegate int TestDelegate6 (int a, out TestClass b); - - public delegate void TestDelegate7 (int a, ref TestClass b); - - /* Delegate Lua-handlers */ - - class LuaTestDelegate1Handler : NLua.Method.LuaDelegate - { - int CallFunction (int a, int b) - { - object [] args = new object [] { a, b }; - object [] inArgs = new object [] { a, b }; - int [] outArgs = new int [] { }; - - object ret = base.CallFunction (args, inArgs, outArgs); - - return (int)ret; - } - } - - class LuaTestDelegate2Handler : NLua.Method.LuaDelegate - { - int CallFunction (int a, out int b) - { - object [] args = new object [] { a, 0 }; - object [] inArgs = new object [] { a }; - int [] outArgs = new int [] { 1 }; - - object ret = base.CallFunction (args, inArgs, outArgs); - - b = (int)args [1]; - return (int)ret; - } - } - - class LuaTestDelegate3Handler : NLua.Method.LuaDelegate - { - void CallFunction (int a, ref int b) - { - object [] args = new object [] { a, b }; - object [] inArgs = new object [] { a, b }; - int [] outArgs = new int [] { 1 }; - - base.CallFunction (args, inArgs, outArgs); - - b = (int)args [1]; - } - } - - class LuaTestDelegate4Handler : NLua.Method.LuaDelegate - { - TestClass CallFunction (int a, int b) - { - object [] args = new object [] { a, b }; - object [] inArgs = new object [] { a, b }; - int [] outArgs = new int [] { }; - - object ret = base.CallFunction (args, inArgs, outArgs); - - return (TestClass)ret; - } - } - - class LuaTestDelegate5Handler : NLua.Method.LuaDelegate - { - int CallFunction (TestClass a, TestClass b) - { - object [] args = new object [] { a, b }; - object [] inArgs = new object [] { a, b }; - int [] outArgs = new int [] { }; - - object ret = base.CallFunction (args, inArgs, outArgs); - - return (int)ret; - } - } - - class LuaTestDelegate6Handler : NLua.Method.LuaDelegate - { - int CallFunction (int a, ref TestClass b) - { - object [] args = new object [] { a, b }; - object [] inArgs = new object [] { a }; - int [] outArgs = new int [] { 1 }; - - object ret = base.CallFunction (args, inArgs, outArgs); - - b = (TestClass)args [1]; - return (int)ret; - } - } - - class LuaTestDelegate7Handler : NLua.Method.LuaDelegate - { - void CallFunction (int a, ref TestClass b) - { - object [] args = new object [] { a, b }; - object [] inArgs = new object [] { a , b}; - int [] outArgs = new int [] { 1 }; - - base.CallFunction (args, inArgs, outArgs); - - b = (TestClass)args [1]; - } - } - - - /* - * Interface used for testing Lua table -> interface translation - */ - public interface ITest - { - int intProp { - get; - set; - } - - TestClass refProp { - get; - set; - } - - int test1 (int a, int b); - - int test2 (int a, out int b); - - void test3 (int a, ref int b); - - TestClass test4 (int a, int b); - - int test5 (TestClass a, TestClass b); - - int test6 (int a, out TestClass b); - - void test7 (int a, ref TestClass b); - } - - public interface IFoo1 - { - int foo (); - } - - public interface IFoo2 - { - int foo (); - } - - class MyClass - { - public int Func1 () - { - return 1; - } - } - - /// - /// Use to test threading - /// - class DoWorkClass - { - - public void DoWork () - { - - //simulate work by sleeping - //Console.WriteLine("Started to do work on thread: " + Thread.CurrentThread.ManagedThreadId); - Thread.Sleep (new Random ().Next (0, 1000)); - //Console.WriteLine("Finished work on thread: " + Thread.CurrentThread.ManagedThreadId); - } - } - - /// - /// test structure passing - /// - public struct TestStruct - { - public TestStruct(float val) - { - v = val; - } - - public float v; - - public float val - { - get { return v; } - set { v = value; } - } - } - - /// - /// test enum - /// - public enum TestEnum - { - ValueA, - ValueB - } - - /// - /// Generic class with generic and non-generic methods - /// - /// - public class TestClassGeneric - { - private object _PassedValue; - private bool _RegularMethodSuccess; - - public bool RegularMethodSuccess { - get { return _RegularMethodSuccess; } - } - - private bool _GenericMethodSuccess; - - public bool GenericMethodSuccess { - get { return _GenericMethodSuccess; } - } - - public void GenericMethod (T value) - { - _PassedValue = value; - _GenericMethodSuccess = true; - } - - public void RegularMethod () - { - _RegularMethodSuccess = true; - } - - /// - /// Returns true if the generic method was successfully passed a matching value - /// - /// - /// - public bool Validate (T value) - { - return value.Equals (_PassedValue); - } - } - - /// - /// Normal class containing a generic method - /// - public class TestClassWithGenericMethod - { - private object _PassedValue; - - public object PassedValue { - get { return _PassedValue; } - } - - private bool _GenericMethodSuccess; - - public bool GenericMethodSuccess { - get { return _GenericMethodSuccess; } - } - - public void GenericMethod (T value) - { - _PassedValue = value; - _GenericMethodSuccess = true; - } - - internal bool Validate (T value) - { - return value.Equals (_PassedValue); - } - } - - public class TestClass2 - { - public static int func (int x, int y) - { - return x + y; - } - - public int funcInstance (int x, int y) - { - return x + y; - } - } - - /* - * Sample class used in several test cases to check if - * Lua scripts are accessing objects correctly - */ - public class TestClass : IFoo1, IFoo2 - { - public int val; - private string strVal; - - public TestClass () - { - val = 0; - } - - public TestClass (int val) - { - this.val = val; - } - - public TestClass (string val) - { - this.strVal = val; - } - - public static TestClass makeFromString (String str) - { - return new TestClass (str); - } - - bool? nb2 = null; - - public bool? NullableBool { - get { return nb2; } - set { nb2 = value; } - } - - TestStruct s = new TestStruct (); - - public TestStruct Struct { - get { return s; } - set { s = (TestStruct)value; } - } - - public int testval { - get { - return this.val; - } - set { - this.val = value; - } - } - - public string teststrval { - get { - return this.strVal; - } - set { - this.strVal = value; - } - } - - public int this [int index] { - get { return 1; } - set { } - } - - public int this [string index] { - get { return 1; } - set { } - } - - public TimeSpan? NullableMethod (TimeSpan? input) - { - return input; - } - - public int? NullableMethod2 (int? input) - { - return input; - } - - public object[] TestLuaFunction (LuaFunction func) - { - if (func != null) { - return func.Call (1, 2); - } - return null; - } - - public int sum (int x, int y) - { - return x + y; - } - - public void setVal (int newVal) - { - val = newVal; - } - - public void setVal (string newVal) - { - strVal = newVal; - } - - public int getVal () - { - return val; - } - - public string getStrVal () - { - return strVal; - } - - public int outVal (out int val) - { - val = 5; - return 3; - } - - public int outVal (out int val, int val2) - { - val = 5; - return val2; - } - - public int outVal (int val, ref int val2) - { - val2 = val + val2; - return val; - } - - public int outValMutiple (int arg, out string arg2, out string arg3) - { - arg2 = Guid.NewGuid ().ToString (); - arg3 = Guid.NewGuid ().ToString (); - - return arg; - } - - public int callDelegate1 (TestDelegate1 del) - { - return del (2, 3); - } - - public int callDelegate2 (TestDelegate2 del) - { - int a = 3; - int b = del (2, out a); - return a + b; - } - - public int callDelegate3 (TestDelegate3 del) - { - int a = 3; - del (2, ref a); - //Console.WriteLine(a); - return a; - } - - public int callDelegate4 (TestDelegate4 del) - { - return del (2, 3).testval; - } - - public int callDelegate5 (TestDelegate5 del) - { - return del (new TestClass (2), new TestClass (3)); - } - - public int callDelegate6 (TestDelegate6 del) - { - TestClass test = new TestClass (); - int a = del (2, out test); - return a + test.testval; - } - - public int callDelegate7 (TestDelegate7 del) - { - TestClass test = new TestClass (3); - del (2, ref test); - return test.testval; - } - - public int callInterface1 (ITest itest) - { - return itest.test1 (2, 3); - } - - public int callInterface2 (ITest itest) - { - int a = 3; - int b = itest.test2 (2, out a); - return a + b; - } - - public int callInterface3 (ITest itest) - { - int a = 3; - itest.test3 (2, ref a); - //Console.WriteLine(a); - return a; - } - - public int callInterface4 (ITest itest) - { - return itest.test4 (2, 3).testval; - } - - public int callInterface5 (ITest itest) - { - return itest.test5 (new TestClass (2), new TestClass (3)); - } - - public int callInterface6 (ITest itest) - { - TestClass test = new TestClass (); - int a = itest.test6 (2, out test); - return a + test.testval; - } - - public int callInterface7 (ITest itest) - { - TestClass test = new TestClass (3); - itest.test7 (2, ref test); - return test.testval; - } - - public int callInterface8 (ITest itest) - { - itest.intProp = 3; - return itest.intProp; - } - - public int callInterface9 (ITest itest) - { - itest.refProp = new TestClass (3); - return itest.refProp.testval; - } - - public void exceptionMethod () - { - throw new Exception ("exception test"); - } - - public virtual int overridableMethod (int x, int y) - { - return x + y; - } - - public static int callOverridable (TestClass test, int x, int y) - { - return test.overridableMethod (x, y); - } - - int IFoo1.foo () - { - return 3; - } - - public int foo () - { - return 5; - } - - private void _PrivateMethod () - { - Console.WriteLine ("Private method called"); - } - - public void MethodOverload () - { - Console.WriteLine ("Method with no params"); - } - - public void MethodOverload (TestClass testClass) - { - Console.WriteLine ("Method with testclass param"); - } - - public void MethodOverload (int i, int j, int k) - { - Console.WriteLine ("Overload without out param: " + i + ", " + j + ", " + k); - } - - public void MethodOverload (int i, int j, out int k) - { - k = 5; - Console.WriteLine ("Overload with out param" + i + ", " + j); - } - - public void Print(object format,params object[] args) - { - //just for test,this is not printf implements - var output = format.ToString() + "\t"; - foreach(var msg in args) - { - output += msg.ToString() + "\t"; - } - Console.WriteLine(output); - } - - static public int MethodWithParams (int a, params int[] others) { - Console.WriteLine (a); - int i = 0; - foreach (int val in others) { - Console.WriteLine (val); - i++; - } - return i; - } - - static public int MethodWithObjectParams(params object[] others) - { - int i = 0; - foreach (var val in others) - { - Console.WriteLine(val); - i++; - } - return i; - } - } - - public class TestClassWithOverloadedMethod - { - public int CallsToStringFunc {get;set;} - public int CallsToIntFunc {get;set;} - public void Func (string param) - { - CallsToStringFunc++; - } - - public void Func (int param) - { - CallsToIntFunc++; - } - - } -} diff --git a/tests/build/net45/NLuaTest.csproj b/tests/build/net45/NLuaTest.csproj new file mode 100644 index 0000000000000000000000000000000000000000..42ab44328161ed1860bc13e687e509e83d2a4d7f --- /dev/null +++ b/tests/build/net45/NLuaTest.csproj @@ -0,0 +1,144 @@ + + + + + + + Debug + AnyCPU + {20AE709C-FB97-48E3-89B0-A34A5C3DA1DB} + Library + Properties + NLuaTest + NLuaTest + v4.5 + 512 + + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + AnyCPU + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\packages\KeraLua.0.1.14\lib\net45\KeraLua.dll + + + ..\..\..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll + + + + + + + + + + + AAACodeGenTests.cs + + + Core.cs + + + Entity.cs + + + LoadFileTests.cs + + + LuaTests.cs + + + AssemblyInfo.cs + + + TestLua.cs + + + + + scripts\core\bisect.lua + PreserveNewest + + + scripts\core\cf.lua + PreserveNewest + + + scripts\core\factorial.lua + PreserveNewest + + + scripts\core\fib.lua + PreserveNewest + + + scripts\core\fibfor.lua + PreserveNewest + + + scripts\core\life.lua + PreserveNewest + + + scripts\core\printf.lua + PreserveNewest + + + scripts\core\sieve.lua + PreserveNewest + + + scripts\core\sort.lua + PreserveNewest + + + scripts\test.lua + PreserveNewest + + + scripts\test_32.luac + PreserveNewest + + + scripts\test_64.luac + PreserveNewest + + + + + + {c45805a8-6436-4738-bd9f-4632eea63bbc} + NLua + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + \ No newline at end of file diff --git a/tests/build/net45/packages.config b/tests/build/net45/packages.config new file mode 100644 index 0000000000000000000000000000000000000000..814d89e3c8e3e4d45f685533d3afc824638bea69 --- /dev/null +++ b/tests/build/net45/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tests/build/netcore/NLuaTest.Core.csproj b/tests/build/netcore/NLuaTest.Core.csproj new file mode 100644 index 0000000000000000000000000000000000000000..6bbe790b4ec04fdfdf9518bab5d2c7e6183deb34 --- /dev/null +++ b/tests/build/netcore/NLuaTest.Core.csproj @@ -0,0 +1,99 @@ + + + netcoreapp2.0 + false + false + false + false + false + false + false + false + false + false + false + + + + bin\Release\ + false + + + + bin\Debug\ + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + foo.lua + PreserveNewest + + + main.lua + PreserveNewest + + + module1.lua + PreserveNewest + + + + + lua53.dll + PreserveNewest + + + liblua53.dylib + PreserveNewest + + + liblua53.so + PreserveNewest + + + + + + + + + + diff --git a/tests/scripts/core/bisect.lua b/tests/scripts/core/bisect.lua new file mode 100644 index 0000000000000000000000000000000000000000..7f73d49f463d2decdd1747cecc447798e5dfcd49 --- /dev/null +++ b/tests/scripts/core/bisect.lua @@ -0,0 +1,29 @@ +-- bisection method for solving non-linear equations + +delta=1e-6 -- tolerance + +function bisect(f,a,b,fa,fb) + local c=(a+b)/2 + print(n .. " c=" .. c .. " a=" .. a .. " b=" .. b .. "\n") + if c==a or c==b or math.abs(a-b)= 0 then + return math.floor(num+.5) + else + return math.ceil(num-.5) + end +end + +for c0=-20,50-1,10 do + io.write("C ") + for c=c0,c0+10-1 do + io.write(string.format("%3.0f ",c)) + end + io.write("\n") + + io.write("F ") + for c=c0,c0+10-1 do + f=(9/5)*c+32 + x = round(f) + celcius = cf [x] + assert (celcius == c) + io.write(string.format("%3.0f ",f)) + end + + io.write("\n\n") +end diff --git a/tests/scripts/core/factorial.lua b/tests/scripts/core/factorial.lua new file mode 100644 index 0000000000000000000000000000000000000000..53cc247bbc399802c3d4c5d8a95bb11aa090665c --- /dev/null +++ b/tests/scripts/core/factorial.lua @@ -0,0 +1,53 @@ +-- function closures are powerful +local fact = {} +fact[0] = 1 +fact[1] = 1 +fact[2] = 2 +fact[3] = 6 +fact[4] = 24 +fact[5] = 120 +fact[6] = 720 +fact[7] = 5040 +fact[8] = 40320 +fact[9] = 362880 +fact[10] = 3628800 +fact[11] = 39916800 +fact[12] = 479001600 +fact[13] = 6227020800 +fact[14] = 87178291200 +fact[15] = 1307674368000 +fact[16] = 20922789888000 + +-- traditional fixed-point operator from functional programming +Y = function (g) + local a = function (f) return f(f) end + return a(function (f) + return g(function (x) + local c=f(f) + return c(x) + end) + end) +end + + +-- factorial without recursion +F = function (f) + return function (n) + if n == 0 then return 1 + else return n*f(n-1) end + end + end + +factorial = Y(F) -- factorial is the fixed point of F + +-- now test it +function test(x) + local val = factorial(x) + print(x.." ".."! = ".." ".. val.." ".."\n") + return val +end + +for n=0,16 do + local val = test (n) + assert (val == fact [n]) +end diff --git a/tests/scripts/core/fib.lua b/tests/scripts/core/fib.lua new file mode 100644 index 0000000000000000000000000000000000000000..0a3ae7add8768f271b65ca546a54e742bfa7d5aa --- /dev/null +++ b/tests/scripts/core/fib.lua @@ -0,0 +1,45 @@ +-- fibonacci function with cache + +-- very inefficient fibonacci function +function fib(n) + N=N+1 + if n<2 then + return n + else + return fib(n-1)+fib(n-2) + end +end + +-- a general-purpose value cache +function cache(f) + local c={} + return function (x) + local y=c[x] + if not y then + y=f(x) + c[x]=y + end + return y + end +end + +-- run and time it +function test(s,f) + N=0 + local c=os.clock() + local v=f(n) + local t=os.clock()-c + print(s,n,v,t,N) + return v +end + +n= 24 -- for other values, do lua fib.lua XX +n=tonumber(n) +print("","n","value","time","evals") +v = test("plain",fib) +assert (v == 46368) + +fib=cache(fib) +v = test("cached",fib) + +assert (v == 46368) diff --git a/tests/scripts/core/fibfor.lua b/tests/scripts/core/fibfor.lua new file mode 100644 index 0000000000000000000000000000000000000000..c840af0b8943fc7b43239d35a4813015af7b9213 --- /dev/null +++ b/tests/scripts/core/fibfor.lua @@ -0,0 +1,38 @@ +-- example of for with generator functions + + +local fibs = { + 1, + 1, + 2, + 3, + 5, + 8, + 13, + 21, + 34, + 55, + 89, + 144, + 233, + 377, + 610, + 987, +} + + +function generatefib (n) + return coroutine.wrap(function () + local a,b = 1, 1 + while a <= n do + coroutine.yield(a) + a, b = b, a+b + end + end) +end +local j = 1 +for i in generatefib(1000) do + print(i.." ".. fibs [j]) + assert (i == fibs [j]) + j = j + 1 +end diff --git a/tests/scripts/core/life.lua b/tests/scripts/core/life.lua new file mode 100644 index 0000000000000000000000000000000000000000..ea8b815072f53dba710ce0b872f39aff9d6c409d --- /dev/null +++ b/tests/scripts/core/life.lua @@ -0,0 +1,111 @@ +-- life.lua +-- original by Dave Bollinger posted to lua-l +-- modified to use ANSI terminal escape sequences +-- modified to use for instead of while + +local write=print + +ALIVE="¥" DEAD="þ" +ALIVE="O" DEAD="-" + +function delay() -- NOTE: SYSTEM-DEPENDENT, adjust as necessary + for i=1,10000 do end + -- local i=os.clock()+1 while(os.clock() 0 do + local xm1,x,xp1,xi=self.w-1,self.w,1,self.w + while xi > 0 do + local sum = self[ym1][xm1] + self[ym1][x] + self[ym1][xp1] + + self[y][xm1] + self[y][xp1] + + self[yp1][xm1] + self[yp1][x] + self[yp1][xp1] + next[y][x] = ((sum==2) and self[y][x]) or ((sum==3) and 1) or 0 + xm1,x,xp1,xi = x,xp1,xp1+1,xi-1 + end + ym1,y,yp1,yi = y,yp1,yp1+1,yi-1 + end +end + +-- output the array to screen +function _CELLS:draw() + local out="" -- accumulate to reduce flicker + for y=1,self.h do + for x=1,self.w do + out=out..(((self[y][x]>0) and ALIVE) or DEAD) + end + out=out.."\n" + end + write(out) +end + +-- constructor +function CELLS(w,h) + local c = ARRAY2D(w,h) + c.spawn = _CELLS.spawn + c.evolve = _CELLS.evolve + c.draw = _CELLS.draw + return c +end + +-- +-- shapes suitable for use with spawn() above +-- +HEART = { 1,0,1,1,0,1,1,1,1; w=3,h=3 } +GLIDER = { 0,0,1,1,0,1,0,1,1; w=3,h=3 } +EXPLODE = { 0,1,0,1,1,1,1,0,1,0,1,0; w=3,h=4 } +FISH = { 0,1,1,1,1,1,0,0,0,1,0,0,0,0,1,1,0,0,1,0; w=5,h=4 } +BUTTERFLY = { 1,0,0,0,1,0,1,1,1,0,1,0,0,0,1,1,0,1,0,1,1,0,0,0,1; w=5,h=5 } + +-- the main routine +function LIFE(w,h) + -- create two arrays + local thisgen = CELLS(w,h) + local nextgen = CELLS(w,h) + + -- create some life + -- about 1000 generations of fun, then a glider steady-state + thisgen:spawn(GLIDER,5,4) + thisgen:spawn(EXPLODE,25,10) + thisgen:spawn(FISH,4,12) + + -- run until break + local gen=1 + write("\027[2J") -- ANSI clear screen + while 1 do + thisgen:evolve(nextgen) + thisgen,nextgen = nextgen,thisgen + write("\027[H") -- ANSI home cursor + thisgen:draw() + write("Life - generation ".." "..gen.." ".."\n") + gen=gen+1 + if gen>2000 then break end + --delay() -- no delay + end +end + +LIFE(40,20) diff --git a/tests/scripts/core/printf.lua b/tests/scripts/core/printf.lua new file mode 100644 index 0000000000000000000000000000000000000000..e83b129af9c89d07f3019ad54951c6d78976d280 --- /dev/null +++ b/tests/scripts/core/printf.lua @@ -0,0 +1,13 @@ +-- an implementation of printf + +function sprintf(...) + return string.format(...) +end + +function printf (...) + print(sprintf(...)) +end + +x = sprintf("Hello %s from %s on %s", "there", "Lua Tests", "XYZ") +assert (x == "Hello there from Lua Tests on XYZ") +print(x) diff --git a/tests/scripts/core/sieve.lua b/tests/scripts/core/sieve.lua new file mode 100644 index 0000000000000000000000000000000000000000..100454f3004d7183596e31d735ea90b2eed6b581 --- /dev/null +++ b/tests/scripts/core/sieve.lua @@ -0,0 +1,202 @@ +-- the sieve of of Eratosthenes programmed with coroutines +-- typical usage: lua -e N=1000 sieve.lua | column + +local siev = { + 2, +3, +5, +7, +11, +13, +17, +19, +23, +29, +31, +37, +41, +43, +47, +53, +59, +61, +67, +71, +73, +79, +83, +89, +97, +101, +103, +107, +109, +113, +127, +131, +137, +139, +149, +151, +157, +163, +167, +173, +179, +181, +191, +193, +197, +199, +211, +223, +227, +229, +233, +239, +241, +251, +257, +263, +269, +271, +277, +281, +283, +293, +307, +311, +313, +317, +331, +337, +347, +349, +353, +359, +367, +373, +379, +383, +389, +397, +401, +409, +419, +421, +431, +433, +439, +443, +449, +457, +461, +463, +467, +479, +487, +491, +499, +503, +509, +521, +523, +541, +547, +557, +563, +569, +571, +577, +587, +593, +599, +601, +607, +613, +617, +619, +631, +641, +643, +647, +653, +659, +661, +673, +677, +683, +691, +701, +709, +719, +727, +733, +739, +743, +751, +757, +761, +769, +773, +787, +797, +809, +811, +821, +823, +827, +829, +839, +853, +857, +859, +863, +877, +881, +883, +887, +907, +911, +919, +929, +937, +941, +947, +953, +967, +971, +977, +983, +991, +997, +} +-- generate all the numbers from 2 to n +function gen (n) + return coroutine.wrap(function () + for i=2,n do coroutine.yield(i) end + end) +end + +-- filter the numbers generated by `g', removing multiples of `p' +function filter (p, g) + return coroutine.wrap(function () + while 1 do + local n = g() + if n == nil then return end + if math.fmod(n, p) ~= 0 then coroutine.yield(n) end + end + end) +end + +N=1000 -- from command line +x = gen(N) -- generate primes up to N +local j = 1 +while 1 do + local n = x() -- pick a number until done + if n == nil then break end + print(n) -- must be a prime number + assert (n == siev [j]) + x = filter(n, x) -- now remove its multiples + j = j + 1 +end diff --git a/tests/scripts/core/sort.lua b/tests/scripts/core/sort.lua new file mode 100644 index 0000000000000000000000000000000000000000..e662f183a6f74c187f36cc2b0db300379f68b6b0 --- /dev/null +++ b/tests/scripts/core/sort.lua @@ -0,0 +1,70 @@ +-- two implementations of a sort function +-- this is an example only. Lua has now a built-in function "sort" + +quicksort_x = {"Apr","Aug","Dec","Feb","Jan","Jul","Jun","Mar","May","Nov","Oct","Sep"} +reverse_x = {"Sep","Oct","Nov","May","Mar","Jun","Jul","Jan","Feb","Dec","Aug","Apr"} + +-- extracted from Programming Pearls, page 110 +function qsort(x,l,u,f) + if ly end) + show("after reverse selection sort",x, reverse_x) + qsort(x,1,n,function (x,y) return x Clicked; + + protected virtual void OnEntityClicked(EventArgs e) + { + EventHandler handler = Clicked; + + if (handler != null) + { + handler(this, e); + } + } + + public string Property + { + get; + set; + } + + // default ctor + public Entity() + { + Property = "Default"; + } + // string ctor + public Entity(string param) + { + Property = "String"; + + } + + public Entity(int param) + { + Property = "Int"; + } + + public void Click() + { + OnEntityClicked(new EventArgs()); + } + } +} diff --git a/tests/src/LoadFileTests.cs b/tests/src/LoadFileTests.cs new file mode 100644 index 0000000000000000000000000000000000000000..7e24d33df9cbbcd1218d5233abec5a5b1b6bb5b3 --- /dev/null +++ b/tests/src/LoadFileTests.cs @@ -0,0 +1,101 @@ +using System; +using System.IO; +using NLua; + +using NLuaTest.Mock; + + +using NUnit.Framework; + +#if __IOS__ || __TVOS__ || __WATCHOS__ +using Foundation; +#endif + +namespace LoadFileTests +{ + [TestFixture] +#if __IOS__ || __TVOS__ || __WATCHOS__ + [Preserve (AllMembers = true)] +#endif + public class LoadLuaFile + { + public static string GetScriptsPath(string name) + { + string path = new Uri(typeof(LoadLuaFile).Assembly.CodeBase).AbsolutePath; + path = Path.GetDirectoryName(path); + path = Path.Combine(path, "scripts"); + path = Path.Combine (path, name); + return path; + } + /* + * Tests capturing an exception + */ + [Test] + public void TestLoadFile() + { + using (Lua lua = new Lua()) + { + lua.LoadCLRPackage(); + + string file = GetScriptsPath("test.lua"); + + lua.DoFile(file); + + int width = (int)(double)lua["width"]; + int height = (int)(double)lua["height"]; + string message = (string)lua["message"]; + int color_g = (int)(double)lua["color.g"]; + LuaFunction func = (LuaFunction)lua["func"]; + object[] res = func.Call(12, 34); + int x = (int)(double)res[0]; + int y = (int)(double)res[1]; + //function func(x,y) + // return x,x+y + //end + + Assert.AreEqual(100, width); + Assert.AreEqual(200, height); + Assert.AreEqual("Hello World!", message); + Assert.AreEqual(20, color_g); + Assert.AreEqual(12, x); + Assert.AreEqual(46, y); + } + } + + + [Test] + public void TestBinaryLoadFile() + { + using (Lua lua = new Lua()) + { + string file; + lua.LoadCLRPackage(); + + if (IntPtr.Size == 4) + file = GetScriptsPath("test_32.luac"); + else + file = GetScriptsPath("test_64.luac"); + + lua.DoFile(file); + + int width = (int)(double)lua["width"]; + int height = (int)(double)lua["height"]; + string message = (string)lua["message"]; + int color_g = (int)(double)lua["color.g"]; + LuaFunction func = (LuaFunction)lua["func"]; + object[] res = func.Call(12, 34); + int x = (int)(double)res[0]; + int y = (int)(double)res[1]; + + + Assert.AreEqual(100, width); + Assert.AreEqual(200, height); + Assert.AreEqual("Hello World!", message); + Assert.AreEqual(20, color_g); + Assert.AreEqual(12, x); + Assert.AreEqual(46, y); + } + } + } +} + diff --git a/tests/src/LuaTests.cs b/tests/src/LuaTests.cs new file mode 100644 index 0000000000000000000000000000000000000000..af2b18bc45e580dda711d6451c92e73d6e057c8d --- /dev/null +++ b/tests/src/LuaTests.cs @@ -0,0 +1,2707 @@ +using System; +using System.IO; +using System.Text; +using NLuaTest.Mock; +using System.Reflection; +using System.Threading; +using LoadFileTests; +using NLua; +using NLua.Exceptions; + +#if __IOS__ || __TVOS__ || __WATCHOS__ +using Foundation; +#endif + +using NUnit.Framework; + +namespace NLuaTest +{ + public class parameter + { + public string field1 = "parameter-field1"; + } + +#if __IOS__ || __TVOS__ || __WATCHOS__ + [Preserve (AllMembers = true)] +#endif + public class master + { + public static string read() + { + return "test-master"; + } + + public static string read(parameter test) + { + return test.field1; + } + } + +#if __IOS__ || __TVOS__ || __WATCHOS__ + [Preserve (AllMembers = true)] +#endif + public class testClass : master + { + public String strData; + public int intData; + public static string read2() + { + return "test"; + } + + public static string read(int test) + { + return "int-test"; + } + } + +#if __IOS__ || __TVOS__ || __WATCHOS__ + [Preserve (AllMembers = true)] +#endif + public class DefaultElementModel + { + public Action DrawMe { get; set; } + } + +#if __IOS__ || __TVOS__ || __WATCHOS__ + [Preserve (AllMembers = true)] +#endif + public class TestCaseName + { + public string name = "name"; + public string Name => "**" + name + "**"; + } + + + +#if __IOS__ || __TVOS__ || __WATCHOS__ + [Preserve (AllMembers = true)] +#endif + public class Vector + { + public double x; + public double y; + public static Vector operator *(float k, Vector v) + { + var r = new Vector(); + r.x = v.x * k; + r.y = v.y * k; + return r; + } + + public static Vector operator *(Vector v, float k) + { + var r = new Vector(); + r.x = v.x * k; + r.y = v.y * k; + return r; + } + + public void Func() + { + Console.WriteLine("Func"); + } + } + + public static class VectorExtension + { + public static double Length(this Vector v) + { + return v.x * v.x + v.y * v.y; + } + } + +#if __IOS__ || __TVOS__ || __WATCHOS__ + [Preserve (AllMembers = true)] +#endif + public class Person + { + public string firstName; + } + +#if __IOS__ || __TVOS__ || __WATCHOS__ + [Preserve (AllMembers = true)] +#endif + public class Employee : Person + { + public string occupation; + } + + public static class PersonExentsions + { + public static string GetFirstName(this Person argPerson) + { + return argPerson.firstName; + } + } + + [TestFixture] +#if __IOS__ || __TVOS__ || __WATCHOS__ + [Preserve (AllMembers = true)] +#endif + public class LuaTests + { + public static readonly char UnicodeChar = '\uE007'; + public static string UnicodeString + { + get + { + return Convert.ToString(UnicodeChar); + } + } + public static string UnicodeStringRussian + { + get + { + return "Файл"; + } + } + /* + * Tests capturing an exception + */ + [Test] + public void ThrowException() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('mscorlib')"); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("err,errMsg=pcall(test.exceptionMethod,test)"); + bool err = (bool)lua["err"]; + Exception errMsg = (Exception)lua["errMsg"]; + Assert.AreEqual(false, err); + Assert.AreNotEqual(null, errMsg.InnerException); + Assert.AreEqual("exception test", errMsg.InnerException.Message); + } + } + + /* + * Tests passing a LuaFunction + */ + [Test] + public void CallLuaFunction() + { + using (Lua lua = new Lua()) + { + lua.DoString("function someFunc(v1,v2) return v1 + v2 end"); + lua["funcObject"] = lua.GetFunction("someFunc"); + + lua.DoString("luanet.load_assembly('mscorlib')"); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("b = TestClass():TestLuaFunction(funcObject)[0]"); + Assert.AreEqual(3, lua["b"]); + lua.DoString("a = TestClass():TestLuaFunction(nil)"); + Assert.AreEqual(null, lua["a"]); + } + } + + /* + * Tests capturing an exception + */ + [Test] + public void ThrowUncaughtException() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('mscorlib')"); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + + try + { + lua.DoString("test:exceptionMethod()"); + //failed + Assert.AreEqual(false, true); + } + catch (Exception) + { + //passed + Assert.AreEqual(true, true); + } + } + } + + + /* + * Tests nullable fields + */ + [Test] + public void TestNullable() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('mscorlib')"); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("val=test.NullableBool"); + Assert.AreEqual(null, (object)lua["val"]); + lua.DoString("test.NullableBool = true"); + lua.DoString("val=test.NullableBool"); + Assert.AreEqual(true, (bool)lua["val"]); + } + } + + /* + * Tests structure assignment + */ + [Test] + public void TestStructs() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("TestStruct=luanet.import_type('NLuaTest.Mock.TestStruct')"); + lua.DoString("struct=TestStruct(2)"); + lua.DoString("test.Struct = struct"); + lua.DoString("val=test.Struct.val"); + Assert.AreEqual(2.0d, (double)lua["val"]); + } + } + + /* + * Tests structure creation via the default constructor + */ + [Test] + public void TestStructDefaultConstructor() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestStruct=luanet.import_type('NLuaTest.Mock.TestStruct')"); + lua.DoString("struct=TestStruct()"); + Assert.AreEqual(new TestStruct(), (TestStruct)lua["struct"]); + } + } + + [Test] + public void TestStructHashesEqual() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestStruct=luanet.import_type('NLuaTest.Mock.TestStruct')"); + lua.DoString("struct1=TestStruct(0)"); + lua.DoString("struct2=TestStruct(0)"); + lua.DoString("struct2.val=1"); + Assert.AreEqual(0, (double)lua["struct1.val"]); + } + } + + [Test] + public void TestEnumEqual() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestEnum=luanet.import_type('NLuaTest.Mock.TestEnum')"); + lua.DoString("enum1=TestEnum.ValueA"); + lua.DoString("enum2=TestEnum.ValueB"); + Assert.AreEqual(true, (bool)lua.DoString("return enum1 ~= enum2")[0]); + Assert.AreEqual(false, (bool)lua.DoString("return enum1 == enum2")[0]); + } + } + + [Test] + public void TestMethodOverloads() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('mscorlib')"); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("test:MethodOverload()"); + lua.DoString("test:MethodOverload(test)"); + lua.DoString("test:MethodOverload(1,1,1)"); + lua.DoString("test:MethodOverload(2,2,i)\r\nprint(i)"); + } + } + + [Test] + public void TestDispose() + { + GC.Collect(); + long startingMem = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64; + + for (int i = 0; i < 300; i++) + { + using (Lua lua = new Lua()) + { + _Calc(lua, i); + } + } + + long endMem = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64; + Console.WriteLine("Was using " + startingMem / 1024 / 1024 + "MB, now using: " + endMem / 1024 / 1024 + "MB"); + } + + private void _Calc(Lua lua, int i) + { + lua.DoString( + "sqrt = math.sqrt;" + + "sqr = function(x) return math.pow(x,2); end;" + + "log = math.log;" + + "log10 = math.log10;" + + "exp = math.exp;" + + "sin = math.sin;" + + "cos = math.cos;" + + "tan = math.tan;" + + "abs = math.abs;" + ); + lua.DoString("function calcVP(a,b) return a+b end"); + //LuaFunction lf = lua.GetFunction("calcVP"); + //lf.Call(i, 20); + } + + [Test] + public void TestThreading() + { + using (Lua lua = new Lua()) + { + object lua_locker = new object(); + DoWorkClass doWork = new DoWorkClass(); + lua.RegisterFunction("dowork", doWork, typeof(DoWorkClass).GetMethod("DoWork")); + bool failureDetected = false; + int completed = 0; + int iterations = 10; + + for (int i = 0; i < iterations; i++) + { + ThreadPool.QueueUserWorkItem(new WaitCallback(delegate (object o) + { + try + { + lock (lua_locker) + { + lua.DoString("dowork()"); + } + } + catch (Exception e) + { + Console.Write(e); + failureDetected = true; + } + + completed++; + })); + } + + while (completed < iterations && !failureDetected) + Thread.Sleep(50); + + Assert.AreEqual(false, failureDetected); + } + } + + [Test] + public void TestPrivateMethod() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('mscorlib')"); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + + try + { + lua.DoString("test:_PrivateMethod()"); + } + catch + { + Assert.AreEqual(true, true); + return; + } + + Assert.AreEqual(true, false); + } + } + + /* + * Tests functions + */ + [Test] + public void TestFunctions() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('mscorlib')"); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.RegisterFunction("p", null, typeof(Console).GetMethod("WriteLine", new [] { typeof(string) })); + lua.DoString("p('Foo')"); + // Yet this works... + lua.DoString("string.gsub('some string', '(%w+)', function(s) p(s) end)"); + } + } + + + /* + * Tests making an object from a Lua table and calling one of + * methods the table overrides. + */ + [Test] + public void LuaTableOverridedMethod() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test={}"); + lua.DoString("function test:overridableMethod(x,y) return x*y; end"); + lua.DoString("luanet.make_object(test,'NLuaTest.Mock.TestClass')"); + lua.DoString("a=TestClass.callOverridable(test,2,3)"); + int a = (int)lua.GetNumber("a"); + lua.DoString("luanet.free_object(test)"); + Assert.AreEqual(6, a); + } + } + + + /* + * Tests making an object from a Lua table and calling a method + * the table does not override. + */ + [Test] + public void LuaTableInheritedMethod() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test={}"); + lua.DoString("function test:overridableMethod(x,y) return x*y; end"); + lua.DoString("luanet.make_object(test,'NLuaTest.Mock.TestClass')"); + lua.DoString("test:setVal(3)"); + lua.DoString("a=test.testval"); + int a = (int)lua.GetNumber("a"); + lua.DoString("luanet.free_object(test)"); + Assert.AreEqual(3, a); + //Console.WriteLine("interface returned: "+a); + } + } + + + /// + /// Basic multiply method which expects 2 floats + /// + /// + /// + /// + private float _TestException(float val, float val2) + { + return val * val2; + } + + class LuaEventArgsHandler : NLua.Method.LuaDelegate + { + void CallFunction(object sender, EventArgs eventArgs) + { + object[] args = new object[] { sender, eventArgs }; + object[] inArgs = new object[] { sender, eventArgs }; + int[] outArgs = new int[] { }; + base.CallFunction(args, inArgs, outArgs); + } + } + + [Test] + public void TestEventException() + { + using (Lua lua = new Lua()) + { + //Register a C# function + MethodInfo testException = this.GetType().GetMethod("_TestException", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance, null, new Type[] { + typeof(float), + typeof(float) + }, null); + lua.RegisterFunction("Multiply", this, testException); + lua.RegisterLuaDelegateType(typeof(EventHandler), typeof(LuaEventArgsHandler)); + //create the lua event handler code for the entity + //includes the bad code! + lua.DoString("function OnClick(sender, eventArgs)\r\n" + + "--Multiply expects 2 floats, but instead receives 2 strings\r\n" + + "Multiply(asd, es)\r\n" + + "end"); + //create the lua event handler code for the entity + //good code + //lua.DoString("function OnClick(sender, eventArgs)\r\n" + + // "--Multiply expects 2 floats\r\n" + + // "Multiply(2, 50)\r\n" + + // "end"); + //Create the event handler script + lua.DoString("function SubscribeEntity(e)\r\ne.Clicked:Add(OnClick)\r\nend"); + //Create the entity object + Entity entity = new Entity(); + //Register the entity object with the event handler inside lua + LuaFunction lf = lua.GetFunction("SubscribeEntity"); + lf.Call(new object[1] { entity }); + + try + { + //Cause the event to be fired + entity.Click(); + //failed + Assert.AreEqual(true, false); + } + catch (LuaException) + { + //passed + Assert.AreEqual(true, true); + } + } + } + + [Test] + public void TestExceptionWithChunkOverload() + { + using (Lua lua = new Lua()) + { + try + { + lua.DoString("thiswillthrowanerror", "MyChunk"); + } + catch (Exception e) + { + Assert.AreEqual(true, e.Message.StartsWith("[string \"MyChunk\"]")); + } + } + } + + [Test] + public void TestGenerics() + { + //Im not sure support for generic classes is possible to implement, see: http://msdn.microsoft.com/en-us/library/system.reflection.methodinfo.containsgenericparameters.aspx + //specifically the line that says: "If the ContainsGenericParameters property returns true, the method cannot be invoked" + //TestClassGeneric genericClass = new TestClassGeneric(); + //lua.RegisterFunction("genericMethod", genericClass, typeof(TestClassGeneric<>).GetMethod("GenericMethod")); + //lua.RegisterFunction("regularMethod", genericClass, typeof(TestClassGeneric<>).GetMethod("RegularMethod")); + using (Lua lua = new Lua()) + { + TestClassWithGenericMethod classWithGenericMethod = new TestClassWithGenericMethod(); + + //////////////////////////////////////////////////////////////////////////// + /// //////////////////////////////////////////////////////////////////////// + /// IMPORTANT: Use generic method with the type you will call or generic methods will fail with iOS + /// //////////////////////////////////////////////////////////////////////// + classWithGenericMethod.GenericMethod(99.0); + classWithGenericMethod.GenericMethod(new TestClass(99)); + //////////////////////////////////////////////////////////////////////////// + /// //////////////////////////////////////////////////////////////////////// + + lua.RegisterFunction("genericMethod2", classWithGenericMethod, typeof(TestClassWithGenericMethod).GetMethod("GenericMethod")); + + try + { + lua.DoString("genericMethod2(100)"); + } + catch + { + } + + Assert.AreEqual(true, classWithGenericMethod.GenericMethodSuccess); + Assert.AreEqual(true, classWithGenericMethod.Validate(100)); //note the gotcha: numbers are all being passed to generic methods as doubles + + try + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass(56)"); + lua.DoString("genericMethod2(test)"); + } + catch + { + } + + Assert.AreEqual(true, classWithGenericMethod.GenericMethodSuccess); + Assert.AreEqual(56, (classWithGenericMethod.PassedValue as TestClass).val); + } + } + + [Test] + public void RegisterFunctionStressTest() + { + const int Count = 200; // it seems to work with 41 + using (Lua lua = new Lua()) + { + MyClass t = new MyClass(); + + for (int i = 1; i < Count - 1; ++i) + { + lua.RegisterFunction("func" + i, t, typeof(MyClass).GetMethod("Func1")); + } + + lua.RegisterFunction("func" + (Count - 1), t, typeof(MyClass).GetMethod("Func1")); + lua.DoString("print(func1())"); + } + } + + [Test] + public void TestMultipleOutParameters() + { + using (Lua lua = new Lua()) + { + TestClass t1 = new TestClass(); + lua["netobj"] = t1; + lua.DoString("a,b,c=netobj:outValMutiple(2)"); + int a = (int)lua.GetNumber("a"); + string b = (string)lua.GetString("b"); + string c = (string)lua.GetString("c"); + Assert.AreEqual(2, a); + Assert.AreNotEqual(null, b); + Assert.AreNotEqual(null, c); + } + } + + [Test] + public void TestLoadStringLeak() + { + //Test to prevent stack overflow + //See: http://code.google.com/p/nlua/issues/detail?id=5 + //number of iterations to test + int count = 1000; + using (Lua lua = new Lua()) + { + for (int i = 0; i < count; i++) + { + lua.LoadString("abc = 'def'", string.Empty); + } + } + //any thrown exceptions cause the test run to fail + } + + + + [Test] + public void TestLoadFileLeak() + { + //Test to prevent stack overflow + //See: http://code.google.com/p/luainterface/issues/detail?id=5 + //number of iterations to test + int count = 1000; + string file = LoadLuaFile.GetScriptsPath("test.lua"); + + using (Lua lua = new Lua()) + { + for (int i = 0; i < count; i++) + { + lua.LoadFile(file); + } + } + //any thrown exceptions cause the test run to fail + } + + [Test] + public void TestRegisterFunction() + { + using (Lua lua = new Lua()) + { + lua.RegisterFunction("func1", null, typeof(TestClass2).GetMethod("func")); + object[] vals1 = lua.GetFunction("func1").Call(2, 3); + Assert.AreEqual(5.0f, Convert.ToSingle(vals1[0])); + TestClass2 obj = new TestClass2(); + lua.RegisterFunction("func2", obj, typeof(TestClass2).GetMethod("funcInstance")); + vals1 = lua.GetFunction("func2").Call(2, 3); + Assert.AreEqual(5.0f, Convert.ToSingle(vals1[0])); + } + } + + /* + * Tests passing a null object as a parameter to a + * method that accepts a nullable. + */ + [Test] + public void TestNullableParameter() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("a = test:NullableMethod(nil)"); + Assert.AreEqual(null, lua["a"]); + lua["timeVal"] = TimeSpan.FromSeconds(5); + lua.DoString("b = test:NullableMethod(timeVal)"); + Assert.AreEqual(TimeSpan.FromSeconds(5), lua["b"]); + lua.DoString("d = test:NullableMethod2(2)"); + Assert.AreEqual(2, lua["d"]); + lua.DoString("c = test:NullableMethod2(nil)"); + Assert.AreEqual(null, lua["c"]); + } + } + + /* + * Tests if DoString is correctly returning values + */ + [Test] + public void DoString() + { + using (Lua lua = new Lua()) + { + object[] res = lua.DoString("a=2\nreturn a,3"); + //Console.WriteLine("a="+res[0]+", b="+res[1]); + Assert.AreEqual(res[0], 2d); + Assert.AreEqual(res[1], 3d); + } + } + /* + * Tests getting of global numeric variables + */ + [Test] + public void GetGlobalNumber() + { + using (Lua lua = new Lua()) + { + lua.DoString("a=2"); + double num = lua.GetNumber("a"); + //Console.WriteLine("a="+num); + Assert.AreEqual(num, 2d); + } + } + /* + * Tests setting of global numeric variables + */ + [Test] + public void SetGlobalNumber() + { + using (Lua lua = new Lua()) + { + lua.DoString("a=2"); + lua["a"] = 3; + double num = lua.GetNumber("a"); + //Console.WriteLine("a="+num); + Assert.AreEqual(num, 3d); + } + } + /* + * Tests getting of numeric variables from tables + * by specifying variable path + */ + [Test] + public void GetNumberInTable() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=2}}"); + double num = lua.GetNumber("a.b.c"); + //Console.WriteLine("a.b.c="+num); + Assert.AreEqual(num, 2d); + } + } + /* + * Tests setting of numeric variables from tables + * by specifying variable path + */ + [Test] + public void SetNumberInTable() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=2}}"); + lua["a.b.c"] = 3; + double num = lua.GetNumber("a.b.c"); + //Console.WriteLine("a.b.c="+num); + Assert.AreEqual(num, 3d); + } + } + /* + * Tests getting of global string variables + */ + [Test] + public void GetGlobalString() + { + using (Lua lua = new Lua()) + { + lua.DoString("a=\"test\""); + string str = lua.GetString("a"); + //Console.WriteLine("a="+str); + Assert.AreEqual(str, "test"); + } + } + /* + * Tests setting of global string variables + */ + [Test] + public void SetGlobalString() + { + using (Lua lua = new Lua()) + { + lua.DoString("a=\"test\""); + lua["a"] = "new test"; + string str = lua.GetString("a"); + //Console.WriteLine("a="+str); + Assert.AreEqual(str, "new test"); + } + } + /* + * Tests getting of string variables from tables + * by specifying variable path + */ + [Test] + public void GetStringInTable() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=\"test\"}}"); + string str = lua.GetString("a.b.c"); + //Console.WriteLine("a.b.c="+str); + Assert.AreEqual(str, "test"); + } + } + /* + * Tests setting of string variables from tables + * by specifying variable path + */ + [Test] + public void SetStringInTable() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=\"test\"}}"); + lua["a.b.c"] = "new test"; + string str = lua.GetString("a.b.c"); + //Console.WriteLine("a.b.c="+str); + Assert.AreEqual(str, "new test"); + } + } + /* + * Tests getting and setting of global table variables + */ + [Test] + public void GetAndSetTable() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=2}}\nb={c=3}"); + LuaTable tab = lua.GetTable("b"); + lua["a.b"] = tab; + double num = lua.GetNumber("a.b.c"); + //Console.WriteLine("a.b.c="+num); + Assert.AreEqual(num, 3d); + } + } + /* + * Tests getting of numeric field of a table + */ + [Test] + public void GetTableNumericField1() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=2}}"); + LuaTable tab = lua.GetTable("a.b"); + double num = (double)tab["c"]; + //Console.WriteLine("a.b.c="+num); + Assert.AreEqual(num, 2d); + } + } + /* + * Tests getting of numeric field of a table + * (the field is inside a subtable) + */ + [Test] + public void GetTableNumericField2() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=2}}"); + LuaTable tab = lua.GetTable("a"); + double num = (double)tab["b.c"]; + //Console.WriteLine("a.b.c="+num); + Assert.AreEqual(num, 2d); + } + } + /* + * Tests setting of numeric field of a table + */ + [Test] + public void SetTableNumericField1() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=2}}"); + LuaTable tab = lua.GetTable("a.b"); + tab["c"] = 3; + double num = lua.GetNumber("a.b.c"); + //Console.WriteLine("a.b.c="+num); + Assert.AreEqual(num, 3d); + } + } + /* + * Tests setting of numeric field of a table + * (the field is inside a subtable) + */ + [Test] + public void SetTableNumericField2() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=2}}"); + LuaTable tab = lua.GetTable("a"); + tab["b.c"] = 3; + double num = lua.GetNumber("a.b.c"); + //Console.WriteLine("a.b.c="+num); + Assert.AreEqual(num, 3d); + } + } + /* + * Tests getting of string field of a table + */ + [Test] + public void GetTableStringField1() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=\"test\"}}"); + LuaTable tab = lua.GetTable("a.b"); + string str = (string)tab["c"]; + //Console.WriteLine("a.b.c="+str); + Assert.AreEqual(str, "test"); + } + } + /* + * Tests getting of string field of a table + * (the field is inside a subtable) + */ + [Test] + public void GetTableStringField2() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=\"test\"}}"); + LuaTable tab = lua.GetTable("a"); + string str = (string)tab["b.c"]; + //Console.WriteLine("a.b.c="+str); + Assert.AreEqual(str, "test"); + } + } + /* + * Tests setting of string field of a table + */ + [Test] + public void SetTableStringField1() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=\"test\"}}"); + LuaTable tab = lua.GetTable("a.b"); + tab["c"] = "new test"; + string str = lua.GetString("a.b.c"); + //Console.WriteLine("a.b.c="+str); + Assert.AreEqual(str, "new test"); + } + } + /* + * Tests setting of string field of a table + * (the field is inside a subtable) + */ + [Test] + public void SetTableStringField2() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=\"test\"}}"); + LuaTable tab = lua.GetTable("a"); + tab["b.c"] = "new test"; + string str = lua.GetString("a.b.c"); + //Console.WriteLine("a.b.c="+str); + Assert.AreEqual(str, "new test"); + } + } + /* + * Tests calling of a global function with zero arguments + */ + [Test] + public void CallGlobalFunctionNoArgs() + { + using (Lua lua = new Lua()) + { + lua.DoString("a=2\nfunction f()\na=3\nend"); + lua.GetFunction("f").Call(); + double num = lua.GetNumber("a"); + //Console.WriteLine("a="+num); + Assert.AreEqual(num, 3d); + } + } + /* + * Tests calling of a global function with one argument + */ + [Test] + public void CallGlobalFunctionOneArg() + { + using (Lua lua = new Lua()) + { + lua.DoString("a=2\nfunction f(x)\na=a+x\nend"); + lua.GetFunction("f").Call(1); + double num = lua.GetNumber("a"); + //Console.WriteLine("a="+num); + Assert.AreEqual(num, 3d); + } + } + /* + * Tests calling of a global function with two arguments + */ + [Test] + public void CallGlobalFunctionTwoArgs() + { + using (Lua lua = new Lua()) + { + lua.DoString("a=2\nfunction f(x,y)\na=x+y\nend"); + lua.GetFunction("f").Call(1, 3); + double num = lua.GetNumber("a"); + //Console.WriteLine("a="+num); + Assert.AreEqual(num, 4d); + } + } + /* + * Tests calling of a global function that returns one value + */ + [Test] + public void CallGlobalFunctionOneReturn() + { + using (Lua lua = new Lua()) + { + lua.DoString("function f(x)\nreturn x+2\nend"); + object[] ret = lua.GetFunction("f").Call(3); + //Console.WriteLine("ret="+ret[0]); + Assert.AreEqual(1, ret.Length); + Assert.AreEqual(5, (double)ret[0]); + } + } + /* + * Tests calling of a global function that returns two values + */ + [Test] + public void CallGlobalFunctionTwoReturns() + { + using (Lua lua = new Lua()) + { + lua.DoString("function f(x,y)\nreturn x,x+y\nend"); + object[] ret = lua.GetFunction("f").Call(3, 2); + //Console.WriteLine("ret="+ret[0]+","+ret[1]); + Assert.AreEqual(2, ret.Length); + Assert.AreEqual(3, (double)ret[0]); + Assert.AreEqual(5, (double)ret[1]); + } + } + /* + * Tests calling of a function inside a table + */ + [Test] + public void CallTableFunctionTwoReturns() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={}\nfunction a.f(x,y)\nreturn x,x+y\nend"); + object[] ret = lua.GetFunction("a.f").Call(3, 2); + //Console.WriteLine("ret="+ret[0]+","+ret[1]); + Assert.AreEqual(2, ret.Length); + Assert.AreEqual(3, (double)ret[0]); + Assert.AreEqual(5, (double)ret[1]); + } + } + /* + * Tests setting of a global variable to a CLR object value + */ + [Test] + public void SetGlobalObject() + { + using (Lua lua = new Lua()) + { + TestClass t1 = new TestClass(); + t1.testval = 4; + lua["netobj"] = t1; + object o = lua["netobj"]; + Assert.AreEqual(true, o is TestClass); + TestClass t2 = (TestClass)lua["netobj"]; + Assert.AreEqual(t2.testval, 4); + Assert.AreEqual(t1, t2); + } + } + ///* + // * Tests if CLR object is being correctly collected by Lua + // */ + //[Test] + //public void GarbageCollection() + //{ + // using (Lua lua = new Lua()) + // { + // TestClass t1 = new TestClass(); + // t1.testval = 4; + // lua["netobj"] = t1; + // TestClass t2 = (TestClass)lua["netobj"]; + // Assert.True(lua[0] != null); + // lua.DoString("netobj=nil;collectgarbage();"); + // Assert.True(lua.translator.objects[0] == null); + // } + //} + /* + * Tests setting of a table field to a CLR object value + */ + [Test] + public void SetTableObjectField1() + { + using (Lua lua = new Lua()) + { + lua.DoString("a={b={c=\"test\"}}"); + LuaTable tab = lua.GetTable("a.b"); + TestClass t1 = new TestClass(); + t1.testval = 4; + tab["c"] = t1; + TestClass t2 = (TestClass)lua["a.b.c"]; + //Console.WriteLine("a.b.c="+t2.testval); + Assert.AreEqual(4, t2.testval); + Assert.AreEqual(t1, t2); + } + } + /* + * Tests reading and writing of an object's field + */ + [Test] + public void AccessObjectField() + { + using (Lua lua = new Lua()) + { + TestClass t1 = new TestClass(); + t1.val = 4; + lua["netobj"] = t1; + lua.DoString("var=netobj.val"); + double var = (double)lua["var"]; + //Console.WriteLine("value from Lua="+var); + Assert.AreEqual(4, var); + lua.DoString("netobj.val=3"); + Assert.AreEqual(3, t1.val); + //Console.WriteLine("new val (from Lua)="+t1.val); + } + } + /* + * Tests reading and writing of an object's non-indexed + * property + */ + [Test] + public void AccessObjectProperty() + { + using (Lua lua = new Lua()) + { + TestClass t1 = new TestClass(); + t1.testval = 4; + lua["netobj"] = t1; + lua.DoString("var=netobj.testval"); + double var = (double)lua["var"]; + //Console.WriteLine("value from Lua="+var); + Assert.AreEqual(4, var); + lua.DoString("netobj.testval=3"); + Assert.AreEqual(3, t1.testval); + //Console.WriteLine("new val (from Lua)="+t1.testval); + } + } + + [Test] + public void AccessObjectStringProperty() + { + using (Lua lua = new Lua()) + { + TestClass t1 = new TestClass(); + t1.teststrval = "This is a string test"; + lua["netobj"] = t1; + lua.DoString("var=netobj.teststrval"); + string var = (string)lua["var"]; + + Assert.AreEqual("This is a string test", var); + lua.DoString("netobj.teststrval='Another String'"); + Assert.AreEqual("Another String", t1.teststrval); + //Console.WriteLine("new val (from Lua)="+t1.testval); + } + } + /* + * Tests calling of an object's method with no overloads + */ + [Test] + public void CallObjectMethod() + { + using (Lua lua = new Lua()) + { + TestClass t1 = new TestClass(); + t1.testval = 4; + lua["netobj"] = t1; + lua.DoString("netobj:setVal(3)"); + Assert.AreEqual(3, t1.testval); + //Console.WriteLine("new val(from C#)="+t1.testval); + lua.DoString("val=netobj:getVal()"); + int val = (int)lua.GetNumber("val"); + Assert.AreEqual(3, val); + //Console.WriteLine("new val(from Lua)="+val); + } + } + /* + * Tests calling of an object's method with overloading + */ + [Test] + public void CallObjectMethodByType() + { + using (Lua lua = new Lua()) + { + TestClass t1 = new TestClass(); + lua["netobj"] = t1; + lua.DoString("netobj:setVal('str')"); + Assert.AreEqual("str", t1.getStrVal()); + //Console.WriteLine("new val(from C#)="+t1.getStrVal()); + } + } + /* + * Tests calling of an object's method with no overloading + * and out parameters + */ + [Test] + public void CallObjectMethodOutParam() + { + using (Lua lua = new Lua()) + { + TestClass t1 = new TestClass(); + lua["netobj"] = t1; + lua.DoString("a,b=netobj:outVal()"); + int a = (int)lua.GetNumber("a"); + int b = (int)lua.GetNumber("b"); + Assert.AreEqual(3, a); + Assert.AreEqual(5, b); + //Console.WriteLine("function returned (from lua)="+a+","+b); + } + } + /* + * Tests calling of an object's method with overloading and + * out params + */ + [Test] + public void CallObjectMethodOverloadedOutParam() + { + using (Lua lua = new Lua()) + { + TestClass t1 = new TestClass(); + lua["netobj"] = t1; + lua.DoString("a,b=netobj:outVal(2)"); + int a = (int)lua.GetNumber("a"); + int b = (int)lua.GetNumber("b"); + Assert.AreEqual(2, a); + Assert.AreEqual(5, b); + //Console.WriteLine("function returned (from lua)="+a+","+b); + } + } + /* + * Tests calling of an object's method with ref params + */ + [Test] + public void CallObjectMethodByRefParam() + { + using (Lua lua = new Lua()) + { + TestClass t1 = new TestClass(); + lua["netobj"] = t1; + lua.DoString("a,b=netobj:outVal(2,3)"); + int a = (int)lua.GetNumber("a"); + int b = (int)lua.GetNumber("b"); + Assert.AreEqual(2, a); + Assert.AreEqual(5, b); + //Console.WriteLine("function returned (from lua)="+a+","+b); + } + } + /* + * Tests calling of two versions of an object's method that have + * the same name and signature but implement different interfaces + */ + [Test] + public void CallObjectMethodDistinctInterfaces() + { + using (Lua lua = new Lua()) + { + TestClass t1 = new TestClass(); + lua["netobj"] = t1; + lua.DoString("a=netobj:foo()"); + lua.DoString("b=netobj['NLuaTest.Mock.IFoo1.foo']"); + int a = (int)lua.GetNumber("a"); + int b = (int)lua.GetNumber("b"); + Assert.AreEqual(5, a); + Assert.AreEqual(1, b); + //Console.WriteLine("function returned (from lua)="+a+","+b); + } + } + /* + * Tests instantiating an object with no-argument constructor + */ + [Test] + public void CreateNetObjectNoArgsCons() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly(\"NLuaTest\")"); + lua.DoString("TestClass=luanet.import_type(\"NLuaTest.Mock.TestClass\")"); + lua.DoString("test=TestClass()"); + lua.DoString("test:setVal(3)"); + object[] res = lua.DoString("return test"); + TestClass test = (TestClass)res[0]; + //Console.WriteLine("returned: "+test.testval); + Assert.AreEqual(3, test.testval); + } + } + /* + * Tests instantiating an object with one-argument constructor + */ + [Test] + public void CreateNetObjectOneArgCons() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly(\"NLuaTest\")"); + lua.DoString("TestClass=luanet.import_type(\"NLuaTest.Mock.TestClass\")"); + lua.DoString("test=TestClass(3)"); + object[] res = lua.DoString("return test"); + TestClass test = (TestClass)res[0]; + //Console.WriteLine("returned: "+test.testval); + Assert.AreEqual(3, test.testval); + } + } + /* + * Tests instantiating an object with overloaded constructor + */ + [Test] + public void CreateNetObjectOverloadedCons() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly(\"NLuaTest\")"); + lua.DoString("TestClass=luanet.import_type(\"NLuaTest.Mock.TestClass\")"); + lua.DoString("test=TestClass('str')"); + object[] res = lua.DoString("return test"); + TestClass test = (TestClass)res[0]; + //Console.WriteLine("returned: "+test.getStrVal()); + Assert.AreEqual("str", test.getStrVal()); + } + } + /* + * Tests getting item of a CLR array + */ + [Test] + public void ReadArrayField() + { + using (Lua lua = new Lua()) + { + string[] arr = new string[] { "str1", "str2", "str3" }; + lua["netobj"] = arr; + lua.DoString("val=netobj[1]"); + string val = lua.GetString("val"); + Assert.AreEqual("str2", val); + //Console.WriteLine("new val(from array to Lua)="+val); + } + } + /*G + * Tests setting item of a CLR array + */ + [Test] + public void WriteArrayField() + { + using (Lua lua = new Lua()) + { + string[] arr = new string[] { "str1", "str2", "str3" }; + lua["netobj"] = arr; + lua.DoString("netobj[1]='test'"); + Assert.AreEqual("test", arr[1]); + //Console.WriteLine("new val(from Lua to array)="+arr[1]); + } + } + /* + * Tests creating a new CLR array + */ + [Test] + public void CreateArray() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly(\"NLuaTest\")"); + lua.DoString("TestClass=luanet.import_type(\"NLuaTest.Mock.TestClass\")"); + lua.DoString("arr=TestClass[3]"); + lua.DoString("for i=0,2 do arr[i]=TestClass(i+1) end"); + TestClass[] arr = (TestClass[])lua["arr"]; + Assert.AreEqual(arr[1].testval, 2); + } + } + /* + * Tests passing a Lua function to a delegate + * with value-type arguments + */ + [Test] + public void LuaDelegateValueTypes() + { + using (Lua lua = new Lua()) + { + lua.RegisterLuaDelegateType(typeof(TestDelegate1), typeof(LuaTestDelegate1Handler)); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("function func(x,y) return x+y; end"); + lua.DoString("test=TestClass()"); + lua.DoString("a=test:callDelegate1(func)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(5, a); + //Console.WriteLine("delegate returned: "+a); + } + } + /* + * Tests passing a Lua function to a delegate + * with value-type arguments and out params + */ + [Test] + public void LuaDelegateValueTypesOutParam() + { + using (Lua lua = new Lua()) + { + lua.RegisterLuaDelegateType(typeof(TestDelegate2), typeof(LuaTestDelegate2Handler)); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("function func(x) return x,x*2; end"); + lua.DoString("test=TestClass()"); + lua.DoString("a=test:callDelegate2(func)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(6, a); + //Console.WriteLine("delegate returned: "+a); + } + } + /* + * Tests passing a Lua function to a delegate + * with value-type arguments and ref params + */ + [Test] + public void LuaDelegateValueTypesByRefParam() + { + using (Lua lua = new Lua()) + { + lua.RegisterLuaDelegateType(typeof(TestDelegate3), typeof(LuaTestDelegate3Handler)); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("function func(x,y) return x+y; end"); + lua.DoString("test=TestClass()"); + lua.DoString("a=test:callDelegate3(func)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(5, a); + //Console.WriteLine("delegate returned: "+a); + } + } + /* + * Tests passing a Lua function to a delegate + * with value-type arguments that returns a reference type + */ + [Test] + public void LuaDelegateValueTypesReturnReferenceType() + { + using (Lua lua = new Lua()) + { + lua.RegisterLuaDelegateType(typeof(TestDelegate4), typeof(LuaTestDelegate4Handler)); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("function func(x,y) return TestClass(x+y); end"); + lua.DoString("test=TestClass()"); + lua.DoString("a=test:callDelegate4(func)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(5, a); + //Console.WriteLine("delegate returned: "+a); + } + } + /* + * Tests passing a Lua function to a delegate + * with reference type arguments + */ + [Test] + public void LuaDelegateReferenceTypes() + { + using (Lua lua = new Lua()) + { + lua.RegisterLuaDelegateType(typeof(TestDelegate5), typeof(LuaTestDelegate5Handler)); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("function func(x,y) return x.testval+y.testval; end"); + lua.DoString("a=test:callDelegate5(func)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(5, a); + //Console.WriteLine("delegate returned: "+a); + } + } + /* + * Tests passing a Lua function to a delegate + * with reference type arguments and an out param + */ + [Test] + public void LuaDelegateReferenceTypesOutParam() + { + using (Lua lua = new Lua()) + { + lua.RegisterLuaDelegateType(typeof(TestDelegate6), typeof(LuaTestDelegate6Handler)); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("function func(x) return x,TestClass(x*2); end"); + lua.DoString("test=TestClass()"); + lua.DoString("a=test:callDelegate6(func)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(6, a); + //Console.WriteLine("delegate returned: "+a); + } + } + /* + * Tests passing a Lua function to a delegate + * with reference type arguments and a ref param + */ + [Test] + public void LuaDelegateReferenceTypesByRefParam() + { + using (Lua lua = new Lua()) + { + lua.RegisterLuaDelegateType(typeof(TestDelegate7), typeof(LuaTestDelegate7Handler)); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("function func(x,y) return TestClass(x+y.testval); end"); + lua.DoString("a=test:callDelegate7(func)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(5, a); + //Console.WriteLine("delegate returned: "+a); + } + } + + + /* + * Tests passing a Lua table as an interface and + * calling one of its methods with value-type params + */ + [Test] + public void NLuaAAValueTypes() + { + using (Lua lua = new Lua()) + { + lua.RegisterLuaClassType(typeof(ITest), typeof(LuaITestClassHandler)); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("itest={}"); + lua.DoString("function itest:test1(x,y) return x+y; end"); + lua.DoString("test=TestClass()"); + lua.DoString("a=test:callInterface1(itest)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(5, a); + //Console.WriteLine("interface returned: "+a); + } + } + /* + * Tests passing a Lua table as an interface and + * calling one of its methods with value-type params + * and an out param + */ + [Test] + public void NLuaValueTypesOutParam() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("itest={}"); + lua.DoString("function itest:test2(x) return x,x*2; end"); + lua.DoString("test=TestClass()"); + lua.DoString("a=test:callInterface2(itest)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(6, a); + //Console.WriteLine("interface returned: "+a); + } + } + /* + * Tests passing a Lua table as an interface and + * calling one of its methods with value-type params + * and a ref param + */ + [Test] + public void NLuaValueTypesByRefParam() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("itest={}"); + lua.DoString("function itest:test3(x,y) return x+y; end"); + lua.DoString("test=TestClass()"); + lua.DoString("a=test:callInterface3(itest)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(5, a); + //Console.WriteLine("interface returned: "+a); + } + } + /* + * Tests passing a Lua table as an interface and + * calling one of its methods with value-type params + * returning a reference type param + */ + [Test] + public void NLuaValueTypesReturnReferenceType() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("itest={}"); + lua.DoString("function itest:test4(x,y) return TestClass(x+y); end"); + lua.DoString("test=TestClass()"); + lua.DoString("a=test:callInterface4(itest)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(5, a); + //Console.WriteLine("interface returned: "+a); + } + } + /* + * Tests passing a Lua table as an interface and + * calling one of its methods with reference type params + */ + [Test] + public void NLuaReferenceTypes() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("itest={}"); + lua.DoString("function itest:test5(x,y) return x.testval+y.testval; end"); + lua.DoString("test=TestClass()"); + lua.DoString("a=test:callInterface5(itest)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(5, a); + //Console.WriteLine("interface returned: "+a); + } + } + /* + * Tests passing a Lua table as an interface and + * calling one of its methods with reference type params + * and an out param + */ + [Test] + public void NLuaReferenceTypesOutParam() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("itest={}"); + lua.DoString("function itest:test6(x) return x,TestClass(x*2); end"); + lua.DoString("test=TestClass()"); + lua.DoString("a=test:callInterface6(itest)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(6, a); + //Console.WriteLine("interface returned: "+a); + } + } + /* + * Tests passing a Lua table as an interface and + * calling one of its methods with reference type params + * and a ref param + */ + [Test] + public void NLuaReferenceTypesByRefParam() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("itest={}"); + lua.DoString("function itest:test7(x,y) return TestClass(x+y.testval); end"); + lua.DoString("a=test:callInterface7(itest)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(5, a); + //Console.WriteLine("interface returned: "+a); + } + } + + + #region LUA_BOILERPLATE_CLASS + /*** This class is used to bind the .NET world with the Lua world, this boilerplate code is pratically the same, get values call Lua function return value back, + * this class is usually dynamic generated using System.Reflection.Emit, but this will not work on iOS. */ + + class LuaTestClassHandler : TestClass, ILuaGeneratedType + { + public LuaTable __luaInterface_luaTable; + public Type[][] __luaInterface_returnTypes; + + public LuaTestClassHandler(LuaTable luaTable, Type[][] returnTypes) + { + __luaInterface_luaTable = luaTable; + __luaInterface_returnTypes = returnTypes; + } + + public LuaTable LuaInterfaceGetLuaTable() + { + return __luaInterface_luaTable; + } + + public override int overridableMethod(int x, int y) + { + object[] args = new object[] { + __luaInterface_luaTable, + x, + y + }; + object[] inArgs = new object[] { + __luaInterface_luaTable, + x, + y + }; + int[] outArgs = new int[] { }; + Type[] returnTypes = __luaInterface_returnTypes[0]; + LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction(__luaInterface_luaTable, "overridableMethod"); + object ret = NLua.Method.LuaClassHelper.CallFunction(function, args, returnTypes, inArgs, outArgs); + return (int)ret; + } + } + + class LuaITestClassHandler : ILuaGeneratedType, ITest + { + public LuaTable __luaInterface_luaTable; + public Type[][] __luaInterface_returnTypes; + + public LuaITestClassHandler(LuaTable luaTable, Type[][] returnTypes) + { + __luaInterface_luaTable = luaTable; + __luaInterface_returnTypes = returnTypes; + } + + public LuaTable LuaInterfaceGetLuaTable() + { + return __luaInterface_luaTable; + } + + public int intProp + { + get + { + object[] args = new object[] { __luaInterface_luaTable }; + object[] inArgs = new object[] { __luaInterface_luaTable }; + int[] outArgs = new int[] { }; + Type[] returnTypes = __luaInterface_returnTypes[0]; + LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction(__luaInterface_luaTable, "get_intProp"); + object ret = NLua.Method.LuaClassHelper.CallFunction(function, args, returnTypes, inArgs, outArgs); + return (int)ret; + } + set + { + int i = value; + object[] args = new object[] { + __luaInterface_luaTable , + i + }; + object[] inArgs = new object[] { + __luaInterface_luaTable, + i + }; + int[] outArgs = new int[] { }; + Type[] returnTypes = __luaInterface_returnTypes[1]; + LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction(__luaInterface_luaTable, "set_intProp"); + NLua.Method.LuaClassHelper.CallFunction(function, args, returnTypes, inArgs, outArgs); + } + } + + public TestClass refProp + { + get + { + object[] args = new object[] { __luaInterface_luaTable }; + object[] inArgs = new object[] { __luaInterface_luaTable }; + int[] outArgs = new int[] { }; + Type[] returnTypes = __luaInterface_returnTypes[2]; + LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction(__luaInterface_luaTable, "get_refProp"); + object ret = NLua.Method.LuaClassHelper.CallFunction(function, args, returnTypes, inArgs, outArgs); + return (TestClass)ret; + } + set + { + TestClass test = value; + object[] args = new object[] { + __luaInterface_luaTable , + test + }; + object[] inArgs = new object[] { + __luaInterface_luaTable, + test + }; + int[] outArgs = new int[] { }; + Type[] returnTypes = __luaInterface_returnTypes[3]; + LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction(__luaInterface_luaTable, "set_refProp"); + NLua.Method.LuaClassHelper.CallFunction(function, args, returnTypes, inArgs, outArgs); + } + } + + public int test1(int a, int b) + { + object[] args = new object[] { + __luaInterface_luaTable, + a, + b + }; + object[] inArgs = new object[] { + __luaInterface_luaTable, + a, + b + }; + int[] outArgs = new int[] { }; + Type[] returnTypes = __luaInterface_returnTypes[4]; + LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction(__luaInterface_luaTable, "test1"); + object ret = NLua.Method.LuaClassHelper.CallFunction(function, args, returnTypes, inArgs, outArgs); + return (int)ret; + } + + public int test2(int a, out int b) + { + object[] args = new object[] { + __luaInterface_luaTable, + a, + 0 + }; + object[] inArgs = new object[] { + __luaInterface_luaTable, + a + }; + int[] outArgs = new int[] { 1 }; + Type[] returnTypes = __luaInterface_returnTypes[5]; + LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction(__luaInterface_luaTable, "test2"); + object ret = NLua.Method.LuaClassHelper.CallFunction(function, args, returnTypes, inArgs, outArgs); + b = (int)args[1]; + return (int)ret; + } + + public void test3(int a, ref int b) + { + object[] args = new object[] { + __luaInterface_luaTable, + a, + b + }; + object[] inArgs = new object[] { + __luaInterface_luaTable, + a, + b + }; + int[] outArgs = new int[] { 1 }; + Type[] returnTypes = __luaInterface_returnTypes[6]; + LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction(__luaInterface_luaTable, "test3"); + NLua.Method.LuaClassHelper.CallFunction(function, args, returnTypes, inArgs, outArgs); + b = (int)args[1]; + } + + public TestClass test4(int a, int b) + { + object[] args = new object[] { + __luaInterface_luaTable, + a, + b + }; + object[] inArgs = new object[] { + __luaInterface_luaTable, + a, + b + }; + int[] outArgs = new int[] { }; + Type[] returnTypes = __luaInterface_returnTypes[7]; + LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction(__luaInterface_luaTable, "test4"); + object ret = NLua.Method.LuaClassHelper.CallFunction(function, args, returnTypes, inArgs, outArgs); + return (TestClass)ret; + } + + public int test5(TestClass a, TestClass b) + { + object[] args = new object[] { + __luaInterface_luaTable, + a, + b + }; + object[] inArgs = new object[] { + __luaInterface_luaTable, + a, + b + }; + int[] outArgs = new int[] { }; + Type[] returnTypes = __luaInterface_returnTypes[8]; + LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction(__luaInterface_luaTable, "test5"); + object ret = NLua.Method.LuaClassHelper.CallFunction(function, args, returnTypes, inArgs, outArgs); + return (int)ret; + } + + public int test6(int a, out TestClass b) + { + object[] args = new object[] { + __luaInterface_luaTable, + a, + null + }; + object[] inArgs = new object[] { + __luaInterface_luaTable, + a, + }; + int[] outArgs = new int[] { 1 }; + Type[] returnTypes = __luaInterface_returnTypes[9]; + LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction(__luaInterface_luaTable, "test6"); + object ret = NLua.Method.LuaClassHelper.CallFunction(function, args, returnTypes, inArgs, outArgs); + b = (TestClass)args[1]; + + return (int)ret; + } + + public void test7(int a, ref TestClass b) + { + object[] args = new object[] { + __luaInterface_luaTable, + a, + b + }; + object[] inArgs = new object[] { + __luaInterface_luaTable, + a, + b + }; + int[] outArgs = new int[] { 1 }; + Type[] returnTypes = __luaInterface_returnTypes[10]; + LuaFunction function = NLua.Method.LuaClassHelper.GetTableFunction(__luaInterface_luaTable, "test7"); + NLua.Method.LuaClassHelper.CallFunction(function, args, returnTypes, inArgs, outArgs); + b = (TestClass)args[1]; + } + } + #endregion + + /* + * Tests passing a Lua table as an interface and + * accessing one of its value-type properties + */ + [Test] + public void NLuaValueProperty() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("itest={}"); + lua.DoString("function itest:get_intProp() return itest.int_prop; end"); + lua.DoString("function itest:set_intProp(val) itest.int_prop=val; end"); + lua.DoString("a=test:callInterface8(itest)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(3, a); + //Console.WriteLine("interface returned: "+a); + } + } + /* + * Tests passing a Lua table as an interface and + * accessing one of its reference type properties + */ + [Test] + public void NLuaReferenceProperty() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("itest={}"); + lua.DoString("function itest:get_refProp() return TestClass(itest.int_prop); end"); + lua.DoString("function itest:set_refProp(val) itest.int_prop=val.testval; end"); + lua.DoString("a=test:callInterface9(itest)"); + int a = (int)lua.GetNumber("a"); + Assert.AreEqual(3, a); + //Console.WriteLine("interface returned: "+a); + } + } + + + /* + * Tests making an object from a Lua table and calling the base + * class version of one of the methods the table overrides. + */ + [Test] + public void LuaTableBaseMethod() + { + using (Lua lua = new Lua()) + { + lua.RegisterLuaClassType(typeof(TestClass), typeof(LuaTestClassHandler)); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test={}"); + lua.DoString("function test:overridableMethod(x,y) print(self[base]); return 6 end"); + lua.DoString("luanet.make_object(test,'NLuaTest.Mock.TestClass')"); + lua.DoString("a=TestClass.callOverridable(test,2,3)"); + int a = (int)lua.GetNumber("a"); + lua.DoString("luanet.free_object(test)"); + Assert.AreEqual(6, a); + // lua.DoString("luanet.load_assembly('NLuaTest')"); + // lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + // lua.DoString("test={}"); + // + // lua.DoString("luanet.make_object(test,'NLuaTest.Mock.TestClass')"); + // lua.DoString ("function test.overridableMethod(test,x,y) return 2*test.base.overridableMethod(test,x,y); end"); + // lua.DoString("a=TestClass.callOverridable(test,2,3)"); + // int a = (int)lua.GetNumber("a"); + // lua.DoString("luanet.free_object(test)"); + // Assert.AreEqual(10, a); + //Console.WriteLine("interface returned: "+a); + } + } + /* + * Tests getting an object's method by its signature + * (from object) + */ + [Test] + public void GetMethodBySignatureFromObj() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('mscorlib')"); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("setMethod=luanet.get_method_bysig(test,'setVal','System.String')"); + lua.DoString("setMethod('test')"); + TestClass test = (TestClass)lua["test"]; + Assert.AreEqual("test", test.getStrVal()); + //Console.WriteLine("interface returned: "+test.getStrVal()); + } + } + /* + * Tests getting an object's method by its signature + * (from type) + */ + [Test] + public void GetMethodBySignatureFromType() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('mscorlib')"); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("setMethod=luanet.get_method_bysig(TestClass,'setVal','System.String')"); + lua.DoString("setMethod(test,'test')"); + TestClass test = (TestClass)lua["test"]; + Assert.AreEqual("test", test.getStrVal()); + //Console.WriteLine("interface returned: "+test.getStrVal()); + } + } + /* + * Tests getting a type's method by its signature + */ + [Test] + public void GetStaticMethodBySignature() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('mscorlib')"); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("make_method=luanet.get_method_bysig(TestClass,'makeFromString','System.String')"); + lua.DoString("test=make_method('test')"); + TestClass test = (TestClass)lua["test"]; + Assert.AreEqual("test", test.getStrVal()); + //Console.WriteLine("interface returned: "+test.getStrVal()); + } + } + /* + * Tests getting an object's constructor by its signature + */ + [Test] + public void GetConstructorBySignature() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('mscorlib')"); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test_cons=luanet.get_constructor_bysig(TestClass,'System.String')"); + lua.DoString("test=test_cons('test')"); + TestClass test = (TestClass)lua["test"]; + Assert.AreEqual("test", test.getStrVal()); + //Console.WriteLine("interface returned: "+test.getStrVal()); + } + } + + [Test] + public void TestVarargs() + { + using (Lua lua = new Lua()) + { + lua.DoString("luanet.load_assembly('mscorlib')"); + lua.DoString("luanet.load_assembly('NLuaTest')"); + lua.DoString("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')"); + lua.DoString("test=TestClass()"); + lua.DoString("test:Print('this will pass')"); + lua.DoString("test:Print('this will ','fail')"); + } + } + + [Test] + public void TestCtype() + { + using (Lua lua = new Lua()) + { + lua.LoadCLRPackage(); + lua.DoString("import'System'"); + var x = lua.DoString("return luanet.ctype(String)")[0]; + Assert.AreEqual(x, typeof(String), "#1 String ctype test"); + } + } + + [Test] + public void TestPrintChars() + { + using (Lua lua = new Lua()) + { + lua.DoString(@"print(""waüäq?=()[&]ß"")"); + Assert.IsTrue(true); + } + } + + [Test] + public void TestUnicodeChars() + { + using (Lua lua = new Lua()) + { + lua.State.Encoding = Encoding.UTF8; + + lua.LoadCLRPackage(); + lua.DoString("import('NLuaTest')"); + lua.DoString("res = LuaTests.UnicodeString"); + string res = (string)lua["res"]; + + Assert.AreEqual(LuaTests.UnicodeString, res); + } + } + + [Test] + public void TestUnicodeCharsInDoString() + { + using (Lua lua = new Lua()) + { + lua.State.Encoding = Encoding.UTF8; + + lua.DoString("res = 'Файл'"); + string res = (string)lua["res"]; + + Assert.AreEqual(LuaTests.UnicodeStringRussian, res); + } + } + + [Test] + public void TestCoroutine() + { + using (Lua lua = new Lua()) + { + lua.LoadCLRPackage(); + lua.RegisterFunction("func1", null, typeof(TestClass2).GetMethod("func")); + lua.DoString(@"function yielder() + a=1; + coroutine.yield(); + func1(3,2); + coroutine.yield(); + a=2; + coroutine.yield(); + end + co_routine = coroutine.create(yielder); + while coroutine.resume(co_routine) do end;"); + + double num = lua.GetNumber("a"); + Assert.AreEqual(num, 2d); + } + } + + [Test] + public void TestDebugHook() + { + int[] lines = { 1, 2, 1, 3 }; + int line = 0; + + using (var lua = new Lua()) + { + lua.DebugHook += (sender, args) => + { + Assert.AreEqual(args.LuaDebug.CurrentLine, lines[line]); + line++; + }; + lua.SetDebugHook(KeraLua.LuaHookMask.Line, 0); + + lua.DoString(@"function testing_hooks() return 10 end + val = testing_hooks() + val = val + 1"); + } + } + + [Test] + public void TestKeyWithDots() + { + using (Lua lua = new Lua()) + { + lua.DoString(@"g_dot = {} + g_dot['key.with.dot'] = 42"); + + Assert.AreEqual(42, (int)(double)lua["g_dot.key\\.with\\.dot"]); + } + } +#if !WINDOWS_PHONE && !NET_3_5 + [Test] + public void TestOperatorAdd() + { + using (Lua lua = new Lua()) + { + var a = new System.Numerics.Complex(10, 0); + var b = new System.Numerics.Complex(0, 3); + var x = a + b; + + lua["a"] = a; + lua["b"] = b; + var res = lua.DoString(@"return a + b")[0]; + Assert.AreEqual(x, res); + } + } + + [Test] + public void TestOperatorMinus() + { + using (Lua lua = new Lua()) + { + var a = new System.Numerics.Complex(10, 0); + var b = new System.Numerics.Complex(0, 3); + var x = a - b; + + lua["a"] = a; + lua["b"] = b; + var res = lua.DoString(@"return a - b")[0]; + Assert.AreEqual(x, res); + } + } + + [Test] + public void TestOperatorMultiply() + { + using (Lua lua = new Lua()) + { + var a = new System.Numerics.Complex(10, 0); + var b = new System.Numerics.Complex(0, 3); + var x = a * b; + + lua["a"] = a; + lua["b"] = b; + var res = lua.DoString(@"return a * b")[0]; + Assert.AreEqual(x, res); + } + } + + [Test] + public void TestOperatorEqual() + { + using (Lua lua = new Lua()) + { + var a = new System.Numerics.Complex(10, 0); + var b = new System.Numerics.Complex(0, 3); + var x = a == b; + + lua["a"] = a; + lua["b"] = b; + var res = lua.DoString(@"return a == b")[0]; + Assert.AreEqual(x, res); + } + } + + [Test] + public void TestOperatorNotEqual() + { + using (Lua lua = new Lua()) + { + var a = new System.Numerics.Complex(10, 0); + var b = new System.Numerics.Complex(0, 3); + var x = a != b; + + lua["a"] = a; + lua["b"] = b; + var res = lua.DoString(@"return a ~= b")[0]; + Assert.AreEqual(x, res); + } + } + + [Test] + public void TestUnaryMinus() + { + using (Lua lua = new Lua()) + { + + lua.LoadCLRPackage(); + lua.DoString(@" import ('System.Numerics') + c = Complex (10, 5) + c = -c "); + + var expected = new System.Numerics.Complex(-10, -5); + + var res = lua["c"]; + Assert.AreEqual(expected, res); + } + } +#endif + [Test] + public void TestCaseFields() + { + using (Lua lua = new Lua()) + { + lua.LoadCLRPackage(); + + lua.DoString(@" import ('NLuaTest') + x = TestCaseName() + name = x.name; + name2 = x.Name; + Name = x.Name; + Name2 = x.name"); + + Assert.AreEqual("name", lua["name"]); + Assert.AreEqual("**name**", lua["name2"]); + Assert.AreEqual("**name**", lua["Name"]); + Assert.AreEqual("name", lua["Name2"]); + } + } + + [Test] + public void TestStaticOperators() + { + using (Lua lua = new Lua()) + { + lua.LoadCLRPackage(); + + lua.DoString(@" import ('NLuaTest') + v = Vector() + v.x = 10 + v.y = 3 + v = v*2 "); + + var v = (Vector)lua["v"]; + + Assert.AreEqual(20, v.x, "#1"); + Assert.AreEqual(6, v.y, "#2"); + + lua.DoString(@" x = 2 * v"); + var x = (Vector)lua["x"]; + + Assert.AreEqual(40, x.x, "#3"); + Assert.AreEqual(12, x.y, "#4"); + } + } + + [Test] + public void TestExtensionMethods() + { + using (Lua lua = new Lua()) + { + lua.LoadCLRPackage(); + + lua.DoString(@" import ('NLuaTest') + v = Vector() + v.x = 10 + v.y = 3 + v = v*2 "); + + var v = (Vector)lua["v"]; + + double len = v.Length(); + lua.DoString(" v:Length() "); + lua.DoString(@" len2 = v:Length()"); + double len2 = (double)lua["len2"]; + Assert.AreEqual(len, len2, "#1"); + } + } + + [Test] + public void TestBaseClassExtensionMethods() + { + using (Lua lua = new Lua()) + { + lua.LoadCLRPackage(); + + lua.DoString(@" import ('NLuaTest') + p = Employee() + p.firstName = 'Paulo' + p.occupation = 'Programmer'"); + + var p = (Person)lua["p"]; + + string name = p.GetFirstName(); + lua.DoString(" p:GetFirstName() "); + lua.DoString(@" name2 = p:GetFirstName()"); + string name2 = (string)lua["name2"]; + Assert.AreEqual(name, name2, "#1"); + } + } + + [Test] + public void TestOverloadedMethods() + { + using (Lua lua = new Lua()) + { + var obj = new TestClassWithOverloadedMethod(); + lua["obj"] = obj; + lua.DoString(@" + obj:Func (10) + obj:Func ('10') + obj:Func (10) + obj:Func ('10') + obj:Func (10) + "); + Assert.AreEqual(3, obj.CallsToIntFunc, "#integer"); + Assert.AreEqual(2, obj.CallsToStringFunc, "#string"); + } + } + + [Test] + public void TestGetStack() + { + using (Lua lua = new Lua()) + { + lua.LoadCLRPackage(); + m_lua = lua; + lua.DoString(@" + import ('NLuaTest') + function f1 () + f2 () + end + + function f2() + f3() + end + + function f3() + LuaTests.func() + end + + f1 () + "); + } + m_lua = null; + } + + public static void func() + { + + //string expected = "[0] func:-1 -- [func]\n[1] f3:12 -- [f3]\n[2] f2:8 -- [f2]\n[3] f1:4 -- [f1]\n[4] :15 -- []\n"; + var info = new KeraLua.LuaDebug(); + + int level = 0; + var sb = new StringBuilder(); + while (m_lua.GetStack(level, ref info) != 0) + { + m_lua.GetInfo("nSl", ref info); + string name = ""; + if (!string.IsNullOrEmpty(info.Name)) + name = info.Name; + + sb.AppendFormat("[{0}] {1}:{2} -- {3} [{4}]\n", + level, info.ShortSource, info.CurrentLine, + name, info.NameWhat); + ++level; + } + string x = sb.ToString(); + Assert.True(!string.IsNullOrEmpty(x)); + } + + [Test] + public void TestCallImplicitBaseMethod() + { + using (var l = new Lua()) + { + l.LoadCLRPackage(); + l.DoString("import ('NLuaTest')"); + l.DoString("res = testClass.read() "); + string res = (string)l["res"]; + Assert.AreEqual(testClass.read(), res); + } + } + + [Test] + public void TestPushLuaFunctionWhenReadingDelegateProperty() + { + bool called = false; + var _model = new DefaultElementModel(); + _model.DrawMe = (x) => + { + called = true; + }; + using (var l = new Lua()) + { + l["model"] = _model; + l.DoString(@" model.DrawMe (0) "); + } + + Assert.True(called); + } + + [Test] + public void TestCallDelegateWithParameters() + { + string sval = ""; + int nval = 0; + using (var l = new Lua()) + { + Action c = (s, n) => { sval = s; nval = n; }; + l["d"] = c; + l.DoString(" d ('string', 10) "); + } + + Assert.AreEqual("string", sval, "#1"); + Assert.AreEqual(10, nval, "#2"); + } + + [Test] + public void TestCallSimpleDelegate() + { + bool called = false; + using (var l = new Lua()) + { + Action c = () => { called = true; }; + l["d"] = c; + l.DoString(" d () "); + } + + Assert.True(called); + } + + [Test] + public void TestCallDelegateWithWrongParametersShouldFail() + { + bool fail = false; + using (var l = new Lua()) + { + Action c = () => { fail = false; }; + l["d"] = c; + try + { + l.DoString(" d (10) "); + } + catch (LuaScriptException) + { + fail = true; + } + } + + Assert.True(fail); + } + + [Test] + public void TestOverloadedMethodCallOnBase() + { + using (var l = new Lua()) + { + l.LoadCLRPackage(); + l.DoString(" import ('NLuaTest') "); + l.DoString(@" + p=parameter() + r1 = testClass.read(p) -- is not working. it is also not working if the method in base class has two parameters instead of one + r2 = testClass.read(1) -- is working + "); + string r1 = (string)l["r1"]; + string r2 = (string)l["r2"]; + Assert.AreEqual("parameter-field1", r1, "#1"); + Assert.AreEqual("int-test", r2, "#2"); + } + } + + [Test] + public void TestCallMethodWithParams2() + { + using (var l = new Lua()) + { + l.LoadCLRPackage(); + l.DoString(" import ('NLuaTest','NLuaTest.Mock') "); + l.DoString(@" + r = TestClass.MethodWithParams(2) + "); + int r = (int)l.GetNumber("r"); + Assert.AreEqual(0, r, "#1"); + } + } + + [Test] + public void TestCallMethodWithParamsOptional() + { + using (var l = new Lua()) + { + l.LoadCLRPackage(); + l.DoString(" import ('NLuaTest','NLuaTest.Mock') "); + l.DoString(@" + r = TestClass.MethodWithParams(2, 7, 4) + "); + int r = (int)l.GetNumber("r"); + Assert.AreEqual(2, r, "#1"); + } + } + + [Test] + public void TestCallMethodWithObjectParams() + { + using (var l = new Lua()) + { + l.LoadCLRPackage(); + l.DoString(" import ('NLuaTest','NLuaTest.Mock') "); + l.DoString(@" + r = TestClass.MethodWithObjectParams(2, nil, 4, 'abc') + "); + int r = (int)l.GetNumber("r"); + Assert.AreEqual(4, r, "#1"); + } + } + + [Test] + public void TestCallMethodWithObjectParamsAndNilAsFirstArgument() + { + using (var l = new Lua()) + { + l.LoadCLRPackage(); + l.DoString(" import ('NLuaTest','NLuaTest.Mock') "); + l.DoString(@" + r = TestClass.MethodWithObjectParams(nil, 4, 'abc') + "); + int r = (int)l.GetNumber("r"); + Assert.AreEqual(3, r, "#1"); + } + } + + [Test] + public void TestConstructorOverload() + { + using (var l = new Lua()) + { + l.LoadCLRPackage(); + l.DoString(" import ('NLuaTest','NLuaTest.Mock') "); + l.DoString(@" + e1 = Entity() + e2 = Entity ('str_param') + e3 = Entity (10) + p1 = e1.Property + p2 = e2.Property + p3 = e3.Property + "); + string p1 = l.GetString("p1"); + string p2 = l.GetString("p2"); + string p3 = l.GetString("p3"); + Assert.AreEqual("Default", p1, "#1"); + Assert.AreEqual("String", p2, "#1"); + Assert.AreEqual("Int", p3, "#1"); + } + } + + static Lua m_lua; + + } +} diff --git a/NLuaTest.WP8/Properties/AssemblyInfo.cs b/tests/src/Properties/AssemblyInfo.cs similarity index 65% rename from NLuaTest.WP8/Properties/AssemblyInfo.cs rename to tests/src/Properties/AssemblyInfo.cs index 844f96d2e696bc6c9a81d9336e91e4417864f85c..538579d7dcb03d7441cce7b294d7ca7a2f07544e 100644 --- a/NLuaTest.WP8/Properties/AssemblyInfo.cs +++ b/tests/src/Properties/AssemblyInfo.cs @@ -1,9 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +using System.Reflection; using System.Runtime.InteropServices; -using System.Resources; -// General Information about an assembly is controlled through the following +// 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("NLuaTest")] @@ -11,27 +9,29 @@ using System.Resources; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NLuaTest")] -[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyCopyright("Copyright © 2019")] [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 +// 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("ba95d268-0e19-4bbc-a735-8a00795084d2")] +[assembly: Guid("20ae709c-fb97-48e3-89b0-a34a5c3da1db")] // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Revision and Build Numbers +// 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.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: NeutralResourcesLanguageAttribute("en-US")] +// [assembly: AssemblyVersion("1.0.7.0")] +[assembly: AssemblyVersion("1.0.7.0")] +[assembly: AssemblyFileVersion("1.0.7.0")] + +[assembly: AssemblyInformationalVersion("1.0.7+Branch.master.Sha.80a328a64f12ed9032a0f14a75e6ecad967514d0")] diff --git a/tests/src/TestLua.cs b/tests/src/TestLua.cs new file mode 100644 index 0000000000000000000000000000000000000000..2fc0c89cc46013167a7e4be923387375ca3f7832 --- /dev/null +++ b/tests/src/TestLua.cs @@ -0,0 +1,660 @@ +using System; +using NLua; +using System.Threading; + +namespace NLuaTest.Mock +{ + /* + * Delegates used for testing Lua function -> delegate translation + */ + public delegate int TestDelegate1(int a, int b); + + public delegate int TestDelegate2(int a, out int b); + + public delegate void TestDelegate3(int a, ref int b); + + public delegate TestClass TestDelegate4(int a, int b); + + public delegate int TestDelegate5(TestClass a, TestClass b); + + public delegate int TestDelegate6(int a, out TestClass b); + + public delegate void TestDelegate7(int a, ref TestClass b); + + /* Delegate Lua-handlers */ + + class LuaTestDelegate1Handler : NLua.Method.LuaDelegate + { + int CallFunction(int a, int b) + { + object[] args = new object[] { a, b }; + object[] inArgs = new object[] { a, b }; + int[] outArgs = new int[] { }; + + object ret = base.CallFunction(args, inArgs, outArgs); + + return (int)ret; + } + } + + class LuaTestDelegate2Handler : NLua.Method.LuaDelegate + { + int CallFunction(int a, out int b) + { + object[] args = new object[] { a, 0 }; + object[] inArgs = new object[] { a }; + int[] outArgs = new int[] { 1 }; + + object ret = base.CallFunction(args, inArgs, outArgs); + + b = (int)args[1]; + return (int)ret; + } + } + + class LuaTestDelegate3Handler : NLua.Method.LuaDelegate + { + void CallFunction(int a, ref int b) + { + object[] args = new object[] { a, b }; + object[] inArgs = new object[] { a, b }; + int[] outArgs = new int[] { 1 }; + + base.CallFunction(args, inArgs, outArgs); + + b = (int)args[1]; + } + } + + class LuaTestDelegate4Handler : NLua.Method.LuaDelegate + { + TestClass CallFunction(int a, int b) + { + object[] args = new object[] { a, b }; + object[] inArgs = new object[] { a, b }; + int[] outArgs = new int[] { }; + + object ret = base.CallFunction(args, inArgs, outArgs); + + return (TestClass)ret; + } + } + + class LuaTestDelegate5Handler : NLua.Method.LuaDelegate + { + int CallFunction(TestClass a, TestClass b) + { + object[] args = new object[] { a, b }; + object[] inArgs = new object[] { a, b }; + int[] outArgs = new int[] { }; + + object ret = base.CallFunction(args, inArgs, outArgs); + + return (int)ret; + } + } + + class LuaTestDelegate6Handler : NLua.Method.LuaDelegate + { + int CallFunction(int a, ref TestClass b) + { + object[] args = new object[] { a, b }; + object[] inArgs = new object[] { a }; + int[] outArgs = new int[] { 1 }; + + object ret = base.CallFunction(args, inArgs, outArgs); + + b = (TestClass)args[1]; + return (int)ret; + } + } + + class LuaTestDelegate7Handler : NLua.Method.LuaDelegate + { + void CallFunction(int a, ref TestClass b) + { + object[] args = new object[] { a, b }; + object[] inArgs = new object[] { a, b }; + int[] outArgs = new int[] { 1 }; + + base.CallFunction(args, inArgs, outArgs); + + b = (TestClass)args[1]; + } + } + + + /* + * Interface used for testing Lua table -> interface translation + */ + public interface ITest + { + int intProp + { + get; + set; + } + + TestClass refProp + { + get; + set; + } + + int test1(int a, int b); + + int test2(int a, out int b); + + void test3(int a, ref int b); + + TestClass test4(int a, int b); + + int test5(TestClass a, TestClass b); + + int test6(int a, out TestClass b); + + void test7(int a, ref TestClass b); + } + + public interface IFoo1 + { + int foo(); + } + + public interface IFoo2 + { + int foo(); + } + + class MyClass + { + public int Func1() + { + return 1; + } + } + + /// + /// Use to test threading + /// + class DoWorkClass + { + + public void DoWork() + { + + //simulate work by sleeping + //Console.WriteLine("Started to do work on thread: " + Thread.CurrentThread.ManagedThreadId); + Thread.Sleep(new Random().Next(0, 1000)); + //Console.WriteLine("Finished work on thread: " + Thread.CurrentThread.ManagedThreadId); + } + } + + /// + /// test structure passing + /// + public struct TestStruct + { + public TestStruct(float val) + { + v = val; + } + + public float v; + + public float val + { + get { return v; } + set { v = value; } + } + } + + /// + /// test enum + /// + public enum TestEnum + { + ValueA, + ValueB + } + + /// + /// Generic class with generic and non-generic methods + /// + /// + public class TestClassGeneric + { + private object _PassedValue; + private bool _RegularMethodSuccess; + + public bool RegularMethodSuccess + { + get { return _RegularMethodSuccess; } + } + + private bool _GenericMethodSuccess; + + public bool GenericMethodSuccess + { + get { return _GenericMethodSuccess; } + } + + public void GenericMethod(T value) + { + _PassedValue = value; + _GenericMethodSuccess = true; + } + + public void RegularMethod() + { + _RegularMethodSuccess = true; + } + + /// + /// Returns true if the generic method was successfully passed a matching value + /// + /// + /// + public bool Validate(T value) + { + return value.Equals(_PassedValue); + } + } + + /// + /// Normal class containing a generic method + /// + public class TestClassWithGenericMethod + { + private object _PassedValue; + + public object PassedValue + { + get { return _PassedValue; } + } + + private bool _GenericMethodSuccess; + + public bool GenericMethodSuccess + { + get { return _GenericMethodSuccess; } + } + + public void GenericMethod(T value) + { + _PassedValue = value; + _GenericMethodSuccess = true; + } + + internal bool Validate(T value) + { + return value.Equals(_PassedValue); + } + } + + public class TestClass2 + { + public static int func(int x, int y) + { + return x + y; + } + + public int funcInstance(int x, int y) + { + return x + y; + } + } + + /* + * Sample class used in several test cases to check if + * Lua scripts are accessing objects correctly + */ + public class TestClass : IFoo1, IFoo2 + { + public int val; + private string strVal; + + public TestClass() + { + val = 0; + } + + public TestClass(int val) + { + this.val = val; + } + + public TestClass(string val) + { + this.strVal = val; + } + + public static TestClass makeFromString(String str) + { + return new TestClass(str); + } + + bool? nb2 = null; + + public bool? NullableBool + { + get { return nb2; } + set { nb2 = value; } + } + + TestStruct s = new TestStruct(); + + public TestStruct Struct + { + get { return s; } + set { s = (TestStruct)value; } + } + + public int testval + { + get + { + return this.val; + } + set + { + this.val = value; + } + } + + public string teststrval + { + get + { + return this.strVal; + } + set + { + this.strVal = value; + } + } + + public int this[int index] + { + get { return 1; } + set { } + } + + public int this[string index] + { + get { return 1; } + set { } + } + + public TimeSpan? NullableMethod(TimeSpan? input) + { + return input; + } + + public int? NullableMethod2(int? input) + { + return input; + } + + public object[] TestLuaFunction(LuaFunction func) + { + if (func != null) + { + return func.Call(1, 2); + } + return null; + } + + public int sum(int x, int y) + { + return x + y; + } + + public void setVal(int newVal) + { + val = newVal; + } + + public void setVal(string newVal) + { + strVal = newVal; + } + + public int getVal() + { + return val; + } + + public string getStrVal() + { + return strVal; + } + + public int outVal(out int val) + { + val = 5; + return 3; + } + + public int outVal(out int val, int val2) + { + val = 5; + return val2; + } + + public int outVal(int val, ref int val2) + { + val2 = val + val2; + return val; + } + + public int outValMutiple(int arg, out string arg2, out string arg3) + { + arg2 = Guid.NewGuid().ToString(); + arg3 = Guid.NewGuid().ToString(); + + return arg; + } + + public int callDelegate1(TestDelegate1 del) + { + return del(2, 3); + } + + public int callDelegate2(TestDelegate2 del) + { + int a = 3; + int b = del(2, out a); + return a + b; + } + + public int callDelegate3(TestDelegate3 del) + { + int a = 3; + del(2, ref a); + //Console.WriteLine(a); + return a; + } + + public int callDelegate4(TestDelegate4 del) + { + return del(2, 3).testval; + } + + public int callDelegate5(TestDelegate5 del) + { + return del(new TestClass(2), new TestClass(3)); + } + + public int callDelegate6(TestDelegate6 del) + { + TestClass test = new TestClass(); + int a = del(2, out test); + return a + test.testval; + } + + public int callDelegate7(TestDelegate7 del) + { + TestClass test = new TestClass(3); + del(2, ref test); + return test.testval; + } + + public int callInterface1(ITest itest) + { + return itest.test1(2, 3); + } + + public int callInterface2(ITest itest) + { + int a = 3; + int b = itest.test2(2, out a); + return a + b; + } + + public int callInterface3(ITest itest) + { + int a = 3; + itest.test3(2, ref a); + //Console.WriteLine(a); + return a; + } + + public int callInterface4(ITest itest) + { + return itest.test4(2, 3).testval; + } + + public int callInterface5(ITest itest) + { + return itest.test5(new TestClass(2), new TestClass(3)); + } + + public int callInterface6(ITest itest) + { + TestClass test = new TestClass(); + int a = itest.test6(2, out test); + return a + test.testval; + } + + public int callInterface7(ITest itest) + { + TestClass test = new TestClass(3); + itest.test7(2, ref test); + return test.testval; + } + + public int callInterface8(ITest itest) + { + itest.intProp = 3; + return itest.intProp; + } + + public int callInterface9(ITest itest) + { + itest.refProp = new TestClass(3); + return itest.refProp.testval; + } + + public void exceptionMethod() + { + throw new Exception("exception test"); + } + + public virtual int overridableMethod(int x, int y) + { + return x + y; + } + + public static int callOverridable(TestClass test, int x, int y) + { + return test.overridableMethod(x, y); + } + + int IFoo1.foo() + { + return 3; + } + + public int foo() + { + return 5; + } + + private void _PrivateMethod() + { + Console.WriteLine("Private method called"); + } + + public void MethodOverload() + { + Console.WriteLine("Method with no params"); + } + + public void MethodOverload(TestClass testClass) + { + Console.WriteLine("Method with testclass param"); + } + + public void MethodOverload(int i, int j, int k) + { + Console.WriteLine("Overload without out param: " + i + ", " + j + ", " + k); + } + + public void MethodOverload(int i, int j, out int k) + { + k = 5; + Console.WriteLine("Overload with out param" + i + ", " + j); + } + + public void Print(object format, params object[] args) + { + //just for test,this is not printf implements + var output = format.ToString() + "\t"; + foreach (var msg in args) + { + output += msg.ToString() + "\t"; + } + Console.WriteLine(output); + } + + static public int MethodWithParams(int a, params int[] others) + { + Console.WriteLine(a); + int i = 0; + foreach (int val in others) + { + Console.WriteLine(val); + i++; + } + return i; + } + + static public int MethodWithObjectParams(params object[] others) + { + int i = 0; + foreach (var val in others) + { + Console.WriteLine(val); + i++; + } + return i; + } + } + + public class TestClassWithOverloadedMethod + { + public int CallsToStringFunc { get; set; } + public int CallsToIntFunc { get; set; } + public void Func(string param) + { + CallsToStringFunc++; + } + + public void Func(int param) + { + CallsToIntFunc++; + } + + } +} diff --git a/tests/test.runsettings b/tests/test.runsettings new file mode 100644 index 0000000000000000000000000000000000000000..01b6652ff942e3f249c1e4bab1cf6d3b1c279e3d --- /dev/null +++ b/tests/test.runsettings @@ -0,0 +1,6 @@ + + + + x64 + + \ No newline at end of file diff --git a/tests/test_32.luac b/tests/test_32.luac deleted file mode 100644 index a615fcf7b2976e17e2f5505101fb9df649c36d0a..0000000000000000000000000000000000000000 Binary files a/tests/test_32.luac and /dev/null differ diff --git a/tests/test_64.luac b/tests/test_64.luac deleted file mode 100644 index 919384a742cafad760907343b924e5e398f5c345..0000000000000000000000000000000000000000 Binary files a/tests/test_64.luac and /dev/null differ