diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d15fb69 --- /dev/null +++ b/.gitignore @@ -0,0 +1,46 @@ +#OS junk files +[Tt]humbs.db +*.DS_Store + +#Visual Studio files +*.[Oo]bj +*.user +*.aps +*.pch +*.vspscc +*.vssscc +*_i.c +*_p.c +*.ncb +*.suo +*.tlb +*.tlh +*.bak +*.[Cc]ache +*.ilk +*.log +*.lib +*.sbr +*.sdf +*.opensdf +*.unsuccessfulbuild +ipch/ +obj/ +[Bb]in +[Dd]ebug*/ +[Rr]elease*/ +Ankh.NoLoad + +#Tooling +_ReSharper*/ +*.resharper +[Tt]est[Rr]esult* + +#Project files +[Bb]uild/ + +#Subversion files +.svn + +# Office Temp Files +~$* \ No newline at end of file diff --git a/NGon.SampleApplication/Controllers/HomeController.cs b/NGon.SampleApplication/Controllers/HomeController.cs new file mode 100644 index 0000000..aef0699 --- /dev/null +++ b/NGon.SampleApplication/Controllers/HomeController.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; + +namespace NGon.SampleApplication.Controllers +{ + public class HomeController : Controller + { + public ActionResult Index() + { + var person = new Person { FirstName = "John", LastName = "Doe", Age = 30 }; + ViewBag.NGon.Person = person; + return View(); + } + } + + public class Person + { + public string FirstName { get; set; } + public string LastName { get; set; } + public int Age { get; set; } + } +} diff --git a/NGon.SampleApplication/Global.asax b/NGon.SampleApplication/Global.asax new file mode 100644 index 0000000..4fa9758 --- /dev/null +++ b/NGon.SampleApplication/Global.asax @@ -0,0 +1 @@ +<%@ Application Codebehind="Global.asax.cs" Inherits="NGon.SampleApplication.MvcApplication" Language="C#" %> diff --git a/NGon.SampleApplication/Global.asax.cs b/NGon.SampleApplication/Global.asax.cs new file mode 100644 index 0000000..e396b60 --- /dev/null +++ b/NGon.SampleApplication/Global.asax.cs @@ -0,0 +1,38 @@ +using System.Web.Mvc; +using System.Web.Routing; + +namespace NGon.SampleApplication +{ + // Note: For instructions on enabling IIS6 or IIS7 classic mode, + // visit http://go.microsoft.com/?LinkId=9394801 + + public class MvcApplication : System.Web.HttpApplication + { + public static void RegisterGlobalFilters(GlobalFilterCollection filters) + { + filters.Add(new HandleErrorAttribute()); + } + + public static void RegisterRoutes(RouteCollection routes) + { + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + + routes.MapRoute( + "Default", // Route name + "{controller}/{action}/{id}", // URL with parameters + new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults + ); + + } + + protected void Application_Start() + { + AreaRegistration.RegisterAllAreas(); + + GlobalFilters.Filters.Add(new NGonActionFilterAttribute()); + + RegisterGlobalFilters(GlobalFilters.Filters); + RegisterRoutes(RouteTable.Routes); + } + } +} \ No newline at end of file diff --git a/NGon.SampleApplication/NGon.SampleApplication.csproj b/NGon.SampleApplication/NGon.SampleApplication.csproj new file mode 100644 index 0000000..6797c21 --- /dev/null +++ b/NGon.SampleApplication/NGon.SampleApplication.csproj @@ -0,0 +1,126 @@ + + + + Debug + AnyCPU + + + 2.0 + {6B4601DB-23C8-497E-8545-CDB3075C40A2} + {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + NGon.SampleApplication + NGon.SampleApplication + v4.0 + false + false + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + ..\packages\EntityFramework.4.1.10331.0\lib\EntityFramework.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Global.asax + + + + + + + + Web.config + + + Web.config + + + + + + + + {59A8F487-179F-47AE-8631-0AAF99E89DE4} + NGon + + + + + + + + + + + + + + + + + + + False + True + 38588 + / + + + False + False + + + False + + + + + \ No newline at end of file diff --git a/NGon.SampleApplication/Properties/AssemblyInfo.cs b/NGon.SampleApplication/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..fbe124d --- /dev/null +++ b/NGon.SampleApplication/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +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("NGon.SampleApplication")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("NGon.SampleApplication")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2b85f213-cf43-4126-9e2f-be3dfd3787ba")] + +// 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 Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/NGon.SampleApplication/Views/Home/Index.cshtml b/NGon.SampleApplication/Views/Home/Index.cshtml new file mode 100644 index 0000000..d3b0ec2 --- /dev/null +++ b/NGon.SampleApplication/Views/Home/Index.cshtml @@ -0,0 +1,17 @@ +

Home Page

+ + + + +
\ No newline at end of file diff --git a/NGon.SampleApplication/Views/Shared/_Layout.cshtml b/NGon.SampleApplication/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000..8348fc8 --- /dev/null +++ b/NGon.SampleApplication/Views/Shared/_Layout.cshtml @@ -0,0 +1,14 @@ +@using NGon + + + + + @ViewBag.Title + + @Html.IncludeNGon() + + + + @RenderBody() + + diff --git a/NGon.SampleApplication/Views/Web.config b/NGon.SampleApplication/Views/Web.config new file mode 100644 index 0000000..4c30ef2 --- /dev/null +++ b/NGon.SampleApplication/Views/Web.config @@ -0,0 +1,58 @@ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NGon.SampleApplication/Views/_ViewStart.cshtml b/NGon.SampleApplication/Views/_ViewStart.cshtml new file mode 100644 index 0000000..9c30ccf --- /dev/null +++ b/NGon.SampleApplication/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} \ No newline at end of file diff --git a/NGon.SampleApplication/Web.Debug.config b/NGon.SampleApplication/Web.Debug.config new file mode 100644 index 0000000..962e6b7 --- /dev/null +++ b/NGon.SampleApplication/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/NGon.SampleApplication/Web.Release.config b/NGon.SampleApplication/Web.Release.config new file mode 100644 index 0000000..141832b --- /dev/null +++ b/NGon.SampleApplication/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/NGon.SampleApplication/Web.config b/NGon.SampleApplication/Web.config new file mode 100644 index 0000000..07f635f --- /dev/null +++ b/NGon.SampleApplication/Web.config @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NGon.SampleApplication/packages.config b/NGon.SampleApplication/packages.config new file mode 100644 index 0000000..e6ea0c8 --- /dev/null +++ b/NGon.SampleApplication/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/NGon.Tests/NGon.Tests.csproj b/NGon.Tests/NGon.Tests.csproj new file mode 100644 index 0000000..066ebee --- /dev/null +++ b/NGon.Tests/NGon.Tests.csproj @@ -0,0 +1,77 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {16AFD75A-1563-474C-90BB-6E1B9785EBA0} + Library + Properties + NGon.Tests + NGon.Tests + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll + + + ..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll + + + ..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll + + + ..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll + + + + + + + + + + + + + + + + + + + + + {59A8F487-179F-47AE-8631-0AAF99E89DE4} + NGon + + + + + \ No newline at end of file diff --git a/NGon.Tests/NGonTests.cs b/NGon.Tests/NGonTests.cs new file mode 100644 index 0000000..9a831c3 --- /dev/null +++ b/NGon.Tests/NGonTests.cs @@ -0,0 +1,106 @@ +using System; +using System.Dynamic; +using System.IO; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using Moq; +using NUnit.Framework; + +namespace NGon.Tests +{ + [TestFixture] + public class NGonTests + { + private ControllerBase _controller; + private HtmlHelper _helper; + private const string StartScriptTagFormat = @""; + + [SetUp] + public void Setup() + { + var controllerContext = new ControllerContext(new Mock().Object, new RouteData(), new Mock().Object); + controllerContext.Controller.ViewData = new ViewDataDictionary { { "NGon", new ExpandoObject() } }; + var viewContext = new ViewContext(controllerContext, new Mock().Object, controllerContext.Controller.ViewData, new TempDataDictionary(), new Mock().Object); + var mockViewDataContainer = new Mock(); + mockViewDataContainer.Setup(v => v.ViewData).Returns(controllerContext.Controller.ViewData); + _controller = controllerContext.Controller; + _helper = new HtmlHelper(viewContext, mockViewDataContainer.Object); + } + + [Test] + public void SimpleStringPropertyTest() + { + //arrange + _controller.ViewBag.NGon.Foo = "100"; + + //act + var result = _helper.IncludeNGon(); + + //assert + var expected = String.Concat(String.Format(StartScriptTagFormat, "ngon"), @"ngon.Foo=""100"";", EndScriptTag); + var actual = result.ToString(); + Assert.AreEqual(expected, actual); + } + + [Test] + public void SimpleIntPropertyTest() + { + //arrange + _controller.ViewBag.NGon.Foo = 100; + + //act + var result = _helper.IncludeNGon(); + + //assert + var expected = String.Concat(String.Format(StartScriptTagFormat, "ngon"), @"ngon.Foo=100;", EndScriptTag); + var actual = result.ToString(); + Assert.AreEqual(expected, actual); + } + + [Test] + public void PocoObjectJsonTest() + { + var person = new { FirstName = "John", LastName = "Doe", Age = 45 }; + + //arrange + _controller.ViewBag.NGon.Person = person; + + //act + var result = _helper.IncludeNGon(); + + //assert + var expected = String.Concat(String.Format(StartScriptTagFormat, "ngon"), @"ngon.Person={""FirstName"":""John"",""LastName"":""Doe"",""Age"":45};", EndScriptTag); + var actual = result.ToString(); + Assert.AreEqual(expected, actual); + } + + [Test] + public void NamespaceTest() + { + const string @namespace = "test"; + //arrange + _controller.ViewBag.NGon.Foo = 100; + + //act + var result = _helper.IncludeNGon(@namespace); + + //assert + var expected = String.Concat(String.Format(StartScriptTagFormat, @namespace), @namespace, @".Foo=100;", EndScriptTag); + var actual = result.ToString(); + Assert.AreEqual(expected, actual); + } + + [Test] + public void MissingNGonInViewBagThrowsException() + { + //arrange + _controller.ViewData.Clear(); + + //act + //assert + Assert.Throws(() => _helper.IncludeNGon()); + } + } +} diff --git a/NGon.Tests/Properties/AssemblyInfo.cs b/NGon.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ca77f84 --- /dev/null +++ b/NGon.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("NGon.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("NGon.Tests")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ae53aa0d-27f9-4035-8bd2-5bd35fb0a8c4")] + +// 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/NGon.Tests/packages.config b/NGon.Tests/packages.config new file mode 100644 index 0000000..be890f5 --- /dev/null +++ b/NGon.Tests/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/NGon.sln b/NGon.sln new file mode 100644 index 0000000..599cadc --- /dev/null +++ b/NGon.sln @@ -0,0 +1,32 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NGon", "NGon\NGon.csproj", "{59A8F487-179F-47AE-8631-0AAF99E89DE4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NGon.Tests", "NGon.Tests\NGon.Tests.csproj", "{16AFD75A-1563-474C-90BB-6E1B9785EBA0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NGon.SampleApplication", "NGon.SampleApplication\NGon.SampleApplication.csproj", "{6B4601DB-23C8-497E-8545-CDB3075C40A2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {59A8F487-179F-47AE-8631-0AAF99E89DE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59A8F487-179F-47AE-8631-0AAF99E89DE4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59A8F487-179F-47AE-8631-0AAF99E89DE4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59A8F487-179F-47AE-8631-0AAF99E89DE4}.Release|Any CPU.Build.0 = Release|Any CPU + {16AFD75A-1563-474C-90BB-6E1B9785EBA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {16AFD75A-1563-474C-90BB-6E1B9785EBA0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {16AFD75A-1563-474C-90BB-6E1B9785EBA0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {16AFD75A-1563-474C-90BB-6E1B9785EBA0}.Release|Any CPU.Build.0 = Release|Any CPU + {6B4601DB-23C8-497E-8545-CDB3075C40A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6B4601DB-23C8-497E-8545-CDB3075C40A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6B4601DB-23C8-497E-8545-CDB3075C40A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6B4601DB-23C8-497E-8545-CDB3075C40A2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/NGon/HtmlHelperExtensions.cs b/NGon/HtmlHelperExtensions.cs new file mode 100644 index 0000000..4607d3d --- /dev/null +++ b/NGon/HtmlHelperExtensions.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Text; +using System.Web; +using System.Web.Mvc; +using System.Web.Script.Serialization; + +namespace NGon +{ + public static class HtmlHelperExtensions + { + public static IHtmlString IncludeNGon(this HtmlHelper helper, string @namespace = "ngon") + { + var viewData = helper.ViewContext.ViewData; + if (viewData == null) + { + return MvcHtmlString.Empty; + } + + var ngon = viewData["NGon"] as ExpandoObject; + if (ngon == null) + { + throw new InvalidOperationException("Cannot find NGon in ViewBag. Did you remember to add the global NGonActionFilterAttribute?"); + } + + var tag = new TagBuilder("script"); + tag.Attributes.Add(new KeyValuePair("type", "text/javascript")); + var builder = new StringBuilder(); + builder.AppendFormat("window.{0}={{}};", @namespace); + + var serializer = new JavaScriptSerializer(); + foreach (var prop in ngon) + { + builder.AppendFormat("{0}.{1}={2};", @namespace, prop.Key, helper.Raw(serializer.Serialize(prop.Value))); + } + + tag.InnerHtml = builder.ToString(); + return new HtmlString(tag.ToString()); + } + } +} diff --git a/NGon/NGon.csproj b/NGon/NGon.csproj new file mode 100644 index 0000000..afd159f --- /dev/null +++ b/NGon/NGon.csproj @@ -0,0 +1,59 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {59A8F487-179F-47AE-8631-0AAF99E89DE4} + Library + Properties + NGon + NGon + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NGon/NGonActionFilterAttribute.cs b/NGon/NGonActionFilterAttribute.cs new file mode 100644 index 0000000..269e5ed --- /dev/null +++ b/NGon/NGonActionFilterAttribute.cs @@ -0,0 +1,14 @@ +using System.Dynamic; +using System.Web.Mvc; + +namespace NGon +{ + public class NGonActionFilterAttribute : ActionFilterAttribute + { + public override void OnActionExecuting(ActionExecutingContext filterContext) + { + filterContext.Controller.ViewBag.NGon = new ExpandoObject(); + base.OnActionExecuting(filterContext); + } + } +} diff --git a/NGon/Properties/AssemblyInfo.cs b/NGon/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..21bc63c --- /dev/null +++ b/NGon/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("NGon")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("NGon")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c45ae998-1409-4ea9-a0b0-847c439b3cce")] + +// 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/packages/EntityFramework.4.1.10331.0/EntityFramework.4.1.10331.0.nupkg b/packages/EntityFramework.4.1.10331.0/EntityFramework.4.1.10331.0.nupkg new file mode 100644 index 0000000..6c2337e Binary files /dev/null and b/packages/EntityFramework.4.1.10331.0/EntityFramework.4.1.10331.0.nupkg differ diff --git a/packages/EntityFramework.4.1.10331.0/lib/EntityFramework.dll b/packages/EntityFramework.4.1.10331.0/lib/EntityFramework.dll new file mode 100644 index 0000000..cbb615d Binary files /dev/null and b/packages/EntityFramework.4.1.10331.0/lib/EntityFramework.dll differ diff --git a/packages/EntityFramework.4.1.10331.0/lib/EntityFramework.xml b/packages/EntityFramework.4.1.10331.0/lib/EntityFramework.xml new file mode 100644 index 0000000..3a9b301 --- /dev/null +++ b/packages/EntityFramework.4.1.10331.0/lib/EntityFramework.xml @@ -0,0 +1,13206 @@ + + + + EntityFramework + + + + + Strongly-typed and parameterized string resources. + + + + + A string like "The '{0}' property of EdmPrimitiveType is fixed and cannot be set." + + + + + A string like "The namespace '{0}' is a system namespace and cannot be used by other schemas. Choose another namespace name." + + + + + A string like "Role '{0}' in AssociationSets ‘{1}’ and ‘{2}’ refers to the same EntitySet '{3}' in EntityContainer '{4}'. Make sure that if two or more AssociationSets refer to the same AssociationType, the ends do not refer to the same EntitySet." + + + + + A string like "The referenced EntitySet ‘{0}’ for End ‘{1}’ could not be found in the containing EntityContainer." + + + + + A string like "Type '{0}' is derived from type '{1}' that is the type for EntitySet '{2}'. Type '{0}' defines new concurrency requirements that are not allowed for subtypes of base EntitySet types." + + + + + A string like "EntitySet ‘{0}’ is based on type ‘{1}’ that has no keys defined." + + + + + A string like "The end name ‘{0}’ is already defined." + + + + + A string like "The key specified in EntityType '{0}' is not valid. Property '{1}' is referenced more than once in the Key element." + + + + + A string like "Property '{0}' has a CollectionKind specified but is not a collection property." + + + + + A string like "Property '{0}' has a CollectionKind specified. CollectionKind is only supported in version 1.1 EDM models." + + + + + A string like "ComplexType '{0}' is marked as abstract. Abstract ComplexTypes are only supported in version 1.1 EDM models." + + + + + A string like "ComplexType '{0}' has a BaseType specified. ComplexType inheritance is only supported in version 1.1 EDM models." + + + + + A string like "Key part '{0}' for type ‘{1}’ is not valid. All parts of the key must be non-nullable." + + + + + A string like "The property '{0}' in EntityType '{1}' is not valid. All properties that are part of the EntityKey must be of PrimitiveType." + + + + + A string like "Key usage is not valid. The {0} class cannot define keys because one of its base classes (‘{1}’) defines keys." + + + + + A string like "EntityType '{0}' has no key defined. Define the key for this EntityType." + + + + + A string like "NavigationProperty is not valid. Role ‘{0}’ or Role ‘{1}’ is not defined in Relationship ‘{2}’." + + + + + A string like "End '{0}' on relationship '{1}' cannot have an operation specified because its multiplicity is '*'. Operations cannot be specified on ends with multiplicity '*'." + + + + + A string like "Each Name and PluralName in a relationship must be unique. '{0}' is already defined." + + + + + A string like "In relationship '{0}', the Principal and Dependent Role of the referential constraint refer to the same Role in the relationship type." + + + + + A string like "Multiplicity is not valid in Role '{0}' in relationship '{1}'. Valid values for multiplicity for the Principal Role are '0..1' or '1'." + + + + + A string like "Multiplicity is not valid in Role '{0}' in relationship '{1}'. Because all the properties in the Dependent Role are nullable, multiplicity of the Principal Role must be '0..1'." + + + + + A string like "Multiplicity conflicts with the referential constraint in Role '{0}' in relationship '{1}'. Because at least one of the properties in the Dependent Role is non-nullable, multiplicity of the Principal Role must be '1'." + + + + + A string like "Multiplicity conflicts with the referential constraint in Role '{0}' in relationship '{1}'. Because all of the properties in the Dependent Role are non-nullable, multiplicity of the Principal Role must be '1'." + + + + + A string like "Properties referred by the Dependent Role ‘{0}’ must be a subset of the key of the EntityType ‘{1}’ referred to by the Dependent Role in the referential constraint for relationship ‘{2}’." + + + + + A string like "Multiplicity is not valid in Role '{0}' in relationship '{1}'. Because the Dependent Role refers to the key properties, the upper bound of the multiplicity of the Dependent Role must be ‘1’." + + + + + A string like "Multiplicity is not valid in Role '{0}' in relationship '{1}'. Because the Dependent Role properties are not the key properties, the upper bound of the multiplicity of the Dependent Role must be ‘*’." + + + + + A string like "The types of all properties in the Dependent Role of a referential constraint must be the same as the corresponding property types in the Principal Role. The type of property '{0}' on entity '{1}' does not match the type of property '{2}' on entity '{3}' in the referential constraint '{4}'." + + + + + A string like "There is no property with name '{0}' defined in the type referred to by Role '{1}'." + + + + + A string like "A nullable ComplexType is not supported. Property '{0}' must not allow nulls." + + + + + A string like "A property cannot be of type ‘{0}’. The property type must be a ComplexType or a PrimitiveType." + + + + + A string like "Each member name in an EntityContainer must be unique. A member with name '{0}' is already defined." + + + + + A string like "Each type name in a schema must be unique. Type name '{0}' is already defined." + + + + + A string like "Name ‘{0}’ cannot be used in type ‘{1}’. Member names cannot be the same as their enclosing type." + + + + + A string like "Each property name in a type must be unique. Property name '{0}' is already defined." + + + + + A string like "A cycle was detected in the type hierarchy of '{0}'." + + + + + A string like "A property cannot be of type ‘{0}’. The property type must be a ComplexType, a PrimitiveType, or a CollectionType." + + + + + A string like "The specified name must not be longer than 480 characters: '{0}'." + + + + + A string like "The specified name is not allowed: '{0}'." + + + + + A string like "NavigationProperty is not valid. The FromRole and ToRole are the same." + + + + + A string like "OnDelete can be specified on only one End of an EdmAssociation." + + + + + A string like "The number of properties in the Dependent and Principal Roles in a relationship constraint must be identical." + + + + + A string like "The name is missing or not valid." + + + + + A string like "AssociationEnd must not be null." + + + + + A string like "DependentEnd must not be null." + + + + + A string like "DependentProperties must not be empty." + + + + + A string like "Association must not be null." + + + + + A string like "ResultEnd must not be null." + + + + + A string like "EntityType must not be null." + + + + + A string like "ElementType must not be null." + + + + + A string like "ElementType must not be null." + + + + + A string like "SourceSet must not be null." + + + + + A string like "TargetSet must not be null." + + + + + A string like "The type is not a valid EdmTypeReference." + + + + + A string like "Serializer can only serialize an EdmModel that has one EdmNamespace and one EdmEntityContainer." + + + + + Strongly-typed and parameterized exception factory. + + + + + The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. + + + + + The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. + + + + + The exception that is thrown when the author has yet to implement the logic at this point in the program. This can act as an exception based TODO tag. + + + + + The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality. + + + + + Allows the construction and modification of a user-specified annotation (name-value pair) on a instance. + + + + + INamedDataModelItem is implemented by model-specific base types for all types with a property. + + + + + + Gets or sets the currently assigned name. + + + + + Constructs a new DataModelAnnotation + + + + + Gets or sets an optional namespace that can be used to distinguish the annotation from others with the same value. + + + + + Gets or sets the name of the annotation. + + + + + Gets or sets the value of the annotation. + + + + + + + + + + DataModelEventArgs is the base argument type for all events raised by consumers of Entity Data Model (EDM) models. + + + + + Gets a value indicating the that caused the event to be raised. + + + + + Gets an optional value indicating which property of the source item caused the event to be raised. + + + + + Gets a value that identifies the specific error that is being raised. + + + + + Gets an optional descriptive message the describes the error that is being raised. + + + + + DataModelItem is the base for all types in the EDM metadata reflection, construction and modification API. + + + + + IAnnotatedDataModelItem is implemented by model-specific base types for all types with an property. + + + + + + Gets or sets the currently assigned annotations. + + + + + DbAliasedMetadataItem provides the base type for all Database Metadata types that can have an optional that should be used instead of the item's when referring to the item in the database. + + + + + NamedDbItem is the base for all types in the Database Metadata construction and modification API with a property. + + + + + The base for all all Database Metadata types that support annotation using . + + + + + DbDataModelItem is the base for all types in the Database Metadata construction and modification API. + + + + + Gets or sets the currently assigned annotations. + + + + + Gets or sets the currently assigned name. + + + + + Gets an optional alternative identifier that should be used when referring to this item in the database. + + + + + When implemented in derived types, allows the construction and modification of a column in a Database Metadata table or row. + + + + + Gets or sets a string indicating the database-specific type of the column. + + + + + Gets or sets a value indicating whether the column is nullable. + + + + + Gets or sets an optional instance that applies additional constraints to the referenced database-specific type of the column. + + + + + Allows the construction and modification of a database in a Database Metadata model. + + + + + Gets or sets an optional value that indicates the database model version. + + + + + Gets or sets the collection of instances that specifies the schemas within the database. + + + + + Allows the construction and modification of a foreign key constraint sourced by a instance. + + + + + Gets or sets the to take when a delete operation is attempted. + + + + + Indicates which Database Metadata concept is represented by a given item. + + + + + Database Kind + + + + + Schema Kind + + + + + Foreign Key Constraint Kind + + + + + Function Kind + + + + + Function Parameter Kind + + + + + Function Return or Parameter Type Kind + + + + + Row Column Kind + + + + + Table Kind + + + + + Table Column Kind + + + + + Primitive Facets Kind + + + + + Specifies the action to take on a given operation. + + + + + Default behavior + + + + + Restrict the operation + + + + + Cascade the operation + + + + + Allows the construction and modification of additional constraints that can be applied to a specific use of a primitive type in a Database Metadata item. + + + + + Returns true if any facet value property currently has a non-null value; otherwise returns false. + + + + + Gets or sets an optional value indicating whether the referenced type should be considered to have a fixed or variable length. + + + + + Gets or sets an optional value indicating whether the referenced type should be considered to have its intrinsic maximum length, rather than a specific value. + + + + + Gets or sets an optional value indicating whether the referenced type should be considered to be Unicode or non-Unicode. + + + + + Gets or sets an optional value indicating the current constraint on the type's maximum length. + + + + + Gets or sets an optional value indicating the current constraint on the type's precision. + + + + + Gets or sets an optional value indicating the current constraint on the type's scale. + + + + + Allows the construction and modification of a database schema in a database model. + + + + + Gets or sets the collection of instances that specifies the tables declared within the schema. + + + + + DbSchemaMetadataItem is the base for all types that can be contained in a schema. + + + + + Allows the construction and modification of a column in a table. + + + + + Gets or sets a value indicating whether the column is part of the table's primary key. + + + + + Gets or sets a value indicating if and how the value of the column is automatically generated. + + + + + Gets or sets an optional value indicating the collation specific to this table column. + + + + + Gets or sets an optional value that specifies the default value for the column. + + + + + Allows the construction and modification a table in a database schema. + + + + + Gets or sets the collection of instances that specifies the columns present within the table. + + + + + Gets or sets the collection of instances from the collection of the table that are part of the primary key. + + + + + Gets or sets the collection of instances that defines the foreign key constraints sourced from the table. + + + + + Represents a specific use of a type in a Database Metadata item. + + + + + Gets or sets an optional instance that applies additional constraints to a referenced primitive type. + + Accessing this property forces the creation of a DbPrimitiveTypeFacets value if no value has previously been set. Use to determine whether or not this property currently has a value. + + + + Gets or sets a value indicating whether the represented type is a collection type. + + + + + Gets or sets an optional value indicating whether the referenced type should be considered nullable. + + + + + Gets a value indicating whether the type has been configured as a row type by the addition of one or more RowColumns. + + + + + Represents the mapping of an EDM association end () as a collection of property mappings (). + + + + + DbMappingMetadataItem is the base for all types in the EDM-to-Database Mapping construction and modification API that support annotation using . + + + + + DbMappingModelItem is the base for all types in the EDM-to-Database Mapping construction and modification API. + + + + + Gets or sets the currently assigned annotations. + + + + + Gets an value representing the association end that is being mapped. + + + + + Gets the collection of s that specifies how the association end key properties are mapped to the table. + + + + + Gets an value representing the association set that is being mapped. + + + + + Gets a value representing the table to which the entity type's properties are being mapped. + + + + + Gets the collection of s that specifies the constant or null values that columns in must have for this type mapping to apply. + + + + + Allows the construction and modification of a condition for a column in a database table. + + + + + Gets or sets a value representing the table column which must contain for this condition to hold. + + + + + Gets or sets the value that must contain for this condition to hold. + + + + + Represents the mapping of an entity property to a column in a database table. + + + + + Gets or sets the collection of instances that defines the mapped property, beginning from a property declared by the mapped entity type and optionally proceeding through properties of complex property result types. + + + + + Gets or sets a value representing the table column to which the entity property is being mapped. + + + + + Allows the construction and modification of the mapping of an EDM entity container () to a database (). + + + + + Gets or sets an value representing the entity container that is being mapped. + + + + + Gets or sets the collection of s that specifies how the container's entity sets are mapped to the database. + + + + + Gets the collection of s that specifies how the container's association sets are mapped to the database. + + + + + Allows the construction and modification of the mapping of an EDM entity set () to a database (). + + + + + Gets or sets an value representing the entity set that is being mapped. + + + + + Gets or sets the collection of s that specifies how the set's entity types are mapped to the database. + + + + + Allows the construction and modification of a complete or partial mapping of an EDM entity type () or type hierarchy to a specific database table (). + + + + + Gets or sets an value representing the entity type or hierarchy that is being mapped. + + + + + Gets or sets a value indicating whether this type mapping applies to and all its direct or indirect subtypes (true), or only to (false). + + + + + Gets a value representing the table to which the entity type's properties are being mapped. + + + + + Gets the collection of s that specifies how the type's properties are mapped to the table. + + + + + Gets the collection of s that specifies the constant or null values that columns in must have for this type mapping fragment to apply. + + + + + Indicates which EDM-to-Database Mapping concept is represented by a given item. + + + + + Database Mapping Kind + + + + + Entity Container Mapping Kind + + + + + Entity Set Mapping Kind + + + + + Association Set Mapping Kind + + + + + Entity Type Mapping Kind + + + + + Query View Mapping Kind + + + + + Entity Type Mapping Fragment Kind + + + + + Edm Property Mapping Kind + + + + + Association End Mapping Kind + + + + + Column Condition Kind + + + + + Property Condition Kind + + + + + Allows the construction and modification of a constraint applied to an Entity Data Model (EDM) association. + + + + + The base for all all Entity Data Model (EDM) types that support annotation using . + + + + + EdmDataModelItem is the base for all types in the Entity Data Model (EDM) metadata construction and modification API. + + + + + Gets an value indicating which Entity Data Model (EDM) concept is represented by this item. + + + + + Gets or sets the currently assigned annotations. + + + + + Returns all EdmItem children directly contained by this EdmItem. + + + + + Gets or sets the that represents the 'dependent' end of the constraint; properties from this association end's entity type contribute to the collection. + + + + + Gets or sets the collection of instances from the of the constraint. The values of these properties are constrained against the primary key values of the remaining, 'principal' association end's entity type. + + + + + Allows the construction and modification of one end of an Entity Data Model (EDM) association. + + + + + EdmStructuralMember is the base for all types that represent members of structural items in the Entity Data Model (EDM) metadata construction and modification API. + + + + + The base for all all Entity Data Model (EDM) item types that with a property. + + + + + Gets or sets the currently assigned name. + + + + + Gets or sets the entity type referenced by this association end. + + + + + Gets or sets the of this association end, which indicates the multiplicity of the end and whether or not it is required. + + + + + Gets or sets the to take when a delete operation is attempted. + + + + + Indicates the multiplicity of an and whether or not it is required. + + + + + Allows the construction and modification of an association set in an Entity Data Model (EDM) ). + + + + + Represents an item in an Entity Data Model (EDM) . + + + + + Gets or sets the that specifies the association type for the set. + + + + + Gets or sets the that specifies the entity set corresponding to the association end for this association set. + + + + + Gets or sets the that specifies the entity set corresponding to the association end for this association set. + + + + + + The base for all all Entity Data Model (EDM) types that represent a structured type from the EDM type system. + + + + + The base for all all Entity Data Model (EDM) types that represent a type from the EDM type system. + + + + + Represents an item in an Entity Data Model (EDM) . + + + + + The base for all all Entity Data Model (EDM) item types that with a Name property + that represents a qualified (can be dotted) name. + + + + + Gets a value indicating whether this type is abstract. + + + + + Gets the optional base type of this type. + + + + + Gets or sets the that defines the source end of the association. + + + + + Gets or sets the that defines the target end of the association. + + + + + Gets or sets the optional constraint that indicates whether the relationship is an independent association (no constraint present) or a foreign key relationship ( specified). + + + + + Collection semantics for properties. + + + + + The property does not have a collection type or does not specify explicit collection semantics. + + + + + The property is an unordered collection that may contain duplicates. + + + + + The property is an ordered collection that may contain duplicates. + + + + + Allows the construction and modification of a complex type in an Entity Data Model (EDM) . + + + + + Gets or sets the optional that indicates the base complex type of the complex type. + + + + + Gets or sets a value indicating whether the complex type is abstract. + + + + + Gets or sets the collection of instances that describe the (scalar or complex) properties of the complex type. + + + + + Concurrency mode for properties. + + + + + Default concurrency mode: the property is never validated + at write time + + + + + Fixed concurrency mode: the property is always validated at + write time + + + + + Allows the construction and modification of an entity container in an Entity Data Model (EDM) . + + + + + Gets all s declared within the namspace. Includes s and s. + + + + + Gets or sets the collection of s that specifies the association sets within the container. + + + + + Gets or sets the collection of s that specifies the entity sets within the container. + + + + + Allows the construction and modification of an entity set in an Entity Data Model (EDM) . + + + + + Gets or sets the that specifies the entity type for the set. + + + + + Allows the construction and modification of an entity type in an Entity Data Model (EDM) . + + + + + Gets or sets the optional that indicates the base entity type of the entity type. + + + + + Gets or sets a value indicating whether the entity type is abstract. + + + + + Gets or sets the collection of s that specifies the properties declared by the entity type. + + + + + Gets or sets the collection of s that indicates which properties from the collection are part of the entity key. + + + + + Gets or sets the optional collection of s that specifies the navigation properties declared by the entity type. + + + + + Indicates which Entity Data Model (EDM) concept is represented by a given item. + + + + + Association End Kind + + + + + Association Set Kind + + + + + Association Type Kind + + + + + Collection Type Kind + + + + + Complex Type Kind + + + + + Entity Container Kind + + + + + Entity Set Kind + + + + + Entity Type Kind + + + + + Function Group Kind + + + + + Function Overload Kind + + + + + Function Import Kind + + + + + Function Parameter Kind + + + + + Navigation Property Kind + + + + + EdmProperty Type Kind + + + + + Association Constraint Type Kind + + + + + Ref Type Kind + + + + + Row Column Kind + + + + + Row Type Kind + + + + + Type Reference Kind + + + + + Model Kind + + + + + Namespace Kind + + + + + Primitive Facets Kind + + + + + Primitive Type Kind + + + + + EdmModel is the top-level container for namespaces and entity containers belonging to the same logical Entity Data Model (EDM) model. + + + + + Gets or sets an optional value that indicates the entity model version. + + + + + Gets or sets the containers declared within the model. + + + + + Gets or sets the namespaces declared within the model. + + + + + Allows the construction and modification of a namespace in an . + + + + + Gets all s declared within the namspace. Includes s, s, s. + + + + + Gets or sets the s declared within the namespace. + + + + + Gets or sets the s declared within the namespace. + + + + + Gets or sets the s declared within the namespace. + + + + + Allows the construction and modification of an Entity Data Model (EDM) navigation property. + + + + + Gets or sets the that specifies the association over which navigation takes place. + + + + + Gets or sets the that specifies which association end is the 'destination' end of the navigation and produces the navigation property result. + + + + + Specifies the action to take on a given operation. + + + + + + Default behavior + + + + + Restrict the operation + + + + + Cascade the operation + + + + + Represents one of the fixed set of Entity Data Model (EDM) primitive types. + + + + + The base for all all Entity Data Model (EDM) types that represent a scalar type from the EDM type system. + + + + + Retrieves the EdmPrimitiveType instance with the corresponding to the specified value, if any. + + The name of the primitive type instance to retrieve + The EdmPrimitiveType with the specified name, if successful; otherwise null. + true if the given name corresponds to an EDM primitive type name; otherwise false. + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets the EdmPrimitiveType instance that represents the primitive type. + + + + + Gets an value that indicates which Entity Data Model (EDM) primitive type this type represents. + + + + + Allows the construction and modification of additional constraints that can be applied to a specific use of a primitive type in an Entity Data Model (EDM) item. See . + + + + + Returns true if any facet value property currently has a non-null value; otherwise returns false. + + + + + Gets or sets an optional value indicating the current constraint on the type's maximum length. + + + + + Gets or sets an optional value indicating whether the referenced type should be considered to have its intrinsic maximum length, rather than a specific value. + + + + + Gets or sets an optional value indicating whether the referenced type should be considered to have a fixed or variable length. + + + + + Gets or sets an optional value indicating whether the referenced type should be considered to be Unicode or non-Unicode. + + + + + Gets or sets an optional value indicating the current constraint on the type's precision. + + + + + Gets or sets an optional value indicating the current constraint on the type's scale. + + + + + Primitive Types as defined by the Entity Data Model (EDM). + + + + + Binary Type Kind + + + + + Boolean Type Kind + + + + + Byte Type Kind + + + + + DateTime Type Kind + + + + + Decimal Type Kind + + + + + Double Type Kind + + + + + Guid Type Kind + + + + + Single Type Kind + + + + + SByte Type Kind + + + + + Int16 Type Kind + + + + + Int32 Type Kind + + + + + Int64 Type Kind + + + + + String Type Kind + + + + + Time Type Kind + + + + + DateTimeOffset Type Kind + + + + + Allows the construction and modification of a primitive- or complex-valued property of an Entity Data Model (EDM) entity or complex type. + + + + + Gets or sets an value that indicates which collection semantics - if any - apply to the property. + + + + + Gets or sets a value that indicates whether the property is used for concurrency validation. + + + + + Gets or sets on optional value that indicates an initial default value for the property. + + + + + Gets or sets an that specifies the result type of the property. + + + + + Enumerates all s declared or inherited by an . + + + + + Allows the construction and modification of a specific use of a type in an Entity Data Model (EDM) item. See for examples. + + + + + Gets or sets a value indicating the collection rank of the type reference. A collection rank greater than zero indicates that the type reference represents a collection of its referenced . + + + + + Gets or sets a value indicating the referenced by this type reference. + + + + + Gets or sets an optional value indicating whether the referenced type should be considered nullable. + + + + + Gets or sets an optional instance that applies additional constraints to a referenced primitive type. + + Accessing this property forces the creation of an EdmPrimitiveTypeFacets value if no value has previously been set. Use to determine whether or not this property currently has a value. + + + + Gets a value indicating whether the property of this type reference has been assigned an value with at least one facet value specified. + + + + + Indicates whether this type reference represents a collection of its referenced (when is greater than zero) or not. + + + + + Indicates whether the property of this type reference currently refers to an , is not a collection type, and does not have primitive facet values specified. + + + + + Gets the currently referred to by this type reference, or null if the type reference is a collection type or does not refer to a complex type. + + + + + Indicates whether the property of this type reference currently refers to an and is not a collection type. + + + + + Gets the currently referred to by this type reference, or null if the type reference is a collection type or does not refer to a primitive type. + + + + + Contains constant values that apply to the EDM model, regardless of source (for CSDL specific constants see ). + + + + + Parsing code taken from System.dll's System.CodeDom.Compiler.CodeGenerator.IsValidLanguageIndependentIdentifier(string) + method to avoid LinkDemand needed to call this method + + + + + + + + + + + + Constants for CSDL XML. + + + + + Constants for C-S MSL XML. + + + + + Constants for SSDL XML. + + + + + The acceptable range for this enum is 0000 - 0999; the range 10,000-15,000 is reserved for tools. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Precision out of range + + + Scale out of range + + + + + + + + + One of the required facets is missing + + + + + + + + + + + + + + + + + + + + + + + + + The facet isn't allow by the property type. + + + + + This facet value is constant and is specified in the schema + + + + + + + + + + Multiplicity value was malformed + + + The value for the Action attribute is invalid or not allowed in the current context + + + An error occurred processing the On<Operation> elements + + + Ends were given for the Property element of a EntityContainer that is not a RelationshipSet + + + The extent name used in the EntittyContainerType End does not match the name of any of the EntityContainerProperties in the containing EntityContainer + + + An end element was not given, and cannot be inferred because too many EntityContainerEntitySet elements that are good possibilities. + + + An end element was not given, and cannot be inferred because there is no EntityContainerEntitySets that are the correct type to be used as an EntitySet. + + + Not a valid parameter direction for the parameter in a function + + + Unable to infer an optional schema part, to resolve this; be more explicit + + + Invalid facet attribute(s) specified in provider manifest + + + Invalid role value in the relationship constraint + + + Invalid Property in relationship constraint + + + Type mismatch between ToProperty and FromProperty in the relationship constraint + + + Invalid multiplicity in FromRole in the relationship constraint + + + The number of properties in the FromProperty and ToProperty in the relationship constraint must be identical + + + No Properties defined in either FromProperty or ToProperty in the relationship constraint + + + Missing constraint in relationship type in ssdl + + + Same role referred in the ToRole and FromRole of a referential constraint + + + Invalid value for attribute ParameterTypeSemantics + + + Invalid type used for a Relationship End Type + + + Invalid PrimitiveTypeKind + + + Invalid TypeConversion DestinationType + + + Expected a integer value between 0 - 255 + + + Invalid Type specified in function + + + Precision must not be greater than 28 + + + Properties that are part of entity key must be of scalar type + + + Binary type properties which are part of entity key are currently not supported + + + The primitive type kind does not have a preferred mapping + + + More than one PreferredMapping for a PrimitiveTypeKind + + + End with * multiplicity cannot have operations specified + + + EntitySet type has no keys + + + InvalidNumberOfParametersForAggregateFunction + + + InvalidParameterTypeForAggregateFunction + + + Composable functions must declare a return type. + + + Non-composable functions must not declare a return type. + + + Non-composable functions do not permit the aggregate; niladic; or built-in attributes. + + + Composable functions can not include command text attribute. + + + Functions should not declare both a store name and command text (only one or the other + can be used). + + + SystemNamespace + + + Empty DefiningQuery text + + + Schema, Table and DefiningQuery are all specified, and are mutually exclusive + + + ConcurrencyMode value was malformed + + + Concurrency can't change for any sub types of an EntitySet type. + + + Function import return type must be either empty, a collection of entities, or a singleton scalar. + + + Function import specifies a non-existent entity set. + + + Function import specifies entity type return but no entity set. + + + Function import specifies entity type that does not derive from element type of entity set. + + + Function import specifies a binding to an entity set but does not return entities. + + + InternalError + + + Same Entity Set Taking part in the same role of the relationship set in two different relationship sets + + + Entity key refers to the same property twice + + + Function declares a ReturnType attribute and element + + + Nullable Complex Type not supported in Edm V1 + + + Only Complex Collections supported in Edm V1.1 + + + No Key defined on Entity Type + + + Invalid namespace specified in using element + + + Need not specify system namespace in using + + + Cannot use a reserved/system namespace as alias + + + Invalid qualification specified for type + + + Invalid Entity Container Name in extends attribute + + + Invalid CollectionKind value in property CollectionKind attribute + + + Must specify namespace or alias of the schema in which this type is defined + + + Entity Container cannot extend itself + + + Failed to retrieve provider manifest + + + Mismatched Provider Manifest token values in SSDL artifacts + + + Missing Provider Manifest token value in SSDL artifact(s) + + + Empty CommandText element + + + Inconsistent Provider values in SSDL artifacts + + + Inconsistent Provider Manifest token values in SSDL artifacts + + + Duplicated Function overloads + + + InvalidProvider + + + FunctionWithNonEdmTypeNotSupported + + + ComplexTypeAsReturnTypeAndDefinedEntitySet + + + ComplexTypeAsReturnTypeAndDefinedEntitySet + + + unused 179, + unused 180, + unused 181, + In model functions facet attribute is allowed only on ScalarTypes + + + Captures several conditions where facets are placed on element where it should not exist. + + + Return type has not been declared + + + Invalid value in the EnumTypeOption + + + The structural annotation cannot use codegen namespaces + + + Function and type cannot have the same fully qualified name + + + Cannot load different version of schema in the same ItemCollection + + + Expected bool value + + + End without Multiplicity specified + + + In SSDL, if composable function returns a collection of rows (TVF), all row properties must be of scalar types. + + + The name of NamedEdmItem must not be empty or white space only + + + EdmTypeReference is empty + Unused 199; + + + + Serializes an that conforms to the restrictions of a single CSDL schema file to an XML writer. + The model to be serialized must contain a single and a single . + + + + + The CSDL Serializer for the EdmModel. + + + + + Serialize the to the XmlWriter. + + The EdmModel to serialize, mut have only one and one + The XmlWriter to serialize to + + + + MSL Serializer for DbModel + + + + + Serialize the to the XmlWriter + + The DbModel to serialize + The XmlWriter to serialize to + + + + SSDL Serializer for DbDatabaseMetadata + + + + + Serialize the to the + + The DbDatabaseMetadata to serialize + Provider information on the Schema element + ProviderManifestToken information on the Schema element + The XmlWriter to serialize to + + + + author/email + + + author/name + + + author/uri + + + published + + + rights + + + summary + + + title + + + contributor/email + + + contributor/name + + + contributor/uri + + + category/@label + + + Plaintext + + + HTML + + + XHTML + + + updated + + + link/@href + + + link/@rel + + + link/@type + + + link/@hreflang + + + link/@title + + + link/@length + + + category/@term + + + category/@scheme + + + + Return role name pair + + + + + + + + The context for DataModel Validation + + + + + Returns true if the given two ends are similar - the relationship type that this ends belongs to is the same + and the entity set refered by the ends are same and they are from the same role + + + + + + + + Return true if the Referential Constraint on the association is ready for further validation, otherwise return false. + + + + + + + Resolves the given property names to the property in the item + Also checks whether the properties form the key for the given type and whether all the properties are nullable or not + + + + + + + + + + + Return true if the namespaceName is a Edm System Namespace + + + + + + + Return true if the entityType is a subtype of any entity type in the dictionary keys, + and return the corresponding entry EntitySet value. Otherwise return false. + + + + + + + + + Return true if any of the properties in the EdmEntityType defines ConcurrencyMode. Otherwise return false. + + + + + + + Add member name to the Hash set, raise an error if the name exists already. + + + + + + + + + If the string is null, empty, or only whitespace, return false, otherwise return true + + + + + + + Determine if a cycle exists in the type hierarchy: use two pointers to + walk the chain, if one catches up with the other, we have a cycle. + + true if a cycle exists in the type hierarchy, false otherwise + + + + RuleSet for DataModel Validation + + + + + Get the related rules given certain DataModelItem + + The to validate + A collection of + + + + Data Model Validator + + + + + Validate the and all of its properties given certain version. + + The root of the model to be validated + True to validate the syntax, otherwise false + + + + The RuleSet for EdmModel + + + + + Get based on version + + a double value of version + + + + + The context for EdmModel Validation + + + + + Visitor for EdmModel Validation + + + + + Edm Model Validator + + + + + validate the from the root with the context + + The root to validate from + The validation context + + + + Strongly-typed and parameterized string resources. + + + + + A string like "The argument '{0}' cannot be null, empty or contain only white space." + + + + + A string like "The argument property '{0}' cannot be null." + + + + + A string like "The type '{0}' has already been configured as a complex type. It cannot be reconfigured as an entity type." + + + + + A string like "The type '{0}' has already been configured as an entity type. It cannot be reconfigured as a complex type." + + + + + A string like "The key component '{0}' is not a declared property on type '{1}'. Verify that it has not been explicitly excluded from the model and that it is a valid primitive property." + + + + + A string like "The foreign key component '{0}' is not a declared property on type '{1}'. Verify that it has not been explicitly excluded from the model and that it is a valid primitive property." + + + + + A string like "The property '{0}' is not a declared property on type '{1}'. Verify that the property has not been explicitly excluded from the model by using the Ignore method or NotMappedAttribute data annotation. Make sure that it is a valid primitive property." + + + + + A string like "The navigation property '{0}' is not a declared property on type '{1}'. Verify that it has not been explicitly excluded from the model and that it is a valid navigation property." + + + + + A string like "The expression '{0}' is not a valid property expression. The expression should represent a property: C#: 't => t.MyProperty' VB.Net: 'Function(t) t.MyProperty'." + + + + + A string like "The expression '{0}' is not a valid property expression. The expression should represent a property: C#: 't => t.MyProperty' VB.Net: 'Function(t) t.MyProperty'. Use dotted paths for nested properties: C#: 't => t.MyProperty.MyProperty' VB.Net: 'Function(t) t.MyProperty.MyProperty'." + + + + + A string like "The properties expression '{0}' is not valid. The expression should represent a property: C#: 't => t.MyProperty' VB.Net: 'Function(t) t.MyProperty'. When specifying multiple properties use an anonymous type: C#: 't => new {{ t.MyProperty1, t.MyProperty2 }}' VB.Net: 'Function(t) New From {{ t.MyProperty1, t.MyProperty2 }}'." + + + + + A string like "The properties expression '{0}' is not valid. The expression should represent a property: C#: 't => t.MyProperty' VB.Net: 'Function(t) t.MyProperty'. When specifying multiple properties use an anonymous type: C#: 't => new {{ t.MyProperty1, t.MyProperty2 }}' VB.Net: 'Function(t) New From {{ t.MyProperty1, t.MyProperty2 }}'." + + + + + + A string like "Conflicting configuration settings were specified for property '{0}' on type '{1}': {2}" + + + + + A string like "Conflicting configuration settings were specified for column '{0}' on table '{1}': {2}" + + + + + A string like "{0} = {1} conflicts with {2} = {3}" + + + + + A string like "The type '{0}' was not mapped. Check that the type has not been explicitly excluded by using the Ignore method or NotMappedAttribute data annotation. Verify that the type was defined as a class, is not primitive, nested or generic, and does not inherit from ComplexObject." + + + + + A string like "The type '{0}' was not mapped. Check that the type has not been explicitly excluded by using the Ignore method or NotMappedAttribute data annotation. Verify that the type was defined as a class, is not primitive, nested or generic, and does not inherit from EntityObject." + + + + + A string like "The navigation property '{0}' declared on type '{1}' cannot be the inverse of itself." + + + + + A string like "The navigation property '{0}' declared on type '{1}' has been configured with conflicting foreign keys." + + + + + A string like "Values of incompatible types ('{1}' and '{2}') were assigned to the '{0}' discriminator column. Values of the same type must be specified. To explicitly specify the type of the discriminator column use the HasColumnType method." + + + + + A string like "The navigation property '{0}' declared on type '{1}' has been configured with conflicting mapping information." + + + + + A string like "The navigation property '{0}' declared on type '{1}' has been configured with conflicting cascade delete operations using 'WillCascadeOnDelete'." + + + + + A string like "The navigation property '{0}' declared on type '{1}' has been configured with conflicting multiplicities." + + + + + A string like "The MaxLengthAttribute on property '{0}' on type '{1} is not valid. The Length value must be greater than zero. Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length." + + + + + A string like "The StringLengthAttribute on property '{0}' on type '{1}' is not valid. The maximum length must be greater than zero. Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length." + + + + + A string like "Unable to determine composite primary key ordering for type '{0}'. Use the ColumnAttribute or the HasKey method to specify an order for composite primary keys." + + + + + A string like "The ForeignKeyAttribute on property '{0}' on type '{1}' is not valid. Name must not be empty." + + + + + A string like "The ForeignKeyAttribute on property '{0}' on type '{1}' is not valid. The foreign key name '{2}' was not found on the dependent type '{3}'. The Name value should be a comma separated list of foreign key property names." + + + + + A string like "The ForeignKeyAttribute on property '{0}' on type '{1}' is not valid. The navigation property '{2}' was not found on the dependent type '{1}'. The Name value should be a valid navigation property name." + + + + + A string like "Unable to determine a composite foreign key ordering for foreign key on type {0}. When using the ForeignKey data annotation on composite foreign key properties ensure order is specified by using the Column data annotation or the fluent API." + + + + + A string like "The InversePropertyAttribute on property '{2}' on type '{3}' is not valid. The property '{0}' is not a valid navigation property on the related type '{1}'. Ensure that the property exists and is a valid reference or collection navigation property." + + + + + A string like "A relationship cannot be established from property '{0}' on type '{1}' to property '{0}' on type '{1}'. Check the values in the InversePropertyAttribute to ensure relationship definitions are unique and reference from one navigation property to its corresponding inverse navigation property." + + + + + A string like "\t{0}: {1}: {2}" + + + + + A string like "A key is registered for the derived type '{0}'. Keys can only be registered for the root type '{1}'." + + + + + A string like "The {0} value '{1}' already exists in the user-defined dictionary." + + + + + A string like "The type '{0}' has already been mapped to table '{1}'. Specify all mapping aspects of a table in a single Map call." + + + + + A string like "Map was called more than once for type '{0}' and at least one of the calls didn't specify the target table name." + + + + + A string like "The derived type '{0}' has already been mapped using the chaining syntax. A derived type can only be mapped once using the chaining syntax." + + + + + A string like "An "is not null" condition cannot be specified on property '{0}' on type '{1}' because this property is not included in the model. Check that the property has not been explicitly excluded from the model by using the Ignore method or NotMappedAttribute data annotation." + + + + + A string like "Values of type '{0}' cannot be used as type discriminator values. Supported types include byte, signed byte, bool, int16, int32, int64, and string." + + + + + A string like "Unable to add the convention '{0}'. Could not find an existing convention of type '{1}' in the current convention set." + + + + + A string like "Not all properties for type '{0}' have been mapped. Either map those properties or explicitly excluded them from the model." + + + + + A string like "Unable to determine the provider name for connection of type '{0}'." + + + + + A string like "The qualified table name '{0}' contains an invalid schema name. Schema names must have a non-zero length." + + + + + A string like "The qualified table name '{0}' contains an invalid table name. Table names must have a non-zero length." + + + + + A string like "Properties for type '{0}' can only be mapped once. Ensure the MapInheritedProperties method is only used during one call to the Map method." + + + + + A string like "Properties for type '{0}' can only be mapped once. Ensure the Properties method is used and that repeated calls specify each non-key property only once." + + + + + A string like "Properties for type '{0}' can only be mapped once. The non-key property '{1}' is mapped more than once. Ensure the Properties method specifies each non-key property only once." + + + + + A string like "The property '{1}' on type '{0}' cannot be mapped because it has been explicitly excluded from the model." + + + + + A string like "The entity types '{0}' and '{1}' cannot share table '{2}' because they are not in the same type hierarchy or do not have a valid one to one foreign key relationship with matching primary keys between them." + + + + + A string like "The property '{0}' cannot be used as a key property on the entity '{1}' because the property type is not a valid key type. Only scalar types, string and byte[] are supported key types." + + + + + A string like "The specified table '{0}' was not found in the model. Ensure that the table name has been correctly specified." + + + + + A string like "The specified association foreign key columns '{0}' are invalid. The number of columns specified must match the number of primary key columns." + + + + + A string like "Unable to determine the principal end of an association between the types '{0}' and '{1}'. The principal end of this association must be explicitly configured using either the relationship fluent API or data annotations." + + + + + A string like "The abstract type '{0}' has no mapped descendents and so cannot be mapped. Either remove '{0}' from the model or add one or more types deriving from '{0}' to the model. " + + + + + A string like "The type '{0}' cannot be mapped as defined because it maps inherited properties from types that use entity splitting or another form of inheritance. Either choose a different inheritance mapping strategy so as to not map inherited properties, or change all types in the hierarchy to map inherited properties and to not use splitting. " + + + + + A string like "One or more validation errors were detected during model generation:" + + + + + A string like "A circular ComplexType hierarchy was detected. Self-referencing ComplexTypes are not supported." + + + + + Strongly-typed and parameterized exception factory. + + + + + ArgumentException with message like "The argument '{0}' cannot be null, empty or contain only white space." + + + + + ArgumentException with message like "The argument property '{0}' cannot be null." + + + + + InvalidOperationException with message like "The type '{0}' has already been configured as a complex type. It cannot be reconfigured as an entity type." + + + + + InvalidOperationException with message like "The type '{0}' has already been configured as an entity type. It cannot be reconfigured as a complex type." + + + + + InvalidOperationException with message like "The key component '{0}' is not a declared property on type '{1}'. Verify that it has not been explicitly excluded from the model and that it is a valid primitive property." + + + + + InvalidOperationException with message like "The foreign key component '{0}' is not a declared property on type '{1}'. Verify that it has not been explicitly excluded from the model and that it is a valid primitive property." + + + + + InvalidOperationException with message like "The property '{0}' is not a declared property on type '{1}'. Verify that the property has not been explicitly excluded from the model by using the Ignore method or NotMappedAttribute data annotation. Make sure that it is a valid primitive property." + + + + + InvalidOperationException with message like "The navigation property '{0}' is not a declared property on type '{1}'. Verify that it has not been explicitly excluded from the model and that it is a valid navigation property." + + + + + InvalidOperationException with message like "The expression '{0}' is not a valid property expression. The expression should represent a property: C#: 't => t.MyProperty' VB.Net: 'Function(t) t.MyProperty'." + + + + + InvalidOperationException with message like "The expression '{0}' is not a valid property expression. The expression should represent a property: C#: 't => t.MyProperty' VB.Net: 'Function(t) t.MyProperty'. Use dotted paths for nested properties: C#: 't => t.MyProperty.MyProperty' VB.Net: 'Function(t) t.MyProperty.MyProperty'." + + + + + InvalidOperationException with message like "The properties expression '{0}' is not valid. The expression should represent a property: C#: 't => t.MyProperty' VB.Net: 'Function(t) t.MyProperty'. When specifying multiple properties use an anonymous type: C#: 't => new {{ t.MyProperty1, t.MyProperty2 }}' VB.Net: 'Function(t) New From {{ t.MyProperty1, t.MyProperty2 }}'." + + + + + InvalidOperationException with message like "The properties expression '{0}' is not valid. The expression should represent a property: C#: 't => t.MyProperty' VB.Net: 'Function(t) t.MyProperty'. When specifying multiple properties use an anonymous type: C#: 't => new {{ t.MyProperty1, t.MyProperty2 }}' VB.Net: 'Function(t) New From {{ t.MyProperty1, t.MyProperty2 }}'." + + + + + + InvalidOperationException with message like "Conflicting configuration settings were specified for property '{0}' on type '{1}': {2}" + + + + + InvalidOperationException with message like "Conflicting configuration settings were specified for column '{0}' on table '{1}': {2}" + + + + + InvalidOperationException with message like "The type '{0}' was not mapped. Check that the type has not been explicitly excluded by using the Ignore method or NotMappedAttribute data annotation. Verify that the type was defined as a class, is not primitive, nested or generic, and does not inherit from ComplexObject." + + + + + InvalidOperationException with message like "The type '{0}' was not mapped. Check that the type has not been explicitly excluded by using the Ignore method or NotMappedAttribute data annotation. Verify that the type was defined as a class, is not primitive, nested or generic, and does not inherit from EntityObject." + + + + + InvalidOperationException with message like "The navigation property '{0}' declared on type '{1}' cannot be the inverse of itself." + + + + + InvalidOperationException with message like "The navigation property '{0}' declared on type '{1}' has been configured with conflicting foreign keys." + + + + + MappingException with message like "Values of incompatible types ('{1}' and '{2}') were assigned to the '{0}' discriminator column. Values of the same type must be specified. To explicitly specify the type of the discriminator column use the HasColumnType method." + + + + + InvalidOperationException with message like "The navigation property '{0}' declared on type '{1}' has been configured with conflicting mapping information." + + + + + InvalidOperationException with message like "The navigation property '{0}' declared on type '{1}' has been configured with conflicting cascade delete operations using 'WillCascadeOnDelete'." + + + + + InvalidOperationException with message like "The navigation property '{0}' declared on type '{1}' has been configured with conflicting multiplicities." + + + + + InvalidOperationException with message like "The MaxLengthAttribute on property '{0}' on type '{1} is not valid. The Length value must be greater than zero. Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length." + + + + + InvalidOperationException with message like "The StringLengthAttribute on property '{0}' on type '{1}' is not valid. The maximum length must be greater than zero. Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length." + + + + + InvalidOperationException with message like "Unable to determine composite primary key ordering for type '{0}'. Use the ColumnAttribute or the HasKey method to specify an order for composite primary keys." + + + + + InvalidOperationException with message like "The ForeignKeyAttribute on property '{0}' on type '{1}' is not valid. Name must not be empty." + + + + + InvalidOperationException with message like "The ForeignKeyAttribute on property '{0}' on type '{1}' is not valid. The foreign key name '{2}' was not found on the dependent type '{3}'. The Name value should be a comma separated list of foreign key property names." + + + + + InvalidOperationException with message like "The ForeignKeyAttribute on property '{0}' on type '{1}' is not valid. The navigation property '{2}' was not found on the dependent type '{1}'. The Name value should be a valid navigation property name." + + + + + InvalidOperationException with message like "Unable to determine a composite foreign key ordering for foreign key on type {0}. When using the ForeignKey data annotation on composite foreign key properties ensure order is specified by using the Column data annotation or the fluent API." + + + + + InvalidOperationException with message like "The InversePropertyAttribute on property '{2}' on type '{3}' is not valid. The property '{0}' is not a valid navigation property on the related type '{1}'. Ensure that the property exists and is a valid reference or collection navigation property." + + + + + InvalidOperationException with message like "A relationship cannot be established from property '{0}' on type '{1}' to property '{0}' on type '{1}'. Check the values in the InversePropertyAttribute to ensure relationship definitions are unique and reference from one navigation property to its corresponding inverse navigation property." + + + + + InvalidOperationException with message like "A key is registered for the derived type '{0}'. Keys can only be registered for the root type '{1}'." + + + + + InvalidOperationException with message like "The type '{0}' has already been mapped to table '{1}'. Specify all mapping aspects of a table in a single Map call." + + + + + InvalidOperationException with message like "Map was called more than once for type '{0}' and at least one of the calls didn't specify the target table name." + + + + + InvalidOperationException with message like "The derived type '{0}' has already been mapped using the chaining syntax. A derived type can only be mapped once using the chaining syntax." + + + + + InvalidOperationException with message like "An "is not null" condition cannot be specified on property '{0}' on type '{1}' because this property is not included in the model. Check that the property has not been explicitly excluded from the model by using the Ignore method or NotMappedAttribute data annotation." + + + + + ArgumentException with message like "Values of type '{0}' cannot be used as type discriminator values. Supported types include byte, signed byte, bool, int16, int32, int64, and string." + + + + + InvalidOperationException with message like "Unable to add the convention '{0}'. Could not find an existing convention of type '{1}' in the current convention set." + + + + + InvalidOperationException with message like "Not all properties for type '{0}' have been mapped. Either map those properties or explicitly excluded them from the model." + + + + + NotSupportedException with message like "Unable to determine the provider name for connection of type '{0}'." + + + + + ArgumentException with message like "The qualified table name '{0}' contains an invalid schema name. Schema names must have a non-zero length." + + + + + ArgumentException with message like "The qualified table name '{0}' contains an invalid table name. Table names must have a non-zero length." + + + + + InvalidOperationException with message like "Properties for type '{0}' can only be mapped once. Ensure the MapInheritedProperties method is only used during one call to the Map method." + + + + + InvalidOperationException with message like "Properties for type '{0}' can only be mapped once. Ensure the Properties method is used and that repeated calls specify each non-key property only once." + + + + + InvalidOperationException with message like "Properties for type '{0}' can only be mapped once. The non-key property '{1}' is mapped more than once. Ensure the Properties method specifies each non-key property only once." + + + + + InvalidOperationException with message like "The property '{1}' on type '{0}' cannot be mapped because it has been explicitly excluded from the model." + + + + + InvalidOperationException with message like "The entity types '{0}' and '{1}' cannot share table '{2}' because they are not in the same type hierarchy or do not have a valid one to one foreign key relationship with matching primary keys between them." + + + + + InvalidOperationException with message like "The property '{0}' cannot be used as a key property on the entity '{1}' because the property type is not a valid key type. Only scalar types, string and byte[] are supported key types." + + + + + InvalidOperationException with message like "The specified table '{0}' was not found in the model. Ensure that the table name has been correctly specified." + + + + + InvalidOperationException with message like "The specified association foreign key columns '{0}' are invalid. The number of columns specified must match the number of primary key columns." + + + + + InvalidOperationException with message like "A circular ComplexType hierarchy was detected. Self-referencing ComplexTypes are not supported." + + + + + InvalidOperationException with message like "Unable to determine the principal end of an association between the types '{0}' and '{1}'. The principal end of this association must be explicitly configured using either the relationship fluent API or data annotations." + + + + + InvalidOperationException with message like "The abstract type '{0}' has no mapped descendents and so cannot be mapped. Either remove '{0}' from the model or add one or more types deriving from '{0}' to the model. " + + + + + NotSupportedException with message like "The type '{0}' cannot be mapped as defined because it maps inherited properties from types that use entity splitting or another form of inheritance. Either choose a different inheritance mapping strategy so as to not map inherited properties, or change all types in the hierarchy to map inherited properties and to not use splitting. " + + + + + The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. + + + + + The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. + + + + + The exception that is thrown when the author has yet to implement the logic at this point in the program. This can act as an exception based TODO tag. + + + + + The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality. + + + + + Strongly-typed and parameterized string resources. + + + + + A string like "Cannot get value for property '{0}' from entity of type '{1}' because the property has no get accessor." + + + + + A string like "Cannot set value for property '{0}' on entity of type '{1}' because the property has no set accessor." + + + + + + A string like "Cannot set value for property '{0}' on entity of type '{1}' because the property has no set accessor and is in the '{2}' state." + + + + + A string like "Member '{0}' cannot be called for property '{1}' on entity of type '{2}' because the property is not part of the Entity Data Model." + + + + + + A string like "Cannot call the {0} method for an entity of type '{1}' on a DbSet for entities of type '{2}'. Only entities of type '{2}' or derived from type '{2}' can be added, attached, or removed." + + + + + A string like "Cannot call the Create method for the type '{0}' on a DbSet for entities of type '{1}'. Only entities of type '{1}' or derived from type '{1}' can be created." + + + + + + + A string like "The property '{0}' on type '{1}' is a collection navigation property. The Collection method should be used instead of the Reference method." + + + + + A string like "The property '{0}' on type '{1}' is a reference navigation property. The Reference method should be used instead of the Collection method." + + + + + A string like "The property '{0}' on type '{1}' is not a navigation property. The Reference and Collection methods can only be used with navigation properties. Use the Property or ComplexProperty method." + + + + + A string like "The property '{0}' on type '{1}' is not a primitive or complex property. The Property method can only be used with primitive or complex properties. Use the Reference or Collection method." + + + + + A string like "The property '{0}' on type '{1}' is not a complex property. The ComplexProperty method can only be used with complex properties. Use the Property, Reference or Collection method." + + + + + A string like "The property '{0}' on type '{1}' is not a primitive property, complex property, collection navigation property, or reference navigation property." + + + + + A string like ""The property '{0}' from the property path '{1}' is not a complex property on type '{2}'. Property paths must be composed of complex properties for all except the final property."" + + + + + A string like ""The property path '{0}' cannot be used for navigation properties. Property paths can only be used to access primitive or complex properties."" + + + + + A string like "The navigation property '{0}' on entity type '{1}' cannot be used for entities of type '{2}' because it refers to entities of type '{3}'." + + + + + A string like "The generic type argument '{0}' cannot be used with the Member method when accessing the collection navigation property '{1}' on entity type '{2}'. The generic type argument '{3}' must be used instead." + + + + + A string like "The property '{0}' on entity type '{1}' cannot be used for objects of type '{2}' because it is a property for objects of type '{3}'." + + + + + A string like "The expression passed to method {0} must represent a property defined on the type '{1}'." + + + + + A string like "{0} cannot be used for entities in the {1} state." + + + + + A string like "Cannot set non-nullable property '{0}' of type '{1}' to null on object of type '{2}'." + + + + + A string like "The property '{0}' in the entity of type '{1}' is null. Store values cannot be obtained for an entity with a null complex property." + + + + + A string like "Cannot assign value of type '{0}' to property '{1}' of type '{2}' in property values for type '{3}'." + + + + + A string like "The '{0}' property does not exist or is not mapped for the type '{1}'." + + + + + A string like "Cannot copy values from DbPropertyValues for type '{0}' into DbPropertyValues for type '{1}'." + + + + + A string like "Cannot copy from property values for object of type '{0}' into property values for object of type '{1}'." + + + + + A string like "The value of the complex property '{0}' on entity of type '{1}' is null. Complex properties cannot be set to null and values cannot be set for null complex properties." + + + + + A string like "The value of the nested property values property '{0}' on the values for entity of type '{1}' is null. Nested property values cannot be set to null and values cannot be set for null complex properties." + + + + + A string like "The model backing the '{0}' context has changed since the database was created. Either manually delete/update the database, or call Database.SetInitializer with an IDatabaseInitializer instance. For example, the DropCreateDatabaseIfModelChanges strategy will automatically delete and recreate the database, and optionally seed it with new data." + + + + + A string like "The DbContextDatabaseInitializer entry 'key="{0}" value="{1}"' in the application configuration is not valid. Entries should be of the form 'key="DatabaseInitializerForType MyNamespace.MyDbContextClass, MyAssembly" value="MyNamespace.MyInitializerClass, MyAssembly"' or 'key="DatabaseInitializerForType MyNamespace.MyDbContextClass, MyAssembly" value="Disabled"'." + + + + + A string like "Failed to set database initializer of type '{0}' for DbContext type '{1}' specified in the application configuration. Entries should be of the form 'key="DatabaseInitializerForType MyNamespace.MyDbContextClass, MyAssembly" value="MyNamespace.MyInitializerClass, MyAssembly"' or 'key="DatabaseInitializerForType MyNamespace.MyDbContextClass, MyAssembly" value="Disabled"'. The initializer class must have a parameterless constructor. See inner exception for details." + + + + + A string like "The type '{0}' could not be found. The type name must be an assembly-qualified name." + + + + + A string like "The connection string '{0}' in the application's configuration file does not contain the required providerName attribute."" + + + + + A string like "The entity found was of type {0} when an entity of type {1} was requested." + + + + + A string like "The type '{0}' is mapped as a complex type. The Set method, DbSet objects, and DbEntityEntry objects can only be used with entity types, not complex types." + + + + + A string like "The type '{0}' is not attributed with EdmEntityTypeAttribute but is contained in an assembly attributed with EdmSchemaAttribute. POCO entities that do not use EdmEntityTypeAttribute cannot be contained in the same assembly as non-POCO entities that use EdmEntityTypeAttribute." + + + + + A string like "The entity type {0} is not part of the model for the current context." + + + + + A string like "No connection string named '{0}' could be found in the application config file." + + + + + A string like "The collection navigation property '{0}' on the entity of type '{1}' cannot be set because the entity type does not define a navigation property with a set accessor." + + + + + A string like "Multiple object sets per type are not supported. The object sets '{0}' and '{1}' can both contain instances of type '{2}'." + + + + + A string like "The context type '{0}' must have a public constructor taking an EntityConnection." + + + + + A string like "An unexpected exception was thrown during validation of '{0}' when invoking {1}.IsValid. See the inner exception for details." + + + + + A string like "An unexpected exception was thrown during validation of '{0}' when invoking {1}.Validate. See the inner exception for details." + + + + + A string like "The database name '{0}' is not supported because it is an MDF file name. A full connection string must be provided to attach an MDF file." + + + + + A string like "Setting IsModified to false for a modified property is not supported." + + + + + A string like "An error occurred while saving entities that do not expose foreign key properties for their relationships. The EntityEntries property will return null because a single entity cannot be identified as the source of the exception. Handling of exceptions while saving can be made easier by exposing foreign key properties in your entity types. See the InnerException for details." + + + + + A string like "The set of property value names is read-only." + + + + + A string like "A property of a complex type must be set to an instance of the generic or non-generic DbPropertyValues class for that type." + + + + + A string like "Model compatibility cannot be checked because the DbContext instance was not created using Code First patterns. DbContext instances created from an ObjectContext or using an EDMX file cannot be checked for compatibility." + + + + + A string like "Model compatibility cannot be checked because the EdmMetadata type was not included in the model. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions." + + + + + A string like "Model compatibility cannot be checked because the database does not contain model metadata. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions." + + + + + A string like "The context cannot be used while the model is being created." + + + + + A string like "The DbContext class cannot be used with models that have multiple entity sets per type (MEST)." + + + + + A string like "The operation cannot be completed because the DbContext has been disposed." + + + + + A string like "The provider factory returned a null connection." + + + + + A string like "The DbConnectionFactory instance returned a null connection." + + + + + A string like "The number of primary key values passed must match number of primary key values defined on the entity." + + + + + A string like "The type of one of the primary key values did not match the type defined in the entity. See inner exception for details." + + + + + A string like "Multiple entities were found in the Added state that match the given primary key values." + + + + + A string like "Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery) is not supported. Instead populate a DbSet with data, for example by calling Load on the DbSet, and then bind to local data. For WPF bind to DbSet.Local. For WinForms bind to DbSet.Local.ToBindingList()." + + + + + A string like "The Include path expression must refer to a navigation property defined on the type. Use dotted paths for reference navigation properties and the Select operator for collection navigation properties." + + + + + A string like "Cannot initialize a DbContext from an entity connection string or an EntityConnection instance together with a DbCompiledModel. If an entity connection string or EntityConnection instance is used, then the model will be created from the metadata in the connection. If a DbCompiledModel is used, then the connection supplied should be a standard database connection (for example, a SqlConnection instance) rather than an entity connection." + + + + + A string like "Using the same DbCompiledModel to create contexts against different types of database servers is not supported. Instead, create a separate DbCompiledModel for each type of server being used." + + + + + A string like "Validation failed for one or more entities. See 'EntityValidationErrors' property for more details." + + + + + A string like "An exception occurred while initializing the database. See the InnerException for details." + + + + + A string like "Creating a DbModelBuilder or writing the EDMX from a DbContext created using an existing ObjectContext is not supported. EDMX can only be obtained from a Code First DbContext created without using an existing DbCompiledModel." + + + + + A string like "Creating a DbModelBuilder or writing the EDMX from a DbContext created using an existing DbCompiledModel is not supported. EDMX can only be obtained from a Code First DbContext created without using an existing DbCompiledModel." + + + + + A string like "Creating a DbModelBuilder or writing the EDMX from a DbContext created using Database First or Model First is not supported. EDMX can only be obtained from a Code First DbContext created without using an existing DbCompiledModel." + + + + + A string like "Code generated using the T4 templates for Database First and Model First development may not work correctly if used in Code First mode. To continue using Database First or Model First ensure that the Entity Framework connection string is specified in the config file of executing application. To use these classes, that were generated from Database First or Model First, with Code First add any additional configuration using attributes or the DbModelBuilder API and then remove the code that throws this exception." + + + + + Strongly-typed and parameterized exception factory. + + + + + InvalidOperationException with message like "Cannot get value for property '{0}' from entity of type '{1}' because the property has no get accessor." + + + + + InvalidOperationException with message like "Cannot set value for property '{0}' on entity of type '{1}' because the property has no set accessor." + + + + + + NotSupportedException with message like "Cannot set value for property '{0}' on entity of type '{1}' because the property has no set accessor and is in the '{2}' state." + + + + + InvalidOperationException with message like "Member '{0}' cannot be called for property '{1}' on entity of type '{2}' because the property is not part of the Entity Data Model." + + + + + + ArgumentException with message like "Cannot call the {0} method for an entity of type '{1}' on a DbSet for entities of type '{2}'. Only entities of type '{2}' or derived from type '{2}' can be added, attached, or removed." + + + + + ArgumentException with message like "Cannot call the Create method for the type '{0}' on a DbSet for entities of type '{1}'. Only entities of type '{1}' or derived from type '{1}' can be created." + + + + + + + ArgumentException with message like "The property '{0}' on type '{1}' is a collection navigation property. The Collection method should be used instead of the Reference method." + + + + + ArgumentException with message like "The property '{0}' on type '{1}' is a reference navigation property. The Reference method should be used instead of the Collection method." + + + + + ArgumentException with message like "The property '{0}' on type '{1}' is not a navigation property. The Reference and Collection methods can only be used with navigation properties. Use the Property or ComplexProperty method." + + + + + ArgumentException with message like "The property '{0}' on type '{1}' is not a primitive or complex property. The Property method can only be used with primitive or complex properties. Use the Reference or Collection method." + + + + + ArgumentException with message like "The property '{0}' on type '{1}' is not a complex property. The ComplexProperty method can only be used with complex properties. Use the Property, Reference or Collection method." + + + + + ArgumentException with message like "The property '{0}' on type '{1}' is not a primitive property, complex property, collection navigation property, or reference navigation property." + + + + + ArgumentException with message like ""The property '{0}' from the property path '{1}' is not a complex property on type '{2}'. Property paths must be composed of complex properties for all except the final property."" + + + + + ArgumentException with message like ""The property path '{0}' cannot be used for navigation properties. Property paths can only be used to access primitive or complex properties."" + + + + + ArgumentException with message like "The navigation property '{0}' on entity type '{1}' cannot be used for entities of type '{2}' because it refers to entities of type '{3}'." + + + + + ArgumentException with message like "The generic type argument '{0}' cannot be used with the Member method when accessing the collection navigation property '{1}' on entity type '{2}'. The generic type argument '{3}' must be used instead." + + + + + ArgumentException with message like "The property '{0}' on entity type '{1}' cannot be used for objects of type '{2}' because it is a property for objects of type '{3}'." + + + + + NotSupportedException with message like "Setting IsModified to false for a modified property is not supported." + + + + + ArgumentException with message like "The expression passed to method {0} must represent a property defined on the type '{1}'." + + + + + InvalidOperationException with message like "{0} cannot be used for entities in the {1} state." + + + + + InvalidOperationException with message like "Cannot set non-nullable property '{0}' of type '{1}' to null on object of type '{2}'." + + + + + InvalidOperationException with message like "The property '{0}' in the entity of type '{1}' is null. Store values cannot be obtained for an entity with a null complex property." + + + + + InvalidOperationException with message like "Cannot assign value of type '{0}' to property '{1}' of type '{2}' in property values for type '{3}'." + + + + + NotSupportedException with message like "The set of property value names is read-only." + + + + + ArgumentException with message like "The '{0}' property does not exist or is not mapped for the type '{1}'." + + + + + ArgumentException with message like "Cannot copy values from DbPropertyValues for type '{0}' into DbPropertyValues for type '{1}'." + + + + + ArgumentException with message like "Cannot copy from property values for object of type '{0}' into property values for object of type '{1}'." + + + + + ArgumentException with message like "A property of a complex type must be set to an instance of the generic or non-generic DbPropertyValues class for that type." + + + + + InvalidOperationException with message like "The value of the complex property '{0}' on entity of type '{1}' is null. Complex properties cannot be set to null and values cannot be set for null complex properties." + + + + + InvalidOperationException with message like "The value of the nested property values property '{0}' on the values for entity of type '{1}' is null. Nested property values cannot be set to null and values cannot be set for null complex properties." + + + + + InvalidOperationException with message like "The model backing the '{0}' context has changed since the database was created. Either manually delete/update the database, or call Database.SetInitializer with an IDatabaseInitializer instance. For example, the DropCreateDatabaseIfModelChanges strategy will automatically delete and recreate the database, and optionally seed it with new data." + + + + + NotSupportedException with message like "Model compatibility cannot be checked because the DbContext instance was not created using Code First patterns. DbContext instances created from an ObjectContext or using an EDMX file cannot be checked for compatibility." + + + + + NotSupportedException with message like "Model compatibility cannot be checked because the EdmMetadata type was not included in the model. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions." + + + + + NotSupportedException with message like "Model compatibility cannot be checked because the database does not contain model metadata. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions." + + + + + InvalidOperationException with message like "The DbContextDatabaseInitializer entry 'key="{0}" value="{1}"' in the application configuration is not valid. Entries should be of the form 'key="DatabaseInitializerForType MyNamespace.MyDbContextClass, MyAssembly" value="MyNamespace.MyInitializerClass, MyAssembly"' or 'key="DatabaseInitializerForType MyNamespace.MyDbContextClass, MyAssembly" value="Disabled"'." + + + + + InvalidOperationException with message like "Failed to set database initializer of type '{0}' for DbContext type '{1}' specified in the application configuration. Entries should be of the form 'key="DatabaseInitializerForType MyNamespace.MyDbContextClass, MyAssembly" value="MyNamespace.MyInitializerClass, MyAssembly"' or 'key="DatabaseInitializerForType MyNamespace.MyDbContextClass, MyAssembly" value="Disabled"'. The initializer class must have a parameterless constructor. See inner exception for details." + + + + + InvalidOperationException with message like "The type '{0}' could not be found. The type name must be an assembly-qualified name." + + + + + InvalidOperationException with message like "The context cannot be used while the model is being created." + + + + + InvalidOperationException with message like "The DbContext class cannot be used with models that have multiple entity sets per type (MEST)." + + + + + InvalidOperationException with message like "The operation cannot be completed because the DbContext has been disposed." + + + + + InvalidOperationException with message like "The provider factory returned a null connection." + + + + + InvalidOperationException with message like "The connection string '{0}' in the application's configuration file does not contain the required providerName attribute."" + + + + + InvalidOperationException with message like "The DbConnectionFactory instance returned a null connection." + + + + + ArgumentException with message like "The number of primary key values passed must match number of primary key values defined on the entity." + + + + + ArgumentException with message like "The type of one of the primary key values did not match the type defined in the entity. See inner exception for details." + + + + + InvalidOperationException with message like "The entity found was of type {0} when an entity of type {1} was requested." + + + + + InvalidOperationException with message like "Multiple entities were found in the Added state that match the given primary key values." + + + + + InvalidOperationException with message like "The type '{0}' is mapped as a complex type. The Set method, DbSet objects, and DbEntityEntry objects can only be used with entity types, not complex types." + + + + + InvalidOperationException with message like "The type '{0}' is not attributed with EdmEntityTypeAttribute but is contained in an assembly attributed with EdmSchemaAttribute. POCO entities that do not use EdmEntityTypeAttribute cannot be contained in the same assembly as non-POCO entities that use EdmEntityTypeAttribute." + + + + + InvalidOperationException with message like "The entity type {0} is not part of the model for the current context." + + + + + NotSupportedException with message like "Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery) is not supported. Instead populate a DbSet with data, for example by calling Load on the DbSet, and then bind to local data. For WPF bind to DbSet.Local. For WinForms bind to DbSet.Local.ToBindingList()." + + + + + ArgumentException with message like "The Include path expression must refer to a navigation property defined on the type. Use dotted paths for reference navigation properties and the Select operator for collection navigation properties." + + + + + InvalidOperationException with message like "No connection string named '{0}' could be found in the application config file." + + + + + InvalidOperationException with message like "Cannot initialize a DbContext from an entity connection string or an EntityConnection instance together with a DbCompiledModel. If an entity connection string or EntityConnection instance is used, then the model will be created from the metadata in the connection. If a DbCompiledModel is used, then the connection supplied should be a standard database connection (for example, a SqlConnection instance) rather than an entity connection." + + + + + NotSupportedException with message like "The collection navigation property '{0}' on the entity of type '{1}' cannot be set because the entity type does not define a navigation property with a set accessor." + + + + + NotSupportedException with message like "Using the same DbCompiledModel to create contexts against different types of database servers is not supported. Instead, create a separate DbCompiledModel for each type of server being used." + + + + + InvalidOperationException with message like "Multiple object sets per type are not supported. The object sets '{0}' and '{1}' can both contain instances of type '{2}'." + + + + + InvalidOperationException with message like "The context type '{0}' must have a public constructor taking an EntityConnection." + + + + + NotSupportedException with message like "The database name '{0}' is not supported because it is an MDF file name. A full connection string must be provided to attach an MDF file." + + + + + DataException with message like "An exception occurred while initializing the database. See the InnerException for details." + + + + + NotSupportedException with message like "Creating a DbModelBuilder or writing the EDMX from a DbContext created using an existing ObjectContext is not supported. EDMX can only be obtained from a Code First DbContext created without using an existing DbCompiledModel." + + + + + NotSupportedException with message like "Creating a DbModelBuilder or writing the EDMX from a DbContext created using an existing DbCompiledModel is not supported. EDMX can only be obtained from a Code First DbContext created without using an existing DbCompiledModel." + + + + + NotSupportedException with message like "Creating a DbModelBuilder or writing the EDMX from a DbContext created using Database First or Model First is not supported. EDMX can only be obtained from a Code First DbContext created without using an existing DbCompiledModel." + + + + + The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. + + + + + The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. + + + + + The exception that is thrown when the author has yet to implement the logic at this point in the program. This can act as an exception based TODO tag. + + + + + The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality. + + + + + Strongly-typed and parameterized string resources. + + + + + A string like "The field {0} must be a string or array type with a maximum length of '{1}'." + + + + + A string like "The field {0} must be a string or array type with a minimum length of '{1}'." + + + + + A string like "The argument '{0}' cannot be null, empty or contain only white space." + + + + + A string like "MaxLengthAttribute must have a Length value that is greater than zero. Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length." + + + + + A string like "MinLengthAttribute must have a Length value that is zero or greater." + + + + + Strongly-typed and parameterized exception factory. + + + + + InvalidOperationException with message like "MaxLengthAttribute must have a Length value that is greater than zero. Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length." + + + + + InvalidOperationException with message like "MinLengthAttribute must have a Length value that is zero or greater." + + + + + ArgumentException with message like "The argument '{0}' cannot be null, empty or contain only white space." + + + + + The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. + + + + + The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. + + + + + The exception that is thrown when the author has yet to implement the logic at this point in the program. This can act as an exception based TODO tag. + + + + + The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality. + + + + + Gets or sets an value representing the model that is being mapped. + + + + + Gets or sets a value representing the database that is the target of the mapping. + + + + + Gets or sets the collection of s that specifies how the model's entity containers are mapped to the database. + + + + + This convention uses the name of the derived + class as the container for the conceptual model built by + Code First. + + + + + Identifies conventions that can be removed from a instance. + + + + + Initializes a new instance of the class. + + The model container name. + + + + Applies the convention to the given model. + + The model. + + + + This convention uses the namespace of the derived + class as the namespace of the conceptual model built by + Code First. + + + + + Initializes a new instance of the class. + + The model namespace. + + + + Applies the convention to the given model. + + The model. + + + + Thrown when a context is generated from the templates in Database First or Model + First mode and is then used in Code First mode. + + + Code generated using the T4 templates provided for Database First and Model First use may not work + correctly if used in Code First mode. To use these classes with Code First please add any additional + configuration using attributes or the DbModelBuilder API and then remove the code that throws this + exception. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The object that holds the serialized object data. + The contextual information about the source or destination. + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner exception. + + + + Adapted from to allow the initializer to take an input object and + to do one-time initialization that only has side-effects and doesn't return a value. + + The type of the input. + + + + Initializes a new instance of the class. + + The action. + + + + Performs the action unless it has already been successfully performed before. + + The input to the action; ignored if the action has already succeeded. + + + + Adapted from to allow the initializer to take an input object and + to retry initialization if it has previously failed. + + + This class can only be used to initialize reference types that will not be null when + initialized. + + The type of the input. + The type of the result. + + + + Initializes a new instance of the class. + + The value factory. + + + + Gets the value, possibly by running the initializer if it has not been run before or + if all previous times it ran resulted in exceptions. + + The input to the initializer; ignored if initialization has already succeeded. + The initialized object. + + + + Abstracts simple validators used to validate entities and properties. + + + + + Validates an entity or a property. + + Validation context. Never null. + Property to validate. Can be null for type level validation. + Validation error as. Empty if no errors. Never null. + + + + + Contracts for interface. + + + + + Contract for IValidator.Validate method. + + Validation context. + Property. + Nothing - always throws. + + + + Indicates what parts of a configuration are overridable. + + + + + Nothing in the configuration is overridable. + + + + + The configuration values related to C-Space are overridable. + + + + + The configuration values only related to S-Space are overridable. + + + + + Populate the table mapping structure + + + + + Sets nullability for association set mappings' foreign keys for 1:* and 1:0..1 associations + when no base types share the the association set mapping's table + + + + + Makes sure only the required property mappings are present + + + + + Determines if the table and entity type need mapping, and if not, removes the existing entity type mapping + + + + + Base class for configuring a property on an entity type or complex type. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Convention to set a default maximum length of 4000 for properties whose type supports length facets when SqlCe is the provider. + + + + + Convention to process instances of found on navigation properties in the model. + + + + + Exception thrown from when an exception is thrown from the validation + code. + + + + + Initializes a new instance of DbUnexpectedValidationException + + The exception message. + + + + Initializes a new instance of DbUnexpectedValidationException + + The exception message. + + + + Initializes a new instance of DbUnexpectedValidationException + + The exception message. + The inner exception. + + + + Initializes a new instance of DbUnexpectedValidationException with the specified serialization info and + context. + + The serialization info. + The streaming context. + + + + An implementation of IDatabaseInitializer that will always recreate and optionally re-seed the + database the first time that a context is used in the app domain. + To seed the database, create a derived class and override the Seed method. + + The type of the context. + + + + + Executes the strategy to initialize the database for the given context. + + The context. + + + + Executes the strategy to initialize the database for the given context. + + The context. + + + + A that should be overridden to actually add data to the context for seeding. + The default implementation does nothing. + + The context to seed. + + + + An implementation of IDatabaseInitializer that will recreate and optionally re-seed the + database only if the database does not exist. + To seed the database, create a derived class and override the Seed method. + + The type of the context. + + + + Executes the strategy to initialize the database for the given context. + + The context. + + + + A that should be overridden to actually add data to the context for seeding. + The default implementation does nothing. + + The context to seed. + + + + An instances of this class is obtained from an object and can be used + to manage the actual database backing a DbContext or connection. + This includes creating, deleting, and checking for the existence of a database. + Note that deletion and checking for existence of a database can be performed using just a + connection (i.e. without a full context) by using the static methods of this class. + + + + + Creates a Database backed by the given context. This object can be used to create a database, + check for database existence, and delete a database. + + The context that defines the database connection and model. + + + + Gets or sets the database initialization strategy. The database initialization strategy is called when instance + is initialized from a . The strategy can optionally check for database existence, create a new database, and + seed the database with data. + The default strategy is an instance of created with useSeedData set + to true. + + The type of the context. + The strategy. + The database creation strategy. + + + + Internal version of SetInitializer that allows the strategy to be locked such that it cannot be replaced + by another call to SetInitializer. This allows strategies set in the app.config to win over strategies set + in code. + + The type of the context. + The strategy. + if set to true then the strategy is locked. + + + + Runs the the registered on this context. + + If "force" is set to true, then the initializer is run regardless of whether or not it + has been run before. This can be useful if a database is deleted while an app is running + and needs to be reinitialized. + + If "force" is set to false, then the initializer is only run if it has not already been + run for this context, model, and connection in this app domain. This method is typically + used when it is necessary to ensure that the database has been created and seeded + before starting some operation where doing so lazily will cause issues, such as when the + operation is part of a transaction. + + if set to true the initializer is run even if it has already been run. + + + + This method returns true if the context has a model hash and the database contains a model hash + and these hashes match. This indicates that the model used to create the database is the same + as the current model and so the two can be used together. + + If set to true then an exception will be thrown if no + model metadata is found either in the model associated with the context or in the database + itself. If set to false then this method will return true if metadata is + not found. + + True if the model hash in the context and the database match; false otherwise. + + + + + Creates a new database on the database server for the model defined in the backing context. + Note that calling this method before the database initialization strategy has run will disable + executing that strategy. + + + + + Creates a new database on the database server for the model defined in the backing context, but only + if a database with the same name does not already exist on the server. + + True if the database did not exist and was created; false otherwise. + + + + Checks whether or not the database exists on the server. + + True if the database exists; false otherwise. + + + + Deletes the database on the database server if it exists, otherwise does nothing. + + True if the database did exist and was deleted; false otherwise. + + + + Checks whether or not the database exists on the server. + The connection to the database is created using the given database name or connection string + in the same way as is described in the documentation for the class. + + The database name or a connection string to the database. + True if the database exists; false otherwise. + + + + Deletes the database on the database server if it exists, otherwise does nothing. + The connection to the database is created using the given database name or connection string + in the same way as is described in the documentation for the class. + + The database name or a connection string to the database. + True if the database did exist and was deleted; false otherwise. + + + + Checks whether or not the database exists on the server. + + An existing connection to the database. + True if the database exists; false otherwise. + + + + Deletes the database on the database server if it exists, otherwise does nothing. + + An existing connection to the database. + True if the database did exist and was deleted; false otherwise. + + + + Performs the operation defined by the given delegate using the given lazy connection, ensuring + that the lazy connection is disposed after use. + + Information used to create a DbConnection. + The operation to perform. + The return value of the operation. + + + + Performs the operation defined by the given delegate against a connection. The connection + is either the connection accessed from the context backing this object, or is obtained from + the connection information passed to one of the static methods. + + The connection to use. + The operation to perform. + The return value of the operation. + + + + Returns an empty ObjectContext that can be used to perform delete/exists operations. + + The connection for which to create an ObjectContext + The empty context. + + + + Creates a raw SQL query that will return elements of the given generic type. + The type can be any type that has properties that match the names of the columns returned + from the query, or can be a simple primitive type. The type does not have to be an + entity type. The results of this query are never tracked by the context even if the + type of object returned is an entity type. Use the + method to return entities that are tracked by the context. + + The type of object returned by the query. + The SQL query string. + The parameters to apply to the SQL query string. + A object that will execute the query when it is enumerated. + + + + Creates a raw SQL query that will return elements of the given type. + The type can be any type that has properties that match the names of the columns returned + from the query, or can be a simple primitive type. The type does not have to be an + entity type. The results of this query are never tracked by the context even if the + type of object returned is an entity type. Use the + method to return entities that are tracked by the context. + + The type of object returned by the query. + The SQL query string. + The parameters to apply to the SQL query string. + A object that will execute the query when it is enumerated. + + + + Executes the given DDL/DML command against the database. + + The command string. + The parameters to apply to the command string. + The result returned by the database after executing the command. + + + + Returns the connection being used by this context. This may cause the context to be initialized + and the connection to be created if it does not already exist. + + Thrown if the context has been disposed. + + + + Returns the as a delegate that can be called with + an instance of the that owns this Database object, or returns null if + there is no initializer set for this context type. + + The initializer delegate or null. + + + + The connection factory to use when creating a from just + a database name or a connection string. + + + This is used when just a database name or connection string is given to or when + the no database name or connection is given to DbContext in which case the name of + the context class is passed to this factory in order to generate a DbConnection. + The default connection factory creates a connection to SQL Express on the local machine. However, + this default may be changed by an application framework. + + + + + An implementation of IDatabaseInitializer that will DELETE, recreate, and optionally re-seed the + database only if the model has changed since the database was created. This is achieved by writing a + hash of the store model to the database when it is created and then comparing that hash with one + generated from the current model. + To seed the database, create a derived class and override the Seed method. + + + + + Executes the strategy to initialize the database for the given context. + + The context. + + + + A that should be overridden to actually add data to the context for seeding. + The default implementation does nothing. + + The context to seed. + + + + A DbContext instance represents a combination of the Unit Of Work and Repository patterns such that + it can be used to query from a database and group together changes that will then be written + back to the store as a unit. + DbContext is conceptually similar to ObjectContext. + + + DbContext is usually used with a derived type that contains properties for + the root entities of the model. These sets are automatically initialized when the + instance of the derived class is created. This behavior can be modified by applying the + attribute to either the entire derived context + class, or to individual properties on the class. + + The Entity Data Model backing the context can be specified in several ways. When using the Code First + approach, the properties on the derived context are used to build a model + by convention. The protected OnModelCreating method can be overridden to tweak this model. More + control over the model used for the Model First approach can be obtained by creating a + explicitly from a and passing this model to one of the DbContext constructors. + + When using the Database First or Model First approach the Entity Data Model can be created using the + Entity Designer (or manually through creation of an EDMX file) and then this model can be specified using + entity connection string or an object. + + The connection to the database (including the name of the database) can be specified in several ways. + If the parameterless DbContext constructor is called from a derived context, then the name of the derived context + is used to find a connection string in the app.config or web.config file. If no connection string is found, then + the name is passed to the DefaultConnectionFactory registered on the class. The connection + factory then uses the context name as the database name in a default connection string. (This default connection + string points to .\SQLEXPRESS on the local machine unless a different DefaultConnectionFactory is registered.) + + Instead of using the derived context name, the connection/database name can also be specified explicitly by + passing the name to one of the DbContext constructors that takes a string. The name can also be passed in + the form "name=myname", in which case the name must be found in the config file or an exception will be thrown. + + Note that the connection found in the app.config or web.config file can be a normal database connection + string (not a special Entity Framework connection string) in which case the DbContext will use Code First. + However, if the connection found in the config file is a special Entity Framework connection string, then the + DbContext will use Database/Model First and the model specified in the connection string will be used. + + An existing or explicitly created DbConnection can also be used instead of the database/connection name. + + A can be applied to a class derived from DbContext to set the + version of conventions used by the context when it creates a model. If no attribute is applied then the + latest version of conventions will be used. + + + + + Interface implemented by objects that can provide an instance. + The class implements this interface to provide access to the underlying + ObjectContext. + + + + + Gets the object context. + + The object context. + + + + Constructs a new context instance using conventions to create the name of the database to + which a connection will be made. The by-convention name is the full name (namespace + class name) + of the derived context class. + See the class remarks for how this is used to create a connection. + + + + + Constructs a new context instance using conventions to create the name of the database to + which a connection will be made, and initializes it from the given model. + The by-convention name is the full name (namespace + class name) of the derived context class. + See the class remarks for how this is used to create a connection. + + The model that will back this context. + + + + Constructs a new context instance using the given string as the name or connection string for the + database to which a connection will be made. + See the class remarks for how this is used to create a connection. + + Either the database name or a connection string. + + + + Constructs a new context instance using the given string as the name or connection string for the + database to which a connection will be made, and initializes it from the given model. + See the class remarks for how this is used to create a connection. + + Either the database name or a connection string. + The model that will back this context. + + + + Constructs a new context instance using the existing connection to connect to a database. + The connection will not be disposed when the context is disposed. + + An existing connection to use for the new context. + If set to true the connection is disposed when + the context is disposed, otherwise the caller must dispose the connection. + + + + Constructs a new context instance using the existing connection to connect to a database, + and initializes it from the given model. + The connection will not be disposed when the context is disposed. + An existing connection to use for the new context. + The model that will back this context. + If set to true the connection is disposed when + the context is disposed, otherwise the caller must dispose the connection. + + + + + Constructs a new context instance around an existing ObjectContext. + An existing ObjectContext to wrap with the new context. + If set to true the ObjectContext is disposed when + the DbContext is disposed, otherwise the caller must dispose the connection. + + + + + Initializes the internal context, discovers and initializes sets, and initializes from a model if one is provided. + + + + + Discovers DbSets and initializes them. + + + + + This method is called when the model for a derived context has been initialized, but + before the model has been locked down and used to initialize the context. The default + implementation of this method does nothing, but it can be overridden in a derived class + such that the model can be further configured before it is locked down. + + + Typically, this method is called only once when the first instance of a derived context + is created. The model for that context is then cached and is for all further instances of + the context in the app domain. This caching can be disabled by setting the ModelCaching + property on the given ModelBuidler, but note that this can seriously degrade performance. + More control over caching is provided through use of the DbModelBuilder and DbContextFactory + classes directly. + + The builder that defines the model for the context being created. + + + + Internal method used to make the call to the real OnModelCreating method. + + The model builder. + + + + Returns a DbSet instance for access to entities of the given type in the context, + the ObjectStateManager, and the underlying store. + + + See the DbSet class for more details. + + The type entity for which a set should be returned. + A set for the given entity type. + + + + Returns a non-generic DbSet instance for access to entities of the given type in the context, + the ObjectStateManager, and the underlying store. + + The type of entity for which a set should be returned. + A set for the given entity type. + + See the DbSet class for more details. + + + + + Saves all changes made in this context to the underlying database. + + The number of objects written to the underlying database. + Thrown if the context has been disposed. + + + + Validates tracked entities and returns a Collection of containing validation results. + + + Collection of validation results for invalid entities. The collection is never null and must not contain null + values or results for valid entities. + + + 1. This method calls DetectChanges() to determine states of the tracked entities unless + DbContextConfiguration.AutoDetectChangesEnabled is set to false. + 2. By default only Added on Modified entities are validated. The user is able to change this behavior + by overriding ShouldValidateEntity method. + + + + + Extension point allowing the user to override the default behavior of validating only + added and modified entities. + + DbEntityEntry instance that is supposed to be validated. + true to proceed with validation. false otherwise. + + + + Extension point allowing the user to customize validation of an entity or filter out validation results. + Called by . + + DbEntityEntry instance to be validated. + User defined dictionary containing additional info for custom validation. + It will be passed to + and will be exposed as . + This parameter is optional and can be null. + Entity validation result. Possibly null when overridden. + + + + Internal method that calls the protected ValidateEntity method. + + DbEntityEntry instance to be validated. + User defined dictionary containing additional info for custom validation. + It will be passed to + and will be exposed as . + This parameter is optional and can be null. + Entity validation result. Possibly null when ValidateEntity is overridden. + + + + Gets a object for the given entity providing access to + information about the entity and the ability to perform actions on the entity. + + The type of the entity. + The entity. + An entry for the entity. + + + + Gets a object for the given entity providing access to + information about the entity and the ability to perform actions on the entity. + + The entity. + An entry for the entity. + + + + Calls the protected Dispose method. + + + + + Disposes the context. The underlying is also disposed if it was created + is by this context or ownership was passed to this context when this context was created. + The connection to the database ( object) is also disposed if it was created + is by this context or ownership was passed to this context when this context was created. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Creates a Database instance for this context that allows for creation/deletion/existence checks + for the underlying database. + + + + + Returns the Entity Framework ObjectContext that is underlying this context. + + Thrown if the context has been disposed. + + + + Provides access to features of the context that deal with change tracking of entities. + + An object used to access features that deal with change tracking. + + + + Provides access to configuration options for the context. + + An object used to access configuration options. + + + + Provides access to the underlying InternalContext for other parts of the internal design. + + + + + + + Common code for generic and non-generic string Include. + + + + + + Returns a new query where the entities returned will not be cached in the + or . This method works by calling the AsNoTracking method of the + underlying query object. If the underlying query object does not have a AsNoTracking method, + then calling this method will have no affect. + + The element type. + The source query. + A new query with NoTracking applied, or the source query if NoTracking is not supported. + + + + Returns a new query where the entities returned will not be cached in the + or . This method works by calling the AsNoTracking method of the + underlying query object. If the underlying query object does not have a AsNoTracking method, + then calling this method will have no affect. + + The source query. + A new query with NoTracking applied, or the source query if NoTracking is not supported. + + + + Common code for generic and non-generic AsNoTracking. + + + + + Enumerates the query such that for server queries such as those of , , + , and others the results of the query will be loaded into the associated , + or other cache on the client. + This is equivalent to calling ToList and then throwing away the list without the overhead of actually creating the list. + + The source query. + + + + Returns an implementation that stays in sync with the given . + + The element type. + The collection that the binding list will stay in sync with. + The binding list. + + + + A DbSet represents the collection of all entities in the context, or that can be queried from the + database, of a given type. DbSet objects are created from a DbContext using the DbContext.Set method. + + + Note that DbSet does not support MEST (Multiple Entity Sets per Type) meaning that there is always a + one-to-one correlation between a type and a set. + + The type that defines the set. + + + + Represents a LINQ to Entities query against a DbContext. + + The type of entity to query for. + + + + An internal interface implemented by and that allows access to + the internal query without using reflection. + + + + + The underlying internal set. + + + + + Creates a new query that will be backed by the given internal query object. + + The backing query. + + + + + Returns a new query where the entities returned will not be cached in the . + + A new query with NoTracking applied. + + + + Throws an exception indicating that binding directly to a store query is not supported. + Instead populate a DbSet with data, for example by using the Load extension method, and + then bind to local data. For WPF bind to DbSet.Local. For Windows Forms bind to + DbSet.Local.ToBindingList(). + + + Never returns; always throws. + + + + + Gets the enumeration of this query causing it to be executed against the store. + + An enumerator for the query + + + + Gets the enumeration of this query causing it to be executed against the store. + + An enumerator for the query + + + + Returns a representation of the underlying query. + + + The query string. + + + + + Returns a new instance of the non-generic class for this query. + + A non-generic version. + + + + Returns false. + + false. + + + + The IQueryable element type. + + + + + The IQueryable LINQ Expression. + + + + + The IQueryable provider. + + + + + The internal query object that is backing this DbQuery + + + + + The internal query object that is backing this DbQuery + + + + + An IDbSet represents the collection of all entities in the context, or that can be queried from the + database, of a given type. DbSet is a concrete implementation of IDbSet. + + The type that defines the set. + + + + Finds an entity with the given primary key values. + If an entity with the given primary key values exists in the context, then it is + returned immediately without making a request to the store. Otherwise, a request + is made to the store for an entity with the given primary key values and this entity, + if found, is attached to the context and returned. If no entity is found in the + context or the store, then null is returned. + + + The ordering of composite key values is as defined in the EDM, which is in turn as defined in + the designer, by the Code First fluent API, or by the DataMember attribute. + + The values of the primary key for the entity to be found. + The entity found, or null. + + + + Adds the given entity to the context underlying the set in the Added state such that it will + be inserted into the database when SaveChanges is called. + + The entity to add. + The entity. + + Note that entities that are already in the context in some other state will have their state set + to Added. Add is a no-op if the entity is already in the context in the Added state. + + + + + Marks the given entity as Deleted such that it will be deleted from the database when SaveChanges + is called. Note that the entity must exist in the context in some other state before this method + is called. + + The entity to remove. + The entity. + + Note that if the entity exists in the context in the Added state, then this method + will cause it to be detached from the context. This is because an Added entity is assumed not to + exist in the database such that trying to delete it does not make sense. + + + + + Attaches the given entity to the context underlying the set. That is, the entity is placed + into the context in the Unchanged state, just as if it had been read from the database. + + The entity to attach. + The entity. + + Attach is used to repopulate a context with an entity that is known to already exist in the database. + SaveChanges will therefore not attempt to insert an attached entity into the database because + it is assumed to already be there. + Note that entities that are already in the context in some other state will have their state set + to Unchanged. Attach is a no-op if the entity is already in the context in the Unchanged state. + + + + + Creates a new instance of an entity for the type of this set. + Note that this instance is NOT added or attached to the set. + The instance returned will be a proxy if the underlying context is configured to create + proxies and the entity type meets the requirements for creating a proxy. + + The entity instance, which may be a proxy. + + + + Creates a new instance of an entity for the type of this set or for a type derived + from the type of this set. + Note that this instance is NOT added or attached to the set. + The instance returned will be a proxy if the underlying context is configured to create + proxies and the entity type meets the requirements for creating a proxy. + + The type of entity to create. + The entity instance, which may be a proxy. + + + + Gets an that represents a local view of all Added, Unchanged, + and Modified entities in this set. This local view will stay in sync as entities are added or + removed from the context. Likewise, entities added to or removed from the local view will automatically + be added to or removed from the context. + + + This property can be used for data binding by populating the set with data, for example by using the Load + extension method, and then binding to the local data through this property. For WPF bind to this property + directly. For Windows Forms bind to the result of calling ToBindingList on this property + + The local view. + + + + An internal interface implemented by and that allows access to + the internal set without using reflection. + + + + + The underlying internal set. + + + + + Creates a new set that will be backed by the given . + + The internal set. + + + + Finds an entity with the given primary key values. + If an entity with the given primary key values exists in the context, then it is + returned immediately without making a request to the store. Otherwise, a request + is made to the store for an entity with the given primary key values and this entity, + if found, is attached to the context and returned. If no entity is found in the + context or the store, then null is returned. + + + The ordering of composite key values is as defined in the EDM, which is in turn as defined in + the designer, by the Code First fluent API, or by the DataMember attribute. + + The values of the primary key for the entity to be found. + The entity found, or null. + Thrown if multiple entities exist in the context with the primary key values given. + Thrown if the type of entity is not part of the data model for this context. + Thrown if the types of the key values do not match the types of the key values for the entity type to be found. + Thrown if the context has been disposed. + + + + Attaches the given entity to the context underlying the set. That is, the entity is placed + into the context in the Unchanged state, just as if it had been read from the database. + + The entity to attach. + The entity. + + Attach is used to repopulate a context with an entity that is known to already exist in the database. + SaveChanges will therefore not attempt to insert an attached entity into the database because + it is assumed to already be there. + Note that entities that are already in the context in some other state will have their state set + to Unchanged. Attach is a no-op if the entity is already in the context in the Unchanged state. + + + + + Adds the given entity to the context underlying the set in the Added state such that it will + be inserted into the database when SaveChanges is called. + + The entity to add. + The entity. + + Note that entities that are already in the context in some other state will have their state set + to Added. Add is a no-op if the entity is already in the context in the Added state. + + + + + Marks the given entity as Deleted such that it will be deleted from the database when SaveChanges + is called. Note that the entity must exist in the context in some other state before this method + is called. + + The entity to remove. + The entity. + + Note that if the entity exists in the context in the Added state, then this method + will cause it to be detached from the context. This is because an Added entity is assumed not to + exist in the database such that trying to delete it does not make sense. + + + + + Creates a new instance of an entity for the type of this set. + Note that this instance is NOT added or attached to the set. + The instance returned will be a proxy if the underlying context is configured to create + proxies and the entity type meets the requirements for creating a proxy. + + The entity instance, which may be a proxy. + + + + Creates a new instance of an entity for the type of this set or for a type derived + from the type of this set. + Note that this instance is NOT added or attached to the set. + The instance returned will be a proxy if the underlying context is configured to create + proxies and the entity type meets the requirements for creating a proxy. + + The type of entity to create. + The entity instance, which may be a proxy. + + + + Returns the equivalent non-generic object. + + The non-generic set object. + + + + Creates a raw SQL query that will return entities in this set. By default, the + entities returned are tracked by the context; this can be changed by calling + AsNoTracking on the returned. + Note that the entities returned are always of the type for this set and never of + a derived type. If the table or tables queried may contain data for other entity + types, then the SQL query must be written appropriately to ensure that only entities of + the correct type are returned. + + The SQL query string. + The parameters to apply to the SQL query string. + A object that will execute the query when it is enumerated. + + + + Gets an that represents a local view of all Added, Unchanged, + and Modified entities in this set. This local view will stay in sync as entities are added or + removed from the context. Likewise, entities added to or removed from the local view will automatically + be added to or removed from the context. + + + This property can be used for data binding by populating the set with data, for example by using the Load + extension method, and then binding to the local data through this property. For WPF bind to this property + directly. For Windows Forms bind to the result of calling ToBindingList on this property + + The local view. + + + + The internal IQueryable that is backing this DbQuery + + + + + A non-generic version of which can be used when the type of entity + is not known at build time. + + + + + Represents a non-generic LINQ to Entities query against a DbContext. + + + + + Internal constructor prevents external classes deriving from DbQuery. + + + + + Throws an exception indicating that binding directly to a store query is not supported. + Instead populate a DbSet with data, for example by using the Load extension method, and + then bind to local data. For WPF bind to DbSet.Local. For Windows Forms bind to + DbSet.Local.ToBindingList(). + + + Never returns; always throws. + + + + + Gets the enumeration of this query causing it to be executed against the store. + + An enumerator for the query + + + + + Returns a new query where the entities returned will not be cached in the . + + A new query with NoTracking applied. + + + + Returns the equivalent generic object. + + The type of element for which the query was created. + The generic set object. + + + + Returns a representation of the underlying query. + + + The query string. + + + + + Returns false. + + false. + + + + The IQueryable element type. + + + + + The IQueryable LINQ Expression. + + + + + The IQueryable provider. + + + + + Gets the underlying internal query object. + + The internal query. + + + + The internal query object that is backing this DbQuery + + + + + Internal constructor prevents external classes deriving from DbSet. + + + + + Finds an entity with the given primary key values. + If an entity with the given primary key values exists in the context, then it is + returned immediately without making a request to the store. Otherwise, a request + is made to the store for an entity with the given primary key values and this entity, + if found, is attached to the context and returned. If no entity is found in the + context or the store, then null is returned. + + + The ordering of composite key values is as defined in the EDM, which is in turn as defined in + the designer, by the Code First fluent API, or by the DataMember attribute. + + The values of the primary key for the entity to be found. + The entity found, or null. + Thrown if multiple entities exist in the context with the primary key values given. + Thrown if the type of entity is not part of the data model for this context. + Thrown if the types of the key values do not match the types of the key values for the entity type to be found. + Thrown if the context has been disposed. + + + + Attaches the given entity to the context underlying the set. That is, the entity is placed + into the context in the Unchanged state, just as if it had been read from the database. + + The entity to attach. + The entity. + + Attach is used to repopulate a context with an entity that is known to already exist in the database. + SaveChanges will therefore not attempt to insert an attached entity into the database because + it is assumed to already be there. + Note that entities that are already in the context in some other state will have their state set + to Unchanged. Attach is a no-op if the entity is already in the context in the Unchanged state. + + + + + Adds the given entity to the context underlying the set in the Added state such that it will + be inserted into the database when SaveChanges is called. + + The entity to add. + The entity. + + Note that entities that are already in the context in some other state will have their state set + to Added. Add is a no-op if the entity is already in the context in the Added state. + + + + + Marks the given entity as Deleted such that it will be deleted from the database when SaveChanges + is called. Note that the entity must exist in the context in some other state before this method + is called. + + The entity to remove. + The entity. + + Note that if the entity exists in the context in the Added state, then this method + will cause it to be detached from the context. This is because an Added entity is assumed not to + exist in the database such that trying to delete it does not make sense. + + + + + Creates a new instance of an entity for the type of this set. + Note that this instance is NOT added or attached to the set. + The instance returned will be a proxy if the underlying context is configured to create + proxies and the entity type meets the requirements for creating a proxy. + + The entity instance, which may be a proxy. + + + + Creates a new instance of an entity for the type of this set or for a type derived + from the type of this set. + Note that this instance is NOT added or attached to the set. + The instance returned will be a proxy if the underlying context is configured to create + proxies and the entity type meets the requirements for creating a proxy. + + The entity instance, which may be a proxy. + + + + Returns the equivalent generic object. + + The type of entity for which the set was created. + The generic set object. + + + + Creates a raw SQL query that will return entities in this set. By default, the + entities returned are tracked by the context; this can be changed by calling + AsNoTracking on the returned. + Note that the entities returned are always of the type for this set and never of + a derived type. If the table or tables queried may contain data for other entity + types, then the SQL query must be written appropriately to ensure that only entities of + the correct type are returned. + + The SQL query string. + The parameters to apply to the SQL query string. + A object that will execute the query when it is enumerated. + + + + Gets an that represents a local view of all Added, Unchanged, + and Modified entities in this set. This local view will stay in sync as entities are added or + removed from the context. Likewise, entities added to or removed from the local view will automatically + be added to or removed from the context. + + + This property can be used for data binding by populating the set with data, for example by using the Load + extension method, and then binding to the local data through this property. For WPF bind to this property + directly. For Windows Forms bind to the result of calling ToBindingList on this property + + The local view. + + + + The internal IQueryable that is backing this DbQuery + + + + + Gets the underlying internal set. + + The internal set. + + + + Contains methods used to access the Entity Data Model created by Code First in the EDMX form. + These methods are typically used for debugging when there is a need to look at the model that + Code First creates internally. + + + + + Uses Code First with the given context and writes the resulting Entity Data Model to the given + writer in EDMX form. This method can only be used with context instances that use Code First + and create the model internally. The method cannot be used for contexts created using Database + First or Model First, for contexts created using a pre-existing , or + for contexts created using a pre-existing . + + The context. + The writer. + + + + Writes the Entity Data Model represented by the given to the + given writer in EDMX form. + + An object representing the EDM. + The writer. + + + + This attribute can be applied to a class derived from to set which + version of the DbContext and conventions should be used when building + a model from code--also know as "Code First". See the + enumeration for details about DbModelBuilder versions. + + + If the attribute is missing from DbContextthen DbContext will always use the latest + version of the conventions. This is equivalent to using DbModelBuilderVersion.Latest. + + + + + Initializes a new instance of the class. + + The conventions version to use. + + + + Gets the conventions version. + + The conventions version. + + + + A value from this enumeration can be provided directly to the + class or can be used in the applied to + a class derived from . The value used defines which version of + the DbContext and DbModelBuilder conventions should be used when building a model from + code--also know as "Code First". + + + Using DbModelBuilderVersion.Latest ensures that all the latest functionality is available + when upgrading to a new release of the Entity Framework. However, it may result in an + application behaving differently with the new release than it did with a previous release. + This can be avoided by using a specific version of the conventions, but if a version + other than the latest is set then not all the latest functionality will be available. + + + + + Indicates that the latest version of the and + conventions should be used. + + + + + Indicates that the version of the and + conventions shipped with Entity Framework v4.1 + should be used. + + + + + Represents an Entity Data Model (EDM) created by the . + The Compile method can be used to go from this EDM representation to a + which is a compiled snapshot of the model suitable for caching and creation of + or instances. + + + + + Initializes a new instance of the class. + + + + + Creates a for this mode which is a compiled snapshot + suitable for caching and creation of instances. + + The compiled model. + + + + Implementations of this interface are used to create DbConnection objects for + a type of database server based on a given database name. + An Instance is set on the class to + cause all DbContexts created with no connection information or just a database + name or connection string to use a certain type of database server by default. + Two implementations of this interface are provided: + is used to create connections to Microsoft SQL Server, including EXPRESS editions. + is used to create connections to Microsoft SQL + Server Compact Editions. + Other implementations for other database servers can be added as needed. + Note that implementations should be thread safe or immutable since they may + be accessed by multiple threads at the same time. + + + + + Creates a connection based on the given database name or connection string. + + The database name or connection string. + An initialized DbConnection. + + + + Represents a SQL query for entities that is created from a + and is executed using the connection from that context. + Instances of this class are obtained from the instance for the + entity type. The query is not executed when this object is created; it is executed + each time it is enumerated, for example by using foreach. + SQL queries for non-entities are created using the . + See for a generic version of this class. + + + + + Initializes a new instance of the class. + + The internal query. + + + + Executes the query and returns an enumerator for the elements. + + + An object that can be used to iterate through the elements. + + + + + Returns a new query where the results of the query will not be tracked by the associated + . + + A new query with no-tracking applied. + + + + Returns a that contains the SQL string that was set + when the query was created. The parameters are not included. + + + A that represents this instance. + + + + + Throws an exception indicating that binding directly to a store query is not supported. + + + Never returns; always throws. + + + + + Gets the internal query. + + The internal query. + + + + Returns false. + + false. + + + + Represents a SQL query for entities that is created from a + and is executed using the connection from that context. + Instances of this class are obtained from the instance for the + entity type. The query is not executed when this object is created; it is executed + each time it is enumerated, for example by using foreach. + SQL queries for non-entities are created using the . + See for a non-generic version of this class. + + + + + Executes the query and returns an enumerator for the elements. + + An object that can be used to iterate through the elements. + + + + Executes the query and returns an enumerator for the elements. + + + An object that can be used to iterate through the elements. + + + + + Returns a new query where the results of the query will not be tracked by the associated + . + + A new query with no-tracking applied. + + + + Returns a that contains the SQL string that was set + when the query was created. The parameters are not included. + + + A that represents this instance. + + + + + Throws an exception indicating that binding directly to a store query is not supported. + + + Never returns; always throws. + + + + + Gets the internal query. + + The internal query. + + + + Returns false. + + false. + + + + This convention causes DbModelBuilder to include metadata about the model + when it builds the model. When creates a model by convention it will + add this convention to the list of those used by the DbModelBuilder. This will then result in + model metadata being written to the database if the DbContext is used to create the database. + This can then be used as a quick check to see if the model has changed since the last time it was + used against the database. + This convention can be removed from the conventions by overriding + the OnModelCreating method on a derived DbContext class. + + + + + Adds metadata to the given model configuration. + + The model configuration. + + + + Instances of this class are used to create DbConnection objects for + SQL Server Compact Edition based on a given database name or connection string. + + + It is necessary to provide the provider invariant name of the SQL Server Compact + Edition to use when creating an instance of this class. This is because different + versions of SQL Server Compact Editions use different invariant names. + An instance of this class can be set on the class to + cause all DbContexts created with no connection information or just a database + name or connection string to use SQL Server Compact Edition by default. + This class is immutable since multiple threads may access instances simultaneously + when creating connections. + + + + + Creates a new connection factory with empty (default) DatabaseDirectory and BaseConnectionString + properties. + + The provider invariant name that specifies the version of SQL Server Compact Edition that should be used. + + + + Creates a new connection factory with the given DatabaseDirectory and BaseConnectionString properties. + + + The provider invariant name that specifies the version of SQL Server Compact Edition that should be used. + + + The path to prepend to the database name that will form the file name used by SQL Server Compact Edition + when it creates or reads the database file. An empty string means that SQL Server Compact Edition will use + its default for the database file location. + + + The connection string to use for options to the database other than the 'Data Source'. The Data Source will + be prepended to this string based on the database name when CreateConnection is called. + + + + + Creates a connection for SQL Server Compact Edition based on the given database name or connection string. + If the given string contains an '=' character then it is treated as a full connection string, + otherwise it is treated as a database name only. + + The database name or connection string. + An initialized DbConnection. + + + + The path to prepend to the database name that will form the file name used by + SQL Server Compact Edition when it creates or reads the database file. + The default value is "|DataDirectory|", which means the file will be placed + in the designated data directory. + + + + + The connection string to use for options to the database other than the 'Data Source'. + The Data Source will be prepended to this string based on the database name when + CreateConnection is called. + The default is the empty string, which means no other options will be used. + + + + + The provider invariant name that specifies the version of SQL Server Compact Edition + that should be used. + + + + + Instances of this class are used to create DbConnection objects for + SQL Server based on a given database name or connection string. By default, the connection is + made to '.\SQLEXPRESS'. This can be changed by changing the base connection + string when constructing a factory instance. + + + An instance of this class can be set on the class to + cause all DbContexts created with no connection information or just a database + name or connection string to use SQL Server by default. + This class is immutable since multiple threads may access instances simultaneously + when creating connections. + + + + + Creates a new connection factory with a default BaseConnectionString property of + 'Data Source=.\SQLEXPRESS; Integrated Security=True; MultipleActiveResultSets=True'. + + + + + Creates a new connection factory with the given BaseConnectionString property. + + + The connection string to use for options to the database other than the 'Initial Catalog'. The 'Initial Catalog' will + be prepended to this string based on the database name when CreateConnection is called. + + + + + Creates a connection for SQL Server based on the given database name or connection string. + If the given string contains an '=' character then it is treated as a full connection string, + otherwise it is treated as a database name only. + + The database name or connection string. + An initialized DbConnection. + + + + The connection string to use for options to the database other than the 'Initial Catalog'. + The 'Initial Catalog' will be prepended to this string based on the database name when + CreateConnection is called. + The default is 'Data Source=.\SQLEXPRESS; Integrated Security=True; MultipleActiveResultSets=True'. + + + + + A non-generic version of the class. + + + + + A non-generic version of the class. + + + + + This is an abstract base class use to represent a scalar or complex property, or a navigation property + of an entity. Scalar and complex properties use the derived class , + reference navigation properties use the derived class , and collection + navigation properties use the derived class . + + + + + Creates a from information in the given . + This method will create an instance of the appropriate subclass depending on the metadata contained + in the InternalMemberEntry instance. + + The internal member entry. + The new entry. + + + + Validates this property. + + + Collection of objects. Never null. If the entity is valid the collection will be empty. + + + + + Returns the equivalent generic object. + + The type of entity on which the member is declared. + The type of the property. + The equivalent generic object. + + + + Gets the name of the property. + + The property name. + + + + Gets or sets the current value of this property. + + The current value. + + + + The to which this member belongs. + + An entry for the entity that owns this member. + + + + Gets the backing this object. + + The internal member entry. + + + + Creates a from information in the given . + Use this method in preference to the constructor since it may potentially create a subclass depending on + the type of member represented by the InternalCollectionEntry instance. + + The internal property entry. + The new entry. + + + + Initializes a new instance of the class. + + The internal entry. + + + + Returns the equivalent generic object. + + The type of entity on which the member is declared. + The type of the property. + The equivalent generic object. + + + + Gets the property name. + + The property name. + + + + Gets or sets the original value of this property. + + The original value. + + + + Gets or sets the current value of this property. + + The current value. + + + + Gets or sets a value indicating whether the value of this property has been modified since + it was loaded from the database. + + + true if this instance is modified; otherwise, false. + + + + + The to which this property belongs. + + An entry for the entity that owns this property. + + + + The of the property for which this is a nested property. + This method will only return a non-null entry for properties of complex objects; it will + return null for properties of the entity itself. + + An entry for the parent complex property, or null if this is an entity property. + + + + Gets the backing this object. + + The internal member entry. + + + + Creates a from information in the given . + Use this method in preference to the constructor since it may potentially create a subclass depending on + the type of member represented by the InternalCollectionEntry instance. + + The internal property entry. + The new entry. + + + + Initializes a new instance of the class. + + The internal entry. + + + + Gets an object that represents a nested property of this property. + This method can be used for both scalar or complex properties. + + The name of the nested property. + An object representing the nested property. + + + + Gets an object that represents a nested complex property of this property. + + The name of the nested property. + An object representing the nested property. + + + + Returns the equivalent generic object. + + The type of entity on which the member is declared. + The type of the complex property. + The equivalent generic object. + + + + Instances of this class are returned from the ComplexProperty method of + and allow access to the state of a complex property. + + The type of the entity to which this property belongs. + The type of the property. + + + + Instances of this class are returned from the Property method of + and allow access to the state of the scalar + or complex property. + + The type of the entity to which this property belongs. + The type of the property. + + + + This is an abstract base class use to represent a scalar or complex property, or a navigation property + of an entity. Scalar and complex properties use the derived class , + reference navigation properties use the derived class , and collection + navigation properties use the derived class . + + The type of the entity to which this property belongs. + The type of the property. + + + + Creates a from information in the given . + This method will create an instance of the appropriate subclass depending on the metadata contained + in the InternalMemberEntry instance. + + The internal member entry. + The new entry. + + + + Returns a new instance of the non-generic class for + the property represented by this object. + + A non-generic version. + + + + Validates this property. + + + Collection of objects. Never null. If the entity is valid the collection will be empty. + + + + + Gets or sets the current value of this property. + + The current value. + + + + Gets the underlying . + + The internal member entry. + + + + The to which this member belongs. + + An entry for the entity that owns this member. + + + + Creates a from information in the given . + Use this method in preference to the constructor since it may potentially create a subclass depending on + the type of member represented by the InternalCollectionEntry instance. + + The internal property entry. + The new entry. + + + + Initializes a new instance of the class. + + The internal entry. + + + + Returns a new instance of the non-generic class for + the property represented by this object. + + A non-generic version. + + + + Gets the property name. + + The property name. + + + + Gets or sets the original value of this property. + + The original value. + + + + Gets or sets the current value of this property. + + The current value. + + + + Gets or sets a value indicating whether the value of this property has been modified since + it was loaded from the database. + + + true if this instance is modified; otherwise, false. + + + + + The to which this property belongs. + + An entry for the entity that owns this property. + + + + The of the property for which this is a nested property. + This method will only return a non-null entry for properties of complex objects; it will + return null for properties of the entity itself. + + An entry for the parent complex property, or null if this is an entity property. + + + + Gets the underlying as an . + + The internal member entry. + + + + Creates a from information in the given . + Use this method in preference to the constructor since it may potentially create a subclass depending on + the type of member represented by the InternalCollectionEntry instance. + + The internal property entry. + The new entry. + + + + Initializes a new instance of the class. + + The internal entry. + + + + Returns a new instance of the non-generic class for + the property represented by this object. + + A non-generic version. + + + + Gets an object that represents a nested property of this property. + This method can be used for both scalar or complex properties. + + The name of the nested property. + An object representing the nested property. + + + + Gets an object that represents a nested property of this property. + This method can be used for both scalar or complex properties. + + The type of the nested property. + The name of the nested property. + An object representing the nested property. + + + + Gets an object that represents a nested property of this property. + This method can be used for both scalar or complex properties. + + The type of the nested property. + An expression representing the nested property. + An object representing the nested property. + + + + Gets an object that represents a nested complex property of this property. + + The name of the nested property. + An object representing the nested property. + + + + Gets an object that represents a nested complex property of this property. + + The type of the nested property. + The name of the nested property. + An object representing the nested property. + + + + Gets an object that represents a nested complex property of this property. + + The type of the nested property. + An expression representing the nested property. + An object representing the nested property. + + + + Returned by the ChangeTracker method of to provide access to features of + the context that are related to change tracking of entities. + + + + + Initializes a new instance of the class. + + The internal context. + + + + Gets objects for all the entities tracked by this context. + + The entries. + + + + Gets objects for all the entities of the given type + tracked by this context. + + The type of the entity. + The entries. + + + + Detects changes made to the properties and relationships of POCO entities. Note that some types of + entity (such as change tracking proxies and entities that derive from ) + report changes automatically and a call to DetectChanges is not normally needed for these types of entities. + Also note that normally DetectChanges is called automatically by many of the methods of + and its related classes such that it is rare that this method will need to be called explicitly. + However, it may be desirable, usually for performance reasons, to turn off this automatic calling of + DetectChanges using the AutoDetectChangesEnabled flag from . + + + + + A non-generic version of the class. + + + + + Creates a from information in the given . + Use this method in preference to the constructor since it may potentially create a subclass depending on + the type of member represented by the InternalCollectionEntry instance. + + The internal collection entry. + The new entry. + + + + Initializes a new instance of the class. + + The internal entry. + + + + Loads the collection of entities from the database. + Note that entities that already exist in the context are not overwritten with values from the database. + + + + + Returns the query that would be used to load this collection from the database. + The returned query can be modified using LINQ to perform filtering or operations in the database, such + as counting the number of entities in the collection in the database without actually loading them. + + A query for the collection. + + + + Returns the equivalent generic object. + + The type of entity on which the member is declared. + The type of the collection element. + The equivalent generic object. + + + + Gets the property name. + + The property name. + + + + Gets or sets the current value of the navigation property. The current value is + the entity that the navigation property references. + + The current value. + + + + Gets a value indicating whether the collection of entities has been loaded from the database. + + true if the collection is loaded; otherwise, false. + + + + The to which this navigation property belongs. + + An entry for the entity that owns this navigation property. + + + + Gets the backing this object as an . + + The internal member entry. + + + + Instances of this class are returned from the Collection method of + and allow operations such as loading to + be performed on the an entity's collection navigation properties. + + The type of the entity to which this property belongs. + The type of the element in the collection of entities. + + + + Creates a from information in the given . + Use this method in preference to the constructor since it may potentially create a subclass depending on + the type of member represented by the InternalCollectionEntry instance. + + The internal collection entry. + The new entry. + + + + Initializes a new instance of the class. + + The internal entry. + + + + Loads the collection of entities from the database. + Note that entities that already exist in the context are not overwritten with values from the database. + + + + + Returns the query that would be used to load this collection from the database. + The returned query can be modified using LINQ to perform filtering or operations in the database, such + as counting the number of entities in the collection in the database without actually loading them. + + A query for the collection. + + + + Returns a new instance of the non-generic class for + the navigation property represented by this object. + + A non-generic version. + + + + Gets the property name. + + The property name. + + + + Gets or sets the current value of the navigation property. The current value is + the entity that the navigation property references. + + The current value. + + + + Gets a value indicating whether the collection of entities has been loaded from the database. + + true if the collection is loaded; otherwise, false. + + + + Gets the underlying as an . + + The internal member entry. + + + + The to which this navigation property belongs. + + An entry for the entity that owns this navigation property. + + + + Exception thrown by when it was expected that SaveChanges for an entity would + result in a database update but in fact no rows in the database were affected. This usually indicates + that the database has been concurrently updated such that a concurrency token that was expected to match + did not actually match. + Note that state entries referenced by this exception are not serialized due to security and accesses to + the state entries after serialization will return null. + + + + + + Initializes a new instance of the class. + + The internal context. + The inner exception. + + + + 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 exception. + + + + Subscribes the SerializeObjectState event. + + + + + Gets objects that represents the entities that could not + be saved to the database. + + The entries representing the entities that could not be saved. + + + + Holds exception state that will be serialized when the exception is serialized. + + + + + Completes the deserialization. + + The deserialized object. + + + + Gets or sets a value indicating whether the exception involved independent associations. + + + + + Initializes a new instance of the class. + + The context. + The inner exception. + + + + 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 exception. + + + + Returned by the Configuration method of to provide access to configuration + options for the context. + + + + + Initializes a new instance of the class. + + The internal context. + + + + Gets or sets a value indicating whether lazy loading of relationships exposed as + navigation properties is enabled. Lazy loading is enabled by default. + + true if lazy loading is enabled; otherwise, false. + + + + Gets or sets a value indicating whether or not the framework will create instances of + dynamically generated proxy classes whenever it creates an instance of an entity type. + Note that even if proxy creation is enabled with this flag, proxy instances will only + be created for entity types that meet the requirements for being proxied. + Proxy creation is enabled by default. + + true if proxy creation is enabled; otherwise, false. + + + + + Gets or sets a value indicating whether tracked entities should be validated automatically when + is invoked. + The default value is true. + + + + + A non-generic version of the class. + + + + + Initializes a new instance of the class. + + The internal entry. + + + + Queries the database for copies of the values of the tracked entity as they currently exist in the database. + Note that changing the values in the returned dictionary will not update the values in the database. + If the entity is not found in the database then null is returned. + + The store values. + + + + Reloads the entity from the database overwriting any property values with values from the database. + The entity will be in the Unchanged state after calling this method. + + + + + Gets an object that represents the reference (i.e. non-collection) navigation property from this + entity to another entity. + + The name of the navigation property. + An object representing the navigation property. + + + + Gets an object that represents the collection navigation property from this + entity to a collection of related entities. + + The name of the navigation property. + An object representing the navigation property. + + + + Gets an object that represents a scalar or complex property of this entity. + + The name of the property. + An object representing the property. + + + + Gets an object that represents a complex property of this entity. + + The name of the complex property. + An object representing the complex property. + + + + Gets an object that represents a member of the entity. The runtime type of the returned object will + vary depending on what kind of member is asked for. The currently supported member types and their return + types are: + Reference navigation property: . + Collection navigation property: . + Primitive/scalar property: . + Complex property: . + + The name of the member. + An object representing the member. + + + + Returns a new instance of the generic class for the given + generic type for the tracked entity represented by this object. + Note that the type of the tracked entity must be compatible with the generic type or + an exception will be thrown. + + The type of the entity. + A generic version. + + + + Validates this instance and returns validation result. + + + Entity validation result. Possibly null if + method is overridden. + + + + + Determines whether the specified is equal to this instance. + Two instances are considered equal if they are both entries for + the same entity on the same . + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + Two instances are considered equal if they are both entries for + the same entity on the same . + + 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. + + + + + Gets the entity. + + The entity. + + + + Gets or sets the state of the entity. + + The state. + + + + Gets the current property values for the tracked entity represented by this object. + + The current values. + + + + Gets the original property values for the tracked entity represented by this object. + The original values are usually the entity's property values as they were when last queried from + the database. + + The original values. + + + + Gets InternalEntityEntry object for this DbEntityEntry instance. + + + + + Instances of this class provide access to information about and control of entities that + are being tracked by the . Use the Entity or Entities methods of + the context to obtain objects of this type. + + The type of the entity. + + + + Initializes a new instance of the class. + + The internal entry. + + + + Queries the database for copies of the values of the tracked entity as they currently exist in the database. + Note that changing the values in the returned dictionary will not update the values in the database. + If the entity is not found in the database then null is returned. + + The store values. + + + + Reloads the entity from the database overwriting any property values with values from the database. + The entity will be in the Unchanged state after calling this method. + + + + + Gets an object that represents the reference (i.e. non-collection) navigation property from this + entity to another entity. + + The name of the navigation property. + An object representing the navigation property. + + + + Gets an object that represents the reference (i.e. non-collection) navigation property from this + entity to another entity. + + The type of the property. + The name of the navigation property. + An object representing the navigation property. + + + + Gets an object that represents the reference (i.e. non-collection) navigation property from this + entity to another entity. + + The type of the property. + An expression representing the navigation property. + An object representing the navigation property. + + + + Gets an object that represents the collection navigation property from this + entity to a collection of related entities. + + The name of the navigation property. + An object representing the navigation property. + + + + Gets an object that represents the collection navigation property from this + entity to a collection of related entities. + + The type of elements in the collection. + The name of the navigation property. + An object representing the navigation property. + + + + Gets an object that represents the collection navigation property from this + entity to a collection of related entities. + + The type of elements in the collection. + An expression representing the navigation property. + An object representing the navigation property. + + + + Gets an object that represents a scalar or complex property of this entity. + + The name of the property. + An object representing the property. + + + + Gets an object that represents a scalar or complex property of this entity. + + The type of the property. + The name of the property. + An object representing the property. + + + + Gets an object that represents a scalar or complex property of this entity. + + The type of the property. + An expression representing the property. + An object representing the property. + + + + Gets an object that represents a complex property of this entity. + + The name of the complex property. + An object representing the complex property. + + + + Gets an object that represents a complex property of this entity. + + The type of the complex property. + The name of the complex property. + An object representing the complex property. + + + + Gets an object that represents a complex property of this entity. + + The type of the complex property. + An expression representing the complex property. + An object representing the complex property. + + + + Gets an object that represents a member of the entity. The runtime type of the returned object will + vary depending on what kind of member is asked for. The currently supported member types and their return + types are: + Reference navigation property: . + Collection navigation property: . + Primitive/scalar property: . + Complex property: . + + The name of the member. + An object representing the member. + + + + Gets an object that represents a member of the entity. The runtime type of the returned object will + vary depending on what kind of member is asked for. The currently supported member types and their return + types are: + Reference navigation property: . + Collection navigation property: . + Primitive/scalar property: . + Complex property: . + + The type of the member. + The name of the member. + An object representing the member. + + + + Returns a new instance of the non-generic class for + the tracked entity represented by this object. + + A non-generic version. + + + + Validates this instance and returns validation result. + + + Entity validation result. Possibly null if + method is overridden. + + + + + Determines whether the specified is equal to this instance. + Two instances are considered equal if they are both entries for + the same entity on the same . + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + Two instances are considered equal if they are both entries for + the same entity on the same . + + 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. + + + + + Gets the entity. + + The entity. + + + + Gets or sets the state of the entity. + + The state. + + + + Gets the current property values for the tracked entity represented by this object. + + The current values. + + + + Gets the original property values for the tracked entity represented by this object. + The original values are usually the entity's property values as they were when last queried from + the database. + + The original values. + + + + An immutable representation of an Entity Data Model (EDM) model that can be used to create an + or can be passed to the constructor of a . + For increased performance, instances of this type should be cached and re-used to construct contexts. + + + + + Creates a model for the given EDM metadata model. + + The EDM metadata model. + + + + Creates an instance of ObjectContext or class derived from ObjectContext. Note that an instance + of DbContext can be created instead by using the appropriate DbContext constructor. + If a derived ObjectContext is used, then it must have a public constructor with a single + EntityConnection parameter. + The connection passed is used by the ObjectContext created, but is not owned by the context. The caller + must dispose of the connection once the context has been disposed. + + The type of context to create. + An existing connection to a database for use by the context. + + + + + Gets a cached delegate (or creates a new one) used to call the constructor for the given derived ObjectContext type. + + + + + A hash of the store model (SSDL) that can be used later to check if the model has changed or not. + Note that this is currently only supported for Code First. + + + + + A collection of all the properties for an underlying entity or complex object. + + + An instance of this class can be converted to an instance of the generic class + using the Cast method. + Complex properties in the underlying entity or complex object are represented in + the property values as nested instances of this class. + + + + + Initializes a new instance of the class. + + The internal dictionary. + + + + Creates an object of the underlying type for this dictionary and hydrates it with property + values from this dictionary. + + The properties of this dictionary copied into a new object. + + + + Sets the values of this dictionary by reading values out of the given object. + The given object can be of any type. Any property on the object with a name that + matches a property name in the dictionary and can be read will be read. Other + properties will be ignored. This allows, for example, copying of properties from + simple Data Transfer Objects (DTOs). + + The object to read values from. + + + + Creates a new dictionary containing copies of all the properties in this dictionary. + Changes made to the new dictionary will not be reflected in this dictionary and vice versa. + + A clone of this dictionary. + + + + Sets the values of this dictionary by reading values from another dictionary. + The other dictionary must be based on the same type as this dictionary, or a type derived + from the type for this dictionary. + + The dictionary to read values from. + + + + Gets the value of the property just like using the indexed property getter but + typed to the type of the generic parameter. This is useful especially with + nested dictionaries to avoid writing expressions with lots of casts. + + The type of the property. + Name of the property. + The value of the property. + + + + Gets the set of names of all properties in this dictionary as a read-only set. + + The property names. + + + + Gets or sets the value of the property with the specified property name. + The value may be a nested instance of this class. + + The property name. + The value of the property. + + + + Gets the internal dictionary. + + The internal dictionary. + + + + A non-generic version of the class. + + + + + Creates a from information in the given . + Use this method in preference to the constructor since it may potentially create a subclass depending on + the type of member represented by the InternalCollectionEntry instance. + + The internal reference entry. + The new entry. + + + + Initializes a new instance of the class. + + The internal entry. + + + + Loads the entity from the database. + Note that if the entity already exists in the context, then it will not overwritten with values from the database. + + + + + Returns the query that would be used to load this entity from the database. + The returned query can be modified using LINQ to perform filtering or operations in the database. + + A query for the entity. + + + + Returns the equivalent generic object. + + The type of entity on which the member is declared. + The type of the property. + The equivalent generic object. + + + + Gets the property name. + + The property name. + + + + Gets or sets the current value of the navigation property. The current value is + the entity that the navigation property references. + + The current value. + + + + Gets a value indicating whether the entity has been loaded from the database. + + true if the entity is loaded; otherwise, false. + + + + The to which this navigation property belongs. + + An entry for the entity that owns this navigation property. + + + + Gets the backing this object as an . + + The internal member entry. + + + + Instances of this class are returned from the Reference method of + and allow operations such as loading to + be performed on the an entity's reference navigation properties. + + The type of the entity to which this property belongs. + The type of the property. + + + + Creates a from information in the given . + Use this method in preference to the constructor since it may potentially create a subclass depending on + the type of member represented by the InternalCollectionEntry instance. + + The internal reference entry. + The new entry. + + + + Initializes a new instance of the class. + + The internal entry. + + + + Loads the entity from the database. + Note that if the entity already exists in the context, then it will not overwritten with values from the database. + + + + + Returns the query that would be used to load this entity from the database. + The returned query can be modified using LINQ to perform filtering or operations in the database. + + A query for the entity. + + + + Returns a new instance of the non-generic class for + the navigation property represented by this object. + + A non-generic version. + + + + Gets the property name. + + The property name. + + + + Gets or sets the current value of the navigation property. The current value is + the entity that the navigation property references. + + The current value. + + + + Gets a value indicating whether the entity has been loaded from the database. + + true if the entity is loaded; otherwise, false. + + + + Gets the underlying as an . + + The internal member entry. + + + + The to which this navigation property belongs. + + An entry for the entity that owns this navigation property. + + + + Represents an entity used to store metadata about an EDM in the database. + + + + + Attempts to get the model hash calculated by Code First for the given context. + This method will return null if the context is not being used in Code First mode. + + The context. + The hash string. + + + + Gets or sets the ID of the metadata entity, which is currently always 1. + + The id. + + + + Gets or sets the model hash which is used to check whether the model has + changed since the database was created from it. + + The model hash. + + + + This attribute can be applied to either an entire derived class or to + individual or properties on that class. When applied + any discovered or properties will still be included + in the model but will not be automatically initialized. + + + + + Generic wrapper around to allow results to be + returned as generic + + The type of the element. + + + + Executes the query and returns an enumerator for the elements. + + An object that can be used to iterate through the elements. + + + + Executes the query and returns an enumerator for the elements. + + + An object that can be used to iterate through the elements. + + + + + Returns a that contains the SQL string that was set + when the query was created. The parameters are not included. + + + A that represents this instance. + + + + + Throws an exception indicating that binding directly to a store query is not supported. + + + Never returns; always throws. + + + + + Returns false. + + false. + + + + Implements ICachedMetadataWorkspace for a Code First model. + + + + + Represents an object that holds a cached copy of a MetadataWorkspace and optionally the + assemblies containing entity types to use with that workspace. + + + + + Gets the MetadataWorkspace, potentially lazily creating it if it does not already exist. + If the workspace is not compatible with the provider manifest obtained from the given + connection then an exception is thrown. + + The connection to use to create or check SSDL provider info. + The workspace. + + + + The list of assemblies that contain entity types for this workspace, which may be empty, but + will never be null. + + + + + An SHA256 hash of the store model (SSDL) that can be used later to check if the model has changed or not. + Note that this is currently only supported for Code First. + + + + + The default container name for code first is the container name that is set from the DbModelBuilder + + + + + Builds and stores the workspace based on the given code first configuration. + + The code first EDM model. + + + + Gets the . + If the workspace is not compatible with the provider manifest obtained from the given + connection then an exception is thrown. + + The connection to use to create or check SSDL provider info. + The workspace. + + + + The default container name for code first is the container name that is set from the DbModelBuilder + + + + + The list of assemblies that contain entity types for this workspace, which may be empty, but + will never be null. + + + + + An SHA256 hash of the store model (SSDL) that can be used later to check if the model has changed or not. + + + + + Encapsulates information read from the application config file that specifies a database initializer + and allows that initializer to be dynamically applied. + + + + + Initializes a new instance of the class. + + The key from the entry in the config file. + The value from the enrty in the config file. + + + + Uses the context type and initializer type specified in the config to create an initializer instance + and set it with the DbDbatabase.SetInitializer method. + + + + + Reads all initializers from the application config file and sets them using the Database class. + + + + + The methods here are called from multiple places with an ObjectContext that may have + been created in a variety of ways and ensure that the same code is run regardless of + how the context was created. + + + + + Used a delegate to do the actual creation once an ObjectContext has been obtained. + This is factored in this way so that we do the same thing regardless of how we get to + having an ObjectContext. + Note however that a context obtained from only a connection will have no model and so + will result in an empty database. + + + + + Used a delegate to do the actual checking/creation once an ObjectContext has been obtained. + This is factored in this way so that we do the same thing regardless of how we get to + having an ObjectContext. + Note however that a context obtained from only a connection will have no model and so + will result in an empty database. + + + + + Used a delegate to do the actual existence check once an ObjectContext has been obtained. + This is factored in this way so that we do the same thing regardless of how we get to + having an ObjectContext. + + + + + Used a delegate to do the actual check/delete once an ObjectContext has been obtained. + This is factored in this way so that we do the same thing regardless of how we get to + having an ObjectContext. + + + + + Helper class that extends Tuple to give the Item1 and Item2 properties more meaningful names. + + + + + Creates a new pair of the given set of entity types and DbSet initializer delegate. + + + + + The entity types part of the pair. + + + + + The DbSet properties initializer part of the pair. + + + + + Static helper methods only. + + + + + Checks whether the given value is null and throws ArgumentNullException if it is. + This method should only be used in places where Code Contracts are compiled out in the + release build but we still need public surface null-checking, such as where a public + abstract class is implemented by an internal concrete class. + + + + + Checks whether the given string is null, empty, or just whitespace, and throws appropriately + if the check fails. + This method should only be used in places where Code Contracts are compiled out in the + release build but we still need public surface checking, such as where a public + abstract class is implemented by an internal concrete class. + + + + + Given two key values that may or may not be byte arrays, this method determines + whether or not they are equal. For non-binary key values, this is equivalent + to Object.Equals. For binary keys, it is by comparison of every byte in the + arrays. + + + + + Provides a standard helper method for quoting identifiers + + Identifier to be quoted. Does not validate that this identifier is valid. + Quoted string + + + + Checks the given string which might be a database name or a connection string and determines + whether it should be treated as a name or connection string. Currently, the test is simply + whether or not the string contains an '=' character--if it does, then it should be treated + as a connection string. + + The name or connection string. + true if the string should be treated as a connection string; false if it should be treated as a name. + + + + Determines whether the given string should be treated as a database name directly (it contains no '='), + is in the form name=foo, or is some other connection string. If it is a direct name or has name=, then + the name is extracted and the method returns true. + + The name or connection string. + The name. + True if a name is found; false otherwise. + + + + Determines whether the given string is a full EF connection string with provider, provider connection string, + and metadata parts, or is is instead some other form of connection string. + + The name or connection string. + true if the given string is an EF connection string; otherwise, false. + + + + + Parses a property selector expression used for the expression-based versions of the Property, Collection, Reference, + etc methods on and + classes. + + The type of the entity. + The type of the property. + The property. + Name of the method. + Name of the param. + The property name. + + + + Called recursively to parse an expression tree representing a property path such + as can be passed to Include or the Reference/Collection/Property methods of . + This involves parsing simple property accesses like o => o.Products as well as calls to Select like + o => o.Products.Select(p => p.OrderLines). + + The expression to parse. + The expression parsed into an include path, or null if the expression did not match. + True if matching succeeded; false if the expression could not be parsed. + + + + Gets a cached dictionary mapping property names to property types for all the properties + in the given type. + + + + + Gets a dictionary of compiled property setter delegates for the underlying types. + The dictionary is cached for the type in the app domain. + + + + + Used by the property setter delegates to throw for attempts to set null onto + non-nullable properties or otherwise go ahead and set the property. + + + + + Gets a dictionary of compiled property getter delegates for the underlying types. + The dictionary is cached for the type in the app domain. + + + + + Creates a new with the NoTracking merge option applied. + The query object passed in is not changed. + + The query. + A new query with NoTracking applied. + + + + Converts to + + + Name of the property being validated with ValidationAttributes. Null for type-level validation. + + + ValidationResults instances to be converted to instances. + + + An created based on the + . + + + class contains a property with names of properties the error applies to. + On the other hand each applies at most to a single property. As a result for + each name in ValidationResult.MemberNames one will be created (with some + exceptions for special cases like null or empty .MemberNames or null names in the .MemberNames). + + + + + Calculates a "path" to a property. For primitive properties on an entity type it is just the + name of the property. Otherwise it is a dot separated list of names of the property and all + its ancestor properties starting from the entity. + + Property for which to calculate the path. + Dot separated path to the property. + + + + Gets names of the property and its ancestor properties as enumerable walking "bottom-up". + + Property for which to get the segments. + Names of the property and its ancestor properties. + + + + Gets an type for the given element type. + + Type of the element. + The collection type. + + + + Creates a database name given a type derived from DbContext. This handles nested and + generic classes. No attempt is made to ensure that the name is not too long since this + is provider specific. If a too long name is generated then the provider will throw and + the user must correct by specifying their own name in the DbContext constructor. + + Type of the context. + The database name to use. + + + + Creates a clone of the given that has the same connection and + loaded metadata as the original but a new, empty, state manager. + + The original. + The clone. + + + + Finds the assemblies that were used for loading o-space types in the source context + and loads those assemblies in the destination context. + + The source. + The destination. + + + + A local (in-memory) view of the entities in a DbSet. + This view contains Added entities and does not contain Deleted entities. The view extends + from and hooks up events between the collection and the + state manager to keep the view in sync. + + The type of the entity. + + + + Initializes a new instance of the class for entities + of the given generic type in the given internal context. + + The internal context. + + + + Called by the base class when the collection changes. + This method looks at the change made to the collection and reflects those changes in the + state manager. + + The instance containing the event data. + + + + Handles events from the state manager for entities entering, leaving, or being marked as deleted. + The local view is kept in sync with these changes. + + The sender. + The instance containing the event data. + + + + Clears the items by calling remove on each item such that we get Remove events that + can be tracked back to the state manager, rather than a single Reset event that we + cannot deal with. + + + + + Adds a contains check to the base implementation of InsertItem since we can't support + duplicate entities in the set. + + The index at which to insert. + The item to insert. + + + + Returns a cached binding list implementation backed by this ObservableCollection. + + The binding list. + + + + Service used to search for instance properties on a DbContext class that can + be assigned a DbSet instance. Also, if the the property has a public setter, + then a delegate is compiled to set the property to a new instance of DbSet. + All of this information is cached per app domain. + + + + + Creates a set discovery service for the given derived context. + + + + + Processes the given context type to determine the DbSet or IDbSet + properties and collect root entity types from those properties. Also, delegates are + created to initialize any of these properties that have public setters. + If the type has been processed previously in the app domain, then all this information + is returned from a cache. + + A dictionary of potential entity type to the list of the names of the properties that used the type. + + + + Calls the public setter on any property found to initialize it to a new instance of DbSet. + + + + + Registers the entities and their entity set name hints with the given . + + The model builder. + + + + Returns false if SuppressDbSetInitializationAttribute is found on the property or the class, otherwise + returns true. + + + + + Determines whether or not an instance of DbSet/ObjectSet can be assigned to a property of the given type. + + The type to check. + The entity type of the DbSet/ObjectSet that can be assigned, or null if no set type can be assigned. + + + + + A EagerInternalConnection object wraps an already existing DbConnection object. + + + + + InternalConnection objects manage DbConnections. + Two concrete base classes of this abstract interface exist: + and . + + + + + IInternalConnection objects manage DbConnections. + Two concrete implementations of this interface exist--LazyInternalConnection and EagerInternalConnection. + + + + + Creates an from metadata in the connection. This method must + only be called if ConnectionHasModel returns true. + + The newly created context. + + + + Returns the underlying DbConnection. + + + + + Returns a key consisting of the connection type and connection string. + If this is an EntityConnection then the metadata path is included in the key returned. + + + + + Gets a value indicating whether the connection is an EF connection which therefore contains + metadata specifying the model, or instead is a store connection, in which case it contains no + model info. + + true if the connection contains model info; otherwise, false. + + + + Creates an from metadata in the connection. This method must + only be called if ConnectionHasModel returns true. + + The newly created context. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Returns the underlying DbConnection. + + + + + Returns a key consisting of the connection type and connection string. + If this is an EntityConnection then the metadata path is included in the key returned. + + + + + + Gets a value indicating whether the connection is an EF connection which therefore contains + metadata specifying the model, or instead is a store connection, in which case it contains no + model info. + + true if the connection contains model info; otherwise, false. + + + + Gets or sets the underlying object. No initialization is done when the + connection is obtained, and it can also be set to null. + + The underlying connection. + + + + Creates a new EagerInternalConnection that wraps an existing DbConnection. The existing DbConnection will not + be disposed when the EagerInternalConnection is disposed. + + An existing connection. + If set to true then the underlying connection should be disposed when this object is disposed. + + + + Dispose the existing connection is the original caller has specified that it should be disposed + by the framework. + + + + + An is an where the + instance that it wraps is set immediately at construction time rather than being created lazily. In this case + the internal context may or may not own the instance but will only dispose it + if it does own it. + + + + + An underlies every instance of and wraps an + instance. + The also acts to expose necessary information to other parts of the design in a + controlled manner without adding a lot of internal methods and properties to the + class itself. + Two concrete classes derive from this abstract class - and + . + + + + + Initializes the object with its owner. + + The owner . + + + + Returns the underlying without causing the underlying database to be created + or the database initialization strategy to be executed. + This is used to get a context that can then be used for database creation/initialization. + + + + + Creates a new temporary based on the same metadata and connection as the real + and sets it as the context to use DisposeTempObjectContext is called. + This allows this internal context and its DbContext to be used for transient operations + such as initializing and seeding the database, after which it can be thrown away. + This isolates the real from any changes made and and saves performed. + + + + + If a temporary ObjectContext was set with UseTempObjectContext, then this method disposes that context + and returns this internal context and its DbContext to using the real ObjectContext. + + + + + This method returns true if the context has a model hash and the database contains a model hash + and these hashes match. This indicates that the model used to create the database is the same + as the current model and so the two can be used together. + + If set to true then an exception will be thrown if no + model metadata is found either in the model associated with the context or in the database + itself. If set to false then this method will return true if metadata is + not found. + True if the model hash in the context and the database match; false otherwise. + + + + Queries the database for a model hash and returns it if found or returns null if the table + or the row doesn't exist in the database. + + The model hash, or null if not found. + + + + Saves the model hash from the context to the database. + + + + + Performs the initialization action that may result in a and + handle the exception to provide more meaning to the user. + + The action. + + + + Registers for the ObjectStateManagerChanged event on the underlying ObjectStateManager. + This is a virtual method on this class so that it can be mocked. + + The event handler. + + + + Checks whether or not the given object is in the context in any state other than Deleted. + This is a virtual method on this class so that it can be mocked. + + The entity. + true if the entity is in the context and not deleted; otherwise false. + + + + Saves all changes made in this context to the underlying database. + + The number of objects written to the underlying database. + + + + Runs the Code First pipeline to create a that can then be used to create + an EDMX. This method throws if the context: + was created based on an existing + or was created from information in an existing + or is being used in Model/Database First mode. + This method always runs the full Code First pipeline, including calling OnModelCreating, even if + the pipeline has already been run. + + The builder. + + + + Initializes this instance, which means both the context is initialized and the underlying + database is initialized. + + + + + Initializes the underlying ObjectContext but does not cause the database to be initialized. + + + + + Runs the unless it has already been run or there + is no initializer for this context type in which case this method does nothing. + + + + + Marks the database as having been initialized without actually running the . + + + + + Runs the if one has been set for this context type. + Calling this method will always cause the initializer to run even if the database is marked + as initialized. + + + + + Disposes the context. Override the DisposeContext method to perform + additional work when disposing. + + + + + Performs additional work to dispose a context. The default implementation + does nothing. + + + + + Calls DetectChanges on the underlying if AutoDetectChangesEnabled is + true or if force is set to true. + + if set to true then DetectChanges is called regardless of the value of AutoDetectChangesEnabled. + + + + Returns the DbSet instance for the given entity type. + This property is virtual and returns to that it can be mocked. + + The entity type for which a set should be returned. + A set for the given entity type. + + + + Returns the non-generic instance for the given entity type. + This property is virtual and returns to that it can be mocked. + + The entity type for which a set should be returned. + A set for the given entity type. + + + + Creates an internal set using an app domain cached delegate. + + Type of the entity. + The set. + + + + Returns the entity set and the base type for that entity set for the given type. + This method does o-space loading if required and throws if the type is not in the model. + + The entity type to lookup. + The entity set and base type pair. + + + + Checks whether or not the given entity type is mapped in the model. + + The entity type to lookup. + True if the type is mapped as an entity; false otherwise. + + + + Gets the local entities of the type specified from the state manager. That is, all + Added, Modified, and Unchanged entities of the given type. + + The type of entity to get. + The entities. + + + + Executes the given SQL query against the database backing this context. The results are not materialized as + entities or tracked. + + The type of the element. + The SQL. + The parameters. + The query results. + + + + Executes the given SQL query against the database backing this context. The results are not materialized as + entities or tracked. + + Type of the element. + The SQL. + The parameters. + The query results. + + + + Calls the generic ExecuteSqlQuery but with a non-generic return type so that it + has the correct signature to be used with CreateDelegate above. + + + + + Executes the given SQL command against the database backing this context. + + The SQL. + The parameters. + The return value from the database. + + + + Gets the underlying for the given entity, or returns null if the entity isn't tracked by this context. + This method is virtual so that it can be mocked. + + The entity. + The state entry or null. + + + + Gets the underlying objects for all entities tracked by + this context. + This method is virtual so that it can be mocked. + + State entries for all tracked entities. + + + + Gets the underlying objects for all entities of the given + type tracked by this context. + This method is virtual so that it can be mocked. + + The type of the entity. + State entries for all tracked entities of the given type. + + + + Helper method that gets the underlying objects for all entities that + match the given predicate. + + + + + Wraps the given in either a or + a depending on the actual exception type and the state + entries involved. + + The update exception. + A new exception wrapping the given exception. + + + + Uses the underlying context to create an entity such that if the context is configured + to create proxies and the entity is suitable then a proxy instance will be returned. + This method is virtual so that it can be mocked. + + The type of the entity. + The new entity instance. + + + + Uses the underlying context to create an entity such that if the context is configured + to create proxies and the entity is suitable then a proxy instance will be returned. + This method is virtual so that it can be mocked. + + The type of entity to create. + The new entity instance. + + + + This method is used by CreateDelegate to transform the CreateObject method with return type TEntity + into a method with return type object which matches the required type of the delegate. + + + + + Throws if the context has been disposed. + + + + + Checks whether or not the internal cache of types to entity sets has been initialized, + and initializes it if necessary. + + + + + Performs o-space loading for the type and returns false if the type is not in the model. + + + + + Performs o-space loading for the type and throws if the type is not in the model. + + Type of the entity. + + + + Returns true if the given entity type does not have EdmEntityTypeAttribute but is in + an assembly that has EdmSchemaAttribute. This indicates mixing of POCO and EOCO in the + same assembly, which is something that we don't support. + + + + + Determines whether or not the given clrType is mapped to a complex type. Assumes o-space loading has happened. + + + + + Updates the cache of types to entity sets either for the first time or after potentially + doing some o-space loading. + + + + + The public context instance that owns this internal context. + + + + + Returns the underlying . + + + + + Gets the temp object context, or null if none has been set. + + The temp object context. + + + + An SHA256 hash of the store model (SSDL) that can be used later to check if the model has changed or not. + Note that this is currently only supported for Code First. + + + + + Gets the default database initializer to use for this context if no other has been registered. + For code first this property returns a instance. + For database/model first, this property returns null. + + The default initializer. + + + + Gets or sets a value indicating whether lazy loading is enabled. + + + + + Gets or sets a value indicating whether proxy creation is enabled. + + + + + Gets or sets a value indicating whether DetectChanges is called automatically in the API. + + + + + Gets or sets a value indicating whether to validate entities when is called. + + + + + True if the context has been disposed. + + + + + The connection underlying this context. Accessing this property does not cause the context + to be initialized, only its connection. + + + + + Gets the DatabaseOperations instance to use to perform Create/Delete/Exists operations + against the database. + Note that this virtual property can be mocked to help with unit testing. + + + + + Gets instance used to create validators and validation contexts. + This property is virtual to allow mocking. + + + + + Constructs an for an already existing . + + The owner . + The existing . + + + + Returns the underlying without causing the underlying database to be created + or the database initialization strategy to be executed. + This is used to get a context that can then be used for database creation/initialization. + + + + + Throws an exception since creating a from a context created using + an existing is not supported. + + This method never returns. + + + + Does nothing, since the already exists. + + + + + Does nothing since the database is always considered initialized if the was created + from an existing . + + + + + Does nothing since the database is always considered initialized if the was created + from an existing . + + + + + Disposes the context. The underlying is also disposed if it is owned. + + + + + Returns the underlying . + + + + + An SHA256 hash of the store model (SSDL) that can be used later to check if the model has changed or not. + Note that this is currently only supported for Code First. + + + + + Gets the default database initializer to use for this context if no other has been registered. + For code first this property returns a instance. + For database/model first, this property returns null. + + The default initializer. + + + + The connection underlying this context. + + + + + Gets or sets a value indicating whether lazy loading is enabled. This is just a wrapper + over the same flag in the underlying . + + + + + Gets or sets a value indicating whether proxy creation is enabled. This is just a wrapper + over the same flag in the underlying ObjectContext. + + + + + Helper class that extends Tuple to give the Item1 and Item2 properties more meaningful names. + + + + + Creates a new pair of the given EntitySet and BaseType. + + + + + The EntitySet part of the pair. + + + + + The BaseType part of the pair. + + + + + Helper class that extends Tuple to give the Item1 and Item2 properties more meaningful names. + + + + + Creates a new pair of the given database initializer delegate and a flag + indicating whether or not it is locked. + + + + + The initializer delegate. + + + + + A flag indicating whether or not the initializer is locked and should not be changed. + + + + + Represents a raw SQL query against the context for any type where the results are never + associated with an entity set and are never tracked. + + + + + Represents a raw SQL query against the context that may be for entities in an entity set + or for some other non-entity element type. + + + + + Initializes a new instance of the class. + + The SQL. + The parameters. + + + + If the query is would track entities, then this method returns a new query that will + not track entities. + + A no-tracking query. + + + + Executes the query and returns an enumerator for the results. + + The query results. + + + + Throws an exception indicating that binding directly to a store query is not supported. + + + Never returns; always throws. + + + + + Returns a that contains the SQL string that was set + when the query was created. The parameters are not included. + + + A that represents this instance. + + + + + Gets the SQL query string, + + The SQL query. + + + + Gets the parameters. + + The parameters. + + + + Returns false. + + false. + + + + Initializes a new instance of the class. + + The internal context. + Type of the element. + The SQL. + The parameters. + + + + Returns this query since it can never be a tracking query. + + This instance. + + + + Executes the query and returns an enumerator for the results. + + The query results. + + + + Represents a raw SQL query against the context for entities in an entity set. + + + + + Initializes a new instance of the class. + + The set. + The SQL. + if set to true then the entities will not be tracked. + The parameters. + + + + If the query is would track entities, then this method returns a new query that will + not track entities. + + A no-tracking query. + + + + Executes the query and returns an enumerator for the results. + + The query results. + + + + Gets a value indicating whether this instance is set to track entities or not. + + + true if this instance is no-tracking; otherwise, false. + + + + + A LazyInternalConnection object manages information that can be used to create a DbConnection object and + is responsible for creating that object and disposing it. + + + + + Creates a new LazyInternalConnection. The DbConnection object will be created lazily on demand and will be + disposed when the LazyInternalConnection is disposed. + + Either the database name or a connection string. + + + + Creates an from metadata in the connection. This method must + only be called if ConnectionHasModel returns true. + + The newly created context. + + + + Disposes the underlying DbConnection. + Note that dispose actually puts the LazyInternalConnection back to its initial state such that + it can be used again. + + + + + Creates the underlying (which may actually be an ) + if it does not already exist. + + + + + Searches the app.config/web.config file for a connection that matches the given name. + The connection might be a store connection or an EF connection. + + The connection name. + True if a connection from the app.config file was found and used. + + + + Returns the underlying DbConnection, creating it first if it does not already exist. + + + + + Returns a key consisting of the connection type and connection string. + If this is an EntityConnection then the metadata path is included in the key returned. + + + + + + Gets a value indicating whether the connection is an EF connection which therefore contains + metadata specifying the model, or instead is a store connection, in which case it contains no + model info. + + true if connection contain model info; otherwise, false. + + + + A is a concrete type that will lazily create the + underlying when needed. The created is owned by the + internal context and will be disposed when the internal context is disposed. + + + + + Constructs a for the given owner that will be initialized + on first use. + + The owner . + Responsible for creating a connection lazily when the context is used for the first time. + The model, or null if it will be created by convention + + + + Returns the underlying without causing the underlying database to be created + or the database initialization strategy to be executed. + This is used to get a context that can then be used for database creation/initialization. + + + + + Saves all changes made in this context to the underlying database, but only if the + context has been initialized. If the context has not been initialized, then this + method does nothing because there is nothing to do; in particular, it does not + cause the context to be initialized. + + The number of objects written to the underlying database. + + + + Disposes the context. The underlying is also disposed. + The connection to the database ( object) is also disposed if it was created by + the context, otherwise it is not disposed. + + + + + Initializes the underlying . + + + + + Creates an immutable, cacheable representation of the model defined by this builder. + This model can be used to create an or can be passed to a + constructor to create a for this model. + + + + + + Creates and configures the instance that will be used to build the + . + + The builder. + + + + Runs the Code First pipeline to create a that can then be used to create + an EDMX. This method throws if the context: + was created from information in an existing + or is being used in Model/Database First mode. + This method always runs the full Code First pipeline, including calling OnModelCreating, even if + the pipeline has already been run. + + The builder. + + + + Marks the database as having been initialized without actually running the . + + + + + Runs the unless it has already been run or there + is no initializer for this context type in which case this method does nothing. + + + + + Performs some action (which may do nothing) in such a way that it is guaranteed only to be run + once for the model and connection in this app domain, unless it fails by throwing an exception, + in which case it will be re-tried next time the context is initialized. + + The action. + + + + Returns the underlying . + + + + + An SHA256 hash of the store model (SSDL) that can be used later to check if the model has changed or not. + Note that this is currently only supported for Code First. + + + + + The actually being used, which may be the + temp context for initialization or the real context. + + + + + The connection underlying this context. Accessing this property does not cause the context + to be initialized, only its connection. + + + + + Gets the default database initializer to use for this context if no other has been registered. + For code first this property returns a instance. + For database/model first, this property returns null. + + The default initializer. + + + + Gets or sets a value indicating whether lazy loading is enabled. + If the exists, then this property acts as a wrapper over the flag stored there. + If the has not been created yet, then we store the value given so we can later + use it when we create the . This allows the flag to be changed, for example in + a DbContext constructor, without it causing the to be created. + + + + + Gets or sets a value indicating whether proxy creation is enabled. + If the ObjectContext exists, then this property acts as a wrapper over the flag stored there. + If the ObjectContext has not been created yet, then we store the value given so we can later + use it when we create the ObjectContext. This allows the flag to be changed, for example in + a DbContext constructor, without it causing the ObjectContext to be created. + + + + + Extends to create a sortable binding list that stays in + sync with an underlying . That is, when items are added + or removed from the binding list, they are added or removed from the ObservableCollecion, and + vice-versa. + + The list element type. + + + + An extended BindingList implementation that implements sorting. + This class was adapted from the LINQ to SQL class of the same name. + + The element type. + + + + Initializes a new instance of the class with the + the given underlying list. Note that sorting is dependent on having an actual + rather than some other ICollection implementation. + + The list. + + + + Applies sorting to the list. + + The property to sort by. + The sort direction. + + + + Stops sorting. + + + + + Gets a value indicating whether this list is sorted. + + + true if this instance is sorted; otherwise, false. + + + + + Gets the sort direction. + + The sort direction. + + + + Gets the sort property being used to sort. + + The sort property. + + + + Returns true indicating that this list supports sorting. + + true. + + + + Implements comparing for the implementation. + + + + + Initializes a new instance of the class + for sorting the list. + + The property to sort by. + The sort direction. + + + + Compares two instances of items in the list. + + The left item to compare. + The right item to compare. + + + + + Determines whether this instance can sort for the specified type. + + The type. + + true if this instance can sort for the specified type; otherwise, false. + + + + + Determines whether this instance can sort for the specified type using IComparable. + + The type. + + true if this instance can sort for the specified type; otherwise, false. + + + + + Determines whether this instance can sort for the specified type using ToString. + + The type. + + true if this instance can sort for the specified type; otherwise, false. + + + + + Initializes a new instance of a binding list backed by the given + + The obervable collection. + + + + Creates a new item to be added to the binding list. + + The new item. + + + + Cancels adding of a new item that was started with AddNew. + + Index of the item. + + + + Removes all items from the binding list and underlying ObservableCollection. + + + + + Ends the process of adding a new item that was started with AddNew. + + Index of the item. + + + + Inserts the item into the binding list at the given index. + + The index. + The item. + + + + Removes the item at the specified index. + + The index. + + + + Sets the item into the list at the given position. + + The index to insert at. + The item. + + + + Event handler to update the binding list when the underlying observable collection changes. + + The sender. + Data indicating how the collection has changed. + + + + Adds the item to the underlying observable collection. + + The item. + + + + Removes the item from the underlying from observable collection. + + The item. + + + + A wrapper around EntityKey that allows key/values pairs that have null values to + be used. This allows Added entities with null key values to be searched for in + the ObjectStateManager. + + + + The key name/key value pairs, where some key values may be null + + + + Creates a new WrappedEntityKey instance. + + The entity set that the key belongs to. + The fully qualified name of the given entity set. + The key values, which may be null or contain null values. + The name of the parameter passed for keyValue by the user, which is used when throwing exceptions. + + + + True if any of the key values are null, which means that the EntityKey will also be null. + + + + + An actual EntityKey, or null if any of the key values are null. + + + + + The key name/key value pairs of the key, in which some of the key values may be null. + + + + + A concrete implementation of used for properties of complex objects. + + + + + The internal class used to implement and + . + This internal class contains all the common implementation between the generic and non-generic + entry classes and also allows for a clean internal factoring without compromising the public API. + + + + + Base class for all internal entries that represent different kinds of properties. + + + + + Initializes a new instance of the class. + + The internal entity entry. + The member metadata. + + + + Validates this property. + + A sequence of validation errors for this property. Empty if no errors. Never null. + + + + Creates a new non-generic backed by this internal entry. + The actual subtype of the DbMemberEntry created depends on the metadata of this internal entry. + + The new entry. + + + + Creates a new generic backed by this internal entry. + The actual subtype of the DbMemberEntry created depends on the metadata of this internal entry. + + The type of the entity. + The type of the property. + The new entry. + + + + Gets the property name. + The property is virtual to allow mocking. + + The property name. + + + + Gets or sets the current value of the navigation property. + + The current value. + + + + Gets the internal entity entry property belongs to. + This property is virtual to allow mocking. + + The internal entity entry. + + + + Gets the entry metadata. + + The entry metadata. + + + + Initializes a new instance of the class. + + The internal entry. + The property info. + + + + Creates a delegate that will get the value of this property. + + The delegate. + + + + Creates a delegate that will set the value of this property. + + The delegate. + + + + Returns true if the property of the entity that this property is ultimately part + of is set as modified. If this is a property of an entity, then this method returns + true if the property is modified. If this is a property of a complex object, then + this method returns true if the top-level complex property on the entity is modified. + + True if the entity property is modified. + + + + Sets the property of the entity that this property is ultimately part of to modified. + If this is a property of an entity, then this method marks it as modified. + If this is a property of a complex object, then this method marks the top-level + complex property as modified. + + + + + Throws if the user attempts to set a complex property to null. + + The value. + + + + Sets the given value directly onto the underlying entity object. + + The value. + True if the property had a setter that we could attempt to call; false if no setter was available. + + + + Sets the property value, potentially by setting individual nested values for a complex + property. + + The value. + + + + Gets an internal object representing a scalar or complex property of this property, + which must be a mapped complex property. + This method is virtual to allow mocking. + + The property. + The type of object requested, which may be null or 'object' if any type can be accepted. + if set to true then the found property must be a complex property. + The entry. + + + + Validates that the owning entity entry is associated with an underlying and + is not just wrapping a non-attached entity. + + + + + Creates a new non-generic backed by this internal entry. + The runtime type of the DbMemberEntry created will be or a subtype of it. + + The new entry. + + + + Creates a new generic backed by this internal entry. + The runtime type of the DbMemberEntry created will be or a subtype of it. + + The type of the entity. + The type of the property. + The new entry. + + + + Returns parent property, or null if this is a property on the top-level entity. + + + + + Gets the current values of the parent entity or complex property. + That is, the current values that contains the value for this property. + + The parent current values. + + + + Gets the original values of the parent entity or complex property. + That is, the original values that contains the value for this property. + + The parent original values. + + + + A delegate that reads the value of this property. + May be null if there is no way to set the value due to missing accessors on the type. + + + + + A delegate that sets the value of this property. + May be null if there is no way to set the value due to missing accessors on the type. + + + + + Gets or sets the original value. + Note that complex properties are returned as objects, not property values. + + + + + Gets or sets the current value. + Note that complex properties are returned as objects, not property values. + Also, for complex properties, the object returned is the actual complex object from the entity + and setting the complex object causes the actual object passed to be set onto the entity. + + The current value. + + + + Gets or sets a value indicating whether this property is modified. + + + + + Gets the property metadata. + + The property metadata. + + + + Initializes a new instance of the class. + + The parent property entry. + The property metadata. + + + + Creates a delegate that will get the value of this property. + + The delegate. + + + + Creates a delegate that will set the value of this property. + + The delegate. + + + + Returns true if the property of the entity that this property is ultimately part + of is set as modified. Since this is a property of a complex object + this method returns true if the top-level complex property on the entity is modified. + + True if the entity property is modified. + + + + Sets the property of the entity that this property is ultimately part of to modified. + Since this is a property of a complex object this method marks the top-level + complex property as modified. + + + + + Returns parent property, or null if this is a property on the top-level entity. + + + + + Gets the current values of the parent complex property. + That is, the current values that contains the value for this property. + + The parent current values. + + + + Gets the original values of the parent complex property. + That is, the original values that contains the value for this property. + + The parent original values. + + + + Contains metadata about a member of an entity type or complex type. + + + + + Initializes a new instance of the class. + + The type that the property is declared on. + Type of the property. + The property name. + + + + Creates a new the runtime type of which will be + determined by the metadata. + + The entity entry to which the member belongs. + The parent property entry if the new entry is nested, otherwise null. + The new entry. + + + + Gets the type of the member for which this is metadata. + + The type of the member entry. + + + + Gets the name of the property. + + The name. + + + + Gets the type of the entity or complex object that on which the member is declared. + + The type that the member is declared on. + + + + Gets the type of element for the property, which for non-collection properties + is the same as the MemberType and which for collection properties is the type + of element contained in the collection. + + The type of the element. + + + + Gets the type of the member, which for collection properties is the type + of the collection rather than the type in the collection. + + The type of the member. + + + + The types of member entries supported. + + + + + Initializes a new instance of the class. + + The type that the property is declared on. + Type of the property. + The property name. + if set to true this is a collection nav prop. + + + + Creates a new the runtime type of which will be + determined by the metadata. + + The entity entry to which the member belongs. + The parent property entry which will always be null for navigation entries. + The new entry. + + + + Gets the type of the member for which this is metadata. + + The type of the member entry. + + + + Gets the type of the member, which for collection properties is the type + of the collection rather than the type in the collection. + + The type of the member. + + + + The internal class used to implement and + . + This internal class contains all the common implementation between the generic and non-generic + entry classes and also allows for a clean internal factoring without compromising the public API. + + + + + Base class for and + containing common code for collection and reference navigation property entries. + + + + + Initializes a new instance of the class. + + The internal entity entry. + The navigation metadata. + + + + Calls Load on the underlying . + + + + + Uses CreateSourceQuery on the underlying to create a query for this + navigation property. + + + + + Gets the navigation property value from the object. + + The entity. + The navigation property value. + + + + Validates that the owning entity entry is associated with an underlying and + is not just wrapping a non-attached entity. + If the entity is not detached, then the RelatedEnd for this navigation property is obtained. + + + + + Calls IsLoaded on the underlying . + + + + + Gets the related end, which will be null if the entity is not being tracked. + + The related end. + + + + Gets or sets the current value of the navigation property. The current value is + the entity that the navigation property references or the collection of references + for a collection property. + This property is virtual so that it can be mocked. + + The current value. + + + + Gets a delegate that can be used to get the value of the property directly from the entity. + Returns null if the property does not have an accessible getter. + + The getter delegate, or null. + + + + Gets a delegate that can be used to set the value of the property directly on the entity. + Returns null if the property does not have an accessible setter. + + The setter delegate, or null. + + + + Initializes a new instance of the class. + + The internal entity entry. + The navigation metadata. + + + + Gets the navigation property value from the object. + Since for a collection the related end is an , it means + that the internal representation of the navigation property is just the related end. + + The entity. + The navigation property value. + + + + Creates a new non-generic backed by this internal entry. + The runtime type of the DbMemberEntry created will be or a subtype of it. + + The new entry. + + + + Creates a new generic backed by this internal entry. + The runtime type of the DbMemberEntry created will be or a subtype of it. + + The type of the entity. + The type of the property. + The new entry. + + + + Creates a new generic backed by this internal entry. + The actual subtype of the DbCollectionEntry created depends on the metadata of this internal entry. + + The type of the entity. + The type of the element. + The new entry. + + + + Creates a object for the given entity type + and collection element type. + + The type of the entity. + The type of the property. + Type of the element. + The set. + + + + Gets or sets the current value of the navigation property. The current value is + the entity that the navigation property references or the collection of references + for a collection property. + + The current value. + + + + A concrete implementation of used for properties of entities. + + + + + Initializes a new instance of the class. + + The internal entry. + The property info. + + + + Creates a delegate that will get the value of this property. + + The delegate. + + + + Creates a delegate that will set the value of this property. + + The delegate. + + + + Returns true if the property of the entity that this property is ultimately part + of is set as modified. Since this is a property of an entity this method returns + true if the property is modified. + + True if the entity property is modified. + + + + Sets the property of the entity that this property is ultimately part of to modified. + Since this is a property of an entity this method marks it as modified. + + + + + Returns parent property, or null if this is a property on the top-level entity. + + + + + Gets the current values of the parent entity. + That is, the current values that contains the value for this property. + + The parent current values. + + + + Gets the original values of the parent entity. + That is, the original values that contains the value for this property. + + The parent original values. + + + + The internal class used to implement , + and . + This internal class contains all the common implementation between the generic and non-generic + entry classes and also allows for a clean internal factoring without compromising the public API. + + + + + Initializes a new instance of the class. + + The internal entity entry. + The navigation metadata. + + + + Gets the navigation property value from the object. + For reference navigation properties, this means getting the value from the + object. + + The entity. + The navigation property value. + + + + Sets the navigation property value onto the object. + For reference navigation properties, this means setting the value onto the + object. + + The entity. + The value. + + + + Sets the given value on the given which must be an + . + This method is setup in such a way that it can easily be used by CreateDelegate without any + dynamic code generation needed. + + The type of the related entity. + The entity reference. + The value. + + + + Creates a new non-generic backed by this internal entry. + The runtime type of the DbMemberEntry created will be or a subtype of it. + + The new entry. + + + + Creates a new generic backed by this internal entry. + The runtime type of the DbMemberEntry created will be or a subtype of it. + + The type of the entity. + The type of the property. + The new entry. + + + + Gets or sets the current value of the navigation property. The current value is + the entity that the navigation property references or the collection of references + for a collection property. + + The current value. + + + + Contains metadata for a property of a complex object or entity. + + + + + Initializes a new instance of the class. + + The type that the property is declared on. + Type of the property. + The property name. + if set to true the property is mapped in the EDM. + if set to true the property is a complex property. + + + + Validates that the given name is a property of the declaring type (either on the CLR type or in the EDM) + and that it is a complex or scalar property rather than a nav property and then returns metadata about + the property. + + The internal context. + The type that the property is declared on. + The type of property requested, which may be 'object' if any type can be accepted. + Name of the property. + Metadata about the property, or null if the property does not exist or is a navigation property. + + + + Creates a new the runtime type of which will be + determined by the metadata. + + The entity entry to which the member belongs. + The parent property entry if the new entry is nested, otherwise null. + The new entry. + + + + Gets a value indicating whether this is a complex property. + That is, not whether or not this is a property on a complex object, but rather if the + property itself is a complex property. + + + true if this instance is complex; otherwise, false. + + + + + Gets the type of the member for which this is metadata. + + The type of the member entry. + + + + Gets a value indicating whether this instance is mapped in the EDM. + + true if this instance is mapped; otherwise, false. + + + + Gets the type of the member, which for collection properties is the type + of the collection rather than the type in the collection. + + The type of the member. + + + + An implementation of that represents a clone of another + dictionary. That is, all the property values have been been copied into this dictionary. + + + + + The internal class used to implement . + This internal class allows for a clean internal factoring without compromising the public API. + + + + + Initializes a new instance of the class. + + The internal context with which the entity of complex object is associated. + The type of the entity or complex object. + If set to true this is a dictionary for an entity, otherwise it is a dictionary for a complex object. + + + + Implemented by subclasses to get the dictionary item for a given property name. + Checking that the name is valid should happen before this method is called such + that subclasses do not need to perform the check. + + Name of the property. + An item for the given name. + + + + Creates an object of the underlying type for this dictionary and hydrates it with property + values from this dictionary. + + The properties of this dictionary copied into a new object. + + + + Creates an instance of the underlying type for this dictionary, which may either be an entity type (in which + case CreateObject on the context is used) or a non-entity type (in which case the empty constructor is used.) + In either case, app domain cached compiled delegates are used to do the creation. + + + + + Sets the values of this dictionary by reading values out of the given object. + The given object must be of the type that this dictionary is based on. + + The object to read values from. + + + + Creates a new dictionary containing copies of all the properties in this dictionary. + Changes made to the new dictionary will not be reflected in this dictionary and vice versa. + + A clone of this dictionary. + + + + Sets the values of this dictionary by reading values from another dictionary. + The other dictionary must be based on the same type as this dictionary, or a type derived + from the type for this dictionary. + + The dictionary to read values from. + + + + Gets the dictionary item for the property with the given name. + This method checks that the given name is valid. + + The property name. + The item. + + + + Sets the value of the property only if it is different from the current value and is not + an invalid attempt to set a complex property. + + + + + Gets the set of names of all properties in this dictionary as a read-only set. + + The property names. + + + + Gets or sets the value of the property with the specified property name. + The value may be a nested instance of this class. + + The property name. + The value of the property. + + + + Gets the entity type of complex type that this dictionary is based on. + + The type of the object underlying this dictionary. + + + + Gets the internal context with which the underlying entity or complex type is associated. + + The internal context. + + + + Gets a value indicating whether the object for this dictionary is an entity or a complex object. + + true if this this is a dictionary for an entity; false if it is a dictionary for a complex object. + + + + Initializes a new instance of the class by copying + values from the given dictionary. + + The dictionary to clone. + If non-null, then the values for the new dictionary are taken from this record rather than from the original dictionary. + + + + Gets the dictionary item for a given property name. + + Name of the property. + An item for the given name. + + + + Gets the set of names of all properties in this dictionary as a read-only set. + + The property names. + + + + An implementation of for an item in a . + + + + + Represents an item in an representing a property name/value. + + + + + Gets or sets the value of the property represented by this item. + + The value. + + + + Gets the name of the property. + + The name. + + + + Gets a value indicating whether this item represents a complex property. + + true If this instance represents a complex property; otherwise, false. + + + + Gets the type of the underlying property. + + The property type. + + + + Initializes a new instance of the class. + + The name. + The value. + The type. + If set to true this item represents a complex property. + + + + Gets or sets the value of the property represented by this item. + + The value. + + + + Gets the name of the property. + + The name. + + + + Gets a value indicating whether this item represents a complex property. + + + true If this instance represents a complex property; otherwise, false. + + + + + Gets the type of the underlying property. + + The property type. + + + + An implementation of that is based on an existing + instance. + + + + + Initializes a new instance of the class. + + The internal context. + The type. + The data record. + If set to true this is a dictionary for an entity, otherwise it is a dictionary for a complex object. + + + + Gets the dictionary item for a given property name. + + Name of the property. + An item for the given name. + + + + Gets the set of names of all properties in this dictionary as a read-only set. + + The property names. + + + + An implementation of for an item in a . + + + + + Initializes a new instance of the class. + + The data record. + The ordinal. + The value. + + + + Gets or sets the value of the property represented by this item. + + The value. + + + + Gets the name of the property. + + The name. + + + + Gets a value indicating whether this item represents a complex property. + + + true If this instance represents a complex property; otherwise, false. + + + + + Gets the type of the underlying property. + + The property type. + + + + This is version of an internal interface that already exists in System.Data.Entity that + is implemented by . Using this interface allows state + entries to be mocked for unit testing. The plan is to remove this version of the + interface and use the one in System.Data.Entity once we roll into the framework. + Note that some members may need to be added to the interface in the framework when + we combine the two. + + + + + The internal class used to implement + and . + This internal class contains all the common implementation between the generic and non-generic + entry classes and also allows for a clean internal factoring without compromising the public API. + + + + + Initializes a new instance of the class. + + The internal context. + The state entry. + + + + Initializes a new instance of the class for an + entity which may or may not be attached to the context. + + The internal context. + The entity. + + + + Queries the database for copies of the values of the tracked entity as they currently exist in the database. + + The store values. + + + + Appends a query for the properties in the entity to the given string builder that is being used to + build the eSQL query. This method may be called recursively to query for all the sub-properties of + a complex property. + + The query builder. + The qualifier with which to prefix each property name. + The dictionary that acts as a template for the properties to query. + + + + Validates that a dictionary can be obtained for the state of the entity represented by this entry. + + The method name being used to request a dictionary. + The state that is invalid for the request being processed. + + + + Calls Refresh with StoreWins on the underlying state entry. + + + + + Gets an internal object representing a reference navigation property. + This method is virtual to allow mocking. + + The navigation property. + The type of entity requested, which may be 'object' or null if any type can be accepted. + The entry. + + + + Gets an internal object representing a collection navigation property. + This method is virtual to allow mocking. + + The navigation property. + The type of entity requested, which may be 'object' or null f any type can be accepted. + The entry. + + + + Gets an internal object representing a navigation, scalar, or complex property. + This method is virtual to allow mocking. + + Name of the property. + The type of entity requested, which may be 'object' if any type can be accepted. + The entry. + + + + Gets an internal object representing a scalar or complex property. + This method is virtual to allow mocking. + + The property. + The type of object requested, which may be null or 'object' if any type can be accepted. + if set to true then the found property must be a complex property. + The entry. + + + + Gets an internal object representing a scalar or complex property. + The property may be a nested property on the given . + + The parent property entry, or null if this is a property directly on the entity. + Name of the property. + The type of object requested, which may be null or 'object' if any type can be accepted. + if set to true then the found property must be a complex property. + The entry. + + + + Gets an internal object representing a scalar or complex property. + The property may be a nested property on the given . + + The parent property entry, or null if this is a property directly on the entity. + Name of the property. + The property split out into its parts. + The type of object requested, which may be null or 'object' if any type can be accepted. + if set to true then the found property must be a complex property. + The entry. + + + + Checks that the given property name is a navigation property and is either a reference property or + collection property according to the value of requireCollection. + + + + + Gets metadata for the given property if that property is a navigation property or returns null + if it is not a navigation property. + + Name of the property. + Navigation property metadata or null. + + + + Gets the type of entity or entities at the target end of the given navigation property. + + The navigation property. + The CLR type of the entity or entities at the other end. + + + + Gets the related end for the navigation property with the given name. + + The navigation property. + + + + + Uses EDM metadata to validate that the property name exists in the model and represents a scalar or + complex property or exists in the CLR type. + This method is public and virtual so that it can be mocked. + + The property name. + The type on which the property is declared. + The type of object requested, which may be 'object' if any type can be accepted. + Metadata for the property. + + + + Splits the given property name into parts delimited by dots. + + Name of the property. + The parts of the name. + + + + Validates that this entry is associated with an underlying and + is not just wrapping a non-attached entity. + + + + + Validates entity represented by this entity entry. + This method is virtual to allow mocking. + + User defined dictionary containing additional info for custom validation. This parameter is optional and can be null. + containing validation result. Never null. + + + + Determines whether the specified is equal to this instance. + Two instances are considered equal if they are both entries for + the same entity on the same . + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + Two instances are considered equal if they are both entries for + the same entity on the same . + + 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. + + + + + Gets the tracked entity. + This property is virtual to allow mocking. + + The entity. + + + + Gets or sets the state of the entity. + + The state. + + + + Gets the current property values for the tracked entity represented by this object. + This property is virtual to allow mocking. + + The current values. + + + + Gets the original property values for the tracked entity represented by this object. + The original values are usually the entity's property values as they were when last queried from + the database. + This property is virtual to allow mocking. + + The original values. + + + + Checks whether or not this entry is associated with an underlying or + is just wrapping a non-attached entity. + + + + + Gets the type of the entity being tracked. + + The type of the entity. + + + + Gets the c-space entity type for this entity from the EDM. + + + + + Gets the underlying object state entry. + + + + + Gets the internal context. + + The internal context. + + + + An implementation of that wraps an existing set but makes + it read-only. + + + + + + Initializes a new instance of the class wrapped around + another existing set. + + The existing set. + + + + This is a temporary adapter class that wraps an and + presents it as an . This class will be removed once + we roll into the System.Data.Entity assembly. See + for more details. + + + + + An instance of this internal class is created whenever an instance of the public + class is needed. This allows the public surface to be non-generic, while the runtime type created + still implements . + + The type of the element. + + + + Creates a new query that will be backed by the given internal query object. + + The backing query. + + + + See comments in . + + + + + See comments in . + + + + + Gets the enumeration of this query causing it to be executed against the store. + + An enumerator for the query + + + + Gets the underlying internal query object. + + The internal query. + + + + An instance of this internal class is created whenever an instance of the public + class is needed. This allows the public surface to be non-generic, while the runtime type created + still implements . + + The type of the entity. + + + + Creates a new set that will be backed by the given internal set. + + The internal set. + + + + Creates an instance of this class. This method is used with CreateDelegate to cache a delegate + that can create a generic instance without calling MakeGenericType every time. + + + The internal set to wrap, or null if a new internal set should be created. + The set. + + + + See comments in . + + + + + See comments in . + + + + + See comments in . + + + + + See comments in . + + + + + See comments in . + + + + + Gets the enumeration of this query causing it to be executed against the store. + + An enumerator for the query + + + + Gets the underlying internal query object. + + The internal query. + + + + Gets the underlying internal set. + + The internal set. + + + + See comments in . + + + + + A LINQ expression visitor that finds uses with equivalent + instances. + + + + + Replaces calls to DbContext.Set() with an expression for the equivalent . + + The node to replace. + A new node, which may have had the replacement made. + + + + Replaces a or property with a constant expression + for the underlying . + + The node to replace. + A new node, which may have had the replacement made. + + + + Processes the fields in each constant expression and replaces instances with + the underlying ObjectQuery instance. This handles cases where the query has a closure + containing values. + + + + + Gets a value from the given member, or returns null + if the member doesn't contain a DbContext instance. + + The expression for the object for the member, which may be null for a static member. + The member. + The context or null. + + + + Gets the instance from the given instance or static member, returning null + if the member does not contain a DbContext instance. + + The member. + The value of the object to get the instance from, or null if the member is static. + The context instance or null. + + + + Takes a or and creates an expression + for the underlying . + + + + + Takes a or and extracts the underlying . + + + + + A non-generic interface implemented by that allows operations on + any query object without knowing the type to which it applies. + + + + + An interface implemented by . + + The type of the element. + + + + A non-generic interface implemented by that allows operations on + any set object without knowing the type to which it applies. + + + + + An interface implemented by . + + + + + An InternalQuery underlies every instance of DbSet and DbQuery. It acts to lazily initialize a InternalContext as well + as an ObjectQuery and EntitySet the first time that it is used. The InternalQuery also acts to expose necessary + information to other parts of the design in a controlled manner without adding a lot of internal methods and + properties to the DbSet and DbQuery classes themselves. + + The type of entity to query for. + + + + Creates a new query that will be backed by the given InternalContext. + + The backing context. + + + + Creates a new internal query based on the information in an existing query together with + a new underlying ObjectQuery. + + + + + Resets the query to its uninitialized state so that it will be re-lazy initialized the next + time it is used. This allows the ObjectContext backing a DbContext to be switched out. + + + + + Updates the underlying ObjectQuery with the given include path. + + The include path. + A new query containing the defined include path. + + + + Returns a new query where the entities returned will not be cached in the . + + A new query with NoTracking applied. + + + + Performs lazy initialization of the underlying ObjectContext, ObjectQuery, and EntitySet objects + so that the query can be used. + + + + + Returns a representation of the underlying query, equivalent + to ToTraceString on ObjectQuery. + + + The query string. + + + + + Gets the enumeration of this query causing it to be executed against the store. + + An enumerator for the query + + + + Gets the enumeration of this query causing it to be executed against the store. + + An enumerator for the query + + + + The underlying InternalContext. + + + + + The underlying ObjectQuery. + + + + + The underlying ObjectQuery. + + + + + The LINQ query expression. + + + + + The LINQ query provider for the underlying . + + + + + The IQueryable element type. + + + + + Creates a new query that will be backed by the given InternalContext. + + The backing context. + + + + Resets the set to its uninitialized state so that it will be re-lazy initialized the next + time it is used. This allows the ObjectContext backing a DbContext to be switched out. + + + + + Finds an entity with the given primary key values. + If an entity with the given primary key values exists in the context, then it is + returned immediately without making a request to the store. Otherwise, a request + is made to the store for an entity with the given primary key values and this entity, + if found, is attached to the context and returned. If no entity is found in the + context or the store, then null is returned. + + + The ordering of composite key values is as defined in the EDM, which is in turn as defined in + the designer, by the Code First fluent API, or by the DataMember attribute. + + The values of the primary key for the entity to be found. + The entity found, or null. + Thrown if multiple entities exist in the context with the primary key values given. + Thrown if the type of entity is not part of the data model for this context. + Thrown if the types of the key values do not match the types of the key values for the entity type to be found. + Thrown if the context has been disposed. + + + + Finds an entity in the state manager with the given primary key values, or returns null + if no such entity can be found. This includes looking for Added entities with the given + key values. + + + + + Finds an entity in the store with the given primary key values, or returns null + if no such entity can be found. This code is adapted from TryGetObjectByKey to + include type checking in the query. + + + + + Attaches the given entity to the context underlying the set. That is, the entity is placed + into the context in the Unchanged state, just as if it had been read from the database. + + + Attach is used to repopulate a context with an entity that is known to already exist in the database. + SaveChanges will therefore not attempt to insert an attached entity into the database because + it is assumed to already be there. + Note that entities that are already in the context in some other state will have their state set + to Unchanged. Attach is a no-op if the entity is already in the context in the Unchanged state. + This method is virtual so that it can be mocked. + + The entity to attach. + + + + Adds the given entity to the context underlying the set in the Added state such that it will + be inserted into the database when SaveChanges is called. + + + Note that entities that are already in the context in some other state will have their state set + to Added. Add is a no-op if the entity is already in the context in the Added state. + This method is virtual so that it can be mocked. + + The entity to add. + + + + Marks the given entity as Deleted such that it will be deleted from the database when SaveChanges + is called. Note that the entity must exist in the context in some other state before this method + is called. + + + Note that if the entity exists in the context in the Added state, then this method + will cause it to be detached from the context. This is because an Added entity is assumed not to + exist in the database such that trying to delete it does not make sense. + This method is virtual so that it can be mocked. + + The entity to remove. + + + + This method checks whether an entity is already in the context. If it is, then the state + is changed to the new state given. If it isn't, then the action delegate is executed to + either Add or Attach the entity. + + A delegate to Add or Attach the entity. + The new state to give the entity if it is already in the context. + The entity. + Name of the method. + + + + Creates a new instance of an entity for the type of this set. + Note that this instance is NOT added or attached to the set. + The instance returned will be a proxy if the underlying context is configured to create + proxies and the entity type meets the requirements for creating a proxy. + + The entity instance, which may be a proxy. + + + + Creates a new instance of an entity for the type of this set or for a type derived + from the type of this set. + Note that this instance is NOT added or attached to the set. + The instance returned will be a proxy if the underlying context is configured to create + proxies and the entity type meets the requirements for creating a proxy. + + The type of entity to create. + The entity instance, which may be a proxy. + + + + Performs lazy initialization of the underlying ObjectContext, ObjectQuery, and EntitySet objects + so that the query can be used. + This method is virtual so that it can be mocked. + + + + + Creates an underlying for this set. + + if set to true then the query is set to be no-tracking. + The query. + + + + Returns a representation of the underlying query, equivalent + to ToTraceString on ObjectQuery. + + + The query string. + + + + + Updates the underlying ObjectQuery with the given include path. + + The include path. + A new query containing the defined include path. + + + + Returns a new query where the entities returned will not be cached in the . + + A new query with NoTracking applied. + + + + Executes the given SQL query against the database materializing entities into the entity set that + backs this set. + + The SQL quey. + if true then the entities are not tracked, otherwise they are. + The parameters. + The query results. + + + + Gets the enumeration of this query causing it to be executed against the store. + + An enumerator for the query + + + + Gets the ObservableCollection representing the local view for the set based on this query. + + + + + The underlying ObjectQuery. Accessing this property will trigger lazy initialization of the query. + + + + + The underlying EntitySet name. Accessing this property will trigger lazy initialization of the query. + + + + + The underlying EntitySet name, quoted for ESQL. Accessing this property will trigger lazy initialization of the query. + + + + + The underlying EntitySet. Accessing this property will trigger lazy initialization of the query. + + + + + The base type for the underlying entity set. Accessing this property will trigger lazy initialization of the query. + + + + + The underlying InternalContext. Accessing this property will trigger lazy initialization of the query. + + + + + The LINQ query expression. + + + + + The LINQ query provider for the underlying . + + + + + A wrapping query provider that performs expression transformation and then delegates + to the provider. The objects returned + are always instances of when the generic CreateQuery method is + used and are instances of when the non-generic CreateQuery method + is used. This provider is associated with non-generic objects. + + + + + A wrapping query provider that performs expression transformation and then delegates + to the provider. The objects returned are always instances + of . This provider is associated with generic objects. + + + + + Creates a provider that wraps the given provider. + + The provider to wrap. + + + + Performs expression replacement and then delegates to the wrapped provider before wrapping + the returned as a . + + + + + Performs expression replacement and then delegates to the wrapped provider before wrapping + the returned as a where T is determined + from the element type of the ObjectQuery. + + + + + By default, calls the same method on the wrapped provider. + + + + + By default, calls the same method on the wrapped provider. + + + + + Performs expression replacement and then delegates to the wrapped provider to create an + . + + + + + Wraps the given as a where T is determined + from the element type of the ObjectQuery. + + + + + Gets the internal context. + + The internal context. + + + + Creates a provider that wraps the given provider. + + The provider to wrap. + + + + Performs expression replacement and then delegates to the wrapped provider before wrapping + the returned as a . + + + + + Delegates to the wrapped provider except returns instances of . + + + + + Instances of this class are used internally to create constant expressions for + that are inserted into the expression tree to replace references to + and . + + The type of the element. + + + + Private constructor called by the Create factory method. + + The query. + + + + Factory method called by CreateDelegate to create an instance of this class. + + The query, which must be a generic object of the expected type. + A new instance. + + + + The public property expected in the LINQ expression tree. + + The query. + + + + Validates a property of a given EDM complex type. + + + This is a composite validator for a complex property of an entity. + + + + + Validates a property of a given EDM property type. + + + This is a composite validator for a property of an entity or a complex type. + + + + + Simple validators for the corresponding property. + + + + + Name of the property the validator was created for. + + + + + Creates an instance of for a given EDM property. + + The EDM property name. + Validators used to validate the given property. + + + + Validates a property. + + Validation context. Never null. + Property to validate. Never null. + Validation errors as . Empty if no errors. Never null. + + + + + Simple validators for the corresponding property. + + + + + Gets the name of the property the validator was created for. + + + + + The complex type validator. + + + + + Creates an instance of for a given complex property. + + The complex property name. + Validators used to validate the given property. + Complex type validator. + + + + Validates a complex property. + + Validation context. Never null. + Property to validate. Never null. + Validation errors as . Empty if no errors. Never null. + + + + + Validator used to validate a property of a given EDM ComplexType. + + + This is a composite validator. + + + + + Validator used to validate an entity of a given EDM Type. + + + This is a composite validator for an EDM Type. + + + + + Creates an instance for a given EDM type. + + Property validators. + Type level validators. + + + + Validates an instance. + + Entity validation context. Must not be null. + The entry for the complex property. Null if validating an entity. + instance. Never null. + Protected so it doesn't appear on EntityValidator. + + + + Validates type properties. Any validation errors will be added to + collection. + + + Validation context. Must not be null. + + + Collection of validation errors. Any validation errors will be added to it. + + The entry for the complex property. Null if validating an entity. + + Note that will be modified by this method. Errors should be only added, + never removed or changed. Taking a collection as a modifiable parameter saves a couple of memory allocations + and a merge of validation error lists per entity. + + + + + Returns a validator for a child property. + + Name of the child property for which to return a validator. + + Validator for a child property. Possibly null if there are no validators for requested property. + + + + + Creates an instance for a given EDM complex type. + + Property validators. + Type level validators. + + + + Validates an instance. + + Entity validation context. Must not be null. + The entry for the complex property. Null if validating an entity. + instance. Never null. + + + + Validates type properties. Any validation errors will be added to + collection. + + + Validation context. Must not be null. + + + Collection of validation errors. Any validation errors will be added to it. + + The entry for the complex property. Null if validating an entity. + + Note that will be modified by this method. Errors should be only added, + never removed or changed. Taking a collection as a modifiable parameter saves a couple of memory allocations + and a merge of validation error lists per entity. + + + + + Contains information needed to validate an entity or its properties. + + + + + The entity being validated or the entity that owns the property being validated. + + + + + Initializes a new instance of EntityValidationContext class. + + + The entity being validated or the entity that owns the property being validated. + + + External contexts needed for validation. + + + + + External context needed for validation. + + + + + Gets the entity being validated or the entity that owns the property being validated. + + + + + Validator used to validate an entity of a given EDM EntityType. + + + This is a top level, composite validator. This is also an entry point to getting an entity + validated as validation of an entity is always started by calling Validate method on this type. + + + + + Creates an instance for a given EDM entity type. + + Property validators. + Entity type level validators. + + + + Validates an entity. + + Entity validation context. Must not be null. + instance. Never null. + + + + Validates type properties. Any validation errors will be added to + collection. + + + Validation context. Must not be null. + + + Collection of validation errors. Any validation errors will be added to it. + + The entry for the complex property. Null if validating an entity. + + Note that will be modified by this method. Errors should be only added, + never removed or changed. Taking a collection as a modifiable parameter saves a couple of memory allocations + and a merge of validation error lists per entity. + + + + + Builds validators based on s specified on entity CLR types and properties + as well as based on presence of implementation on entity and complex + type CLR types. It's not sealed and not static for mocking purposes. + + + + + Builds an for the given . + + The entity entry to build the validator for. + Whether the currently processed type is the target type or one of the ancestor types. + + + for the given . Possibly null + if no validation has been specified for this entity type. + + + + + Builds the validator for a given and the corresponding + . + + The CLR type that corresponds to the EDM complex type. + The EDM complex type that type level validation is built for. + A for the given complex type. May be null if no validation specified. + + + + Extracted method from BuildEntityValidator and BuildComplexTypeValidator + + + + + Build validators for the and the corresponding + or . + + Properties to build validators for. + Non-navigation EDM properties. + Navigation EDM properties. + A list of validators. Possibly empty, never null. + + + + Builds a for the given and the corresponding + . If the property is a complex type, type level validators will be built here as + well. + The CLR property to build the validator for. + The EDM property to build the validator for. + + for the given . Possibly null + if no validation has been specified for this property. + + + + + Builds a for the given transient . + + The CLR property to build the validator for. + + for the given . Possibly null + if no validation has been specified for this property. + + + + + Builds s for given that derive from + . + + Attributes used to build validators. + + A list of s built from . + Possibly empty, never null. + + + + + Returns all non-static non-indexed CLR properties from the . + + The CLR to get the properties from. + + A collection of CLR properties. Possibly empty, never null. + + + + + Builds validators based on the facets of : + * If .Nullable facet set to false adds a validator equivalent to the RequiredAttribute + * If the .MaxLength facet is specified adds a validator equivalent to the MaxLengthAttribute. + However the validator isn't added if .IsMaxLength has been set to true. + + The CLR property to build the facet validators for. + The property for which facet validators will be created + A collection of validators. + + + + Contracts for abstract class. + + + + + Validates entities or complex types implementing IValidatableObject interface. + + + + + Display attribute used to specify the display name for an entity or complex property. + + + + + Validates an entity or a complex type implementing IValidatableObject interface. + This method is virtual to allow mocking. + + Validation context. Never null. + + Property to validate. Null if this is the entity that will be validated. Never null if this + is the complex type that will be validated. + + Validation error as . Empty if no errors. Never null. + + + Note that is used to figure out what needs to be validated. If it not null the complex + type will be validated otherwise the entity will be validated. + Also if this is an IValidatableObject complex type but the instance (.CurrentValue) is null we won't validate + anything and will not return any errors. The reason for this is that Validation is supposed to validate using + information the user provided and not some additional implicit rules. (ObjectContext will throw for operations + that involve null complex properties). + + + + + Validates a property, complex property or an entity using validation attributes the property + or the complex/entity type is decorated with. + + + Note that this class is used for validating primitive properties using attributes declared on the property + (property level validation) and complex properties and entities using attributes declared on the type + (type level validation). + + + + + Display attribute used to specify the display name for a property or entity. + + + + + Validation attribute used to validate a property or an entity. + + + + + Creates an instance of class. + + + Validation attribute used to validate a property or an entity. + + + + + Validates a property or an entity. + + Validation context. Never null. + Property to validate. Null for entity validation. Not null for property validation. + + + Validation errors as . Empty if no errors, never null. + + + + + Used to cache and retrieve generated validators and to create context for validating entities or properties. + + + + + Collection of validators keyed by the entity CLR type. Note that if there's no validation for a given type + it will be associated with a null validator. + + + + + Initializes a new instance of class. + + + + + Returns a validator to validate . + + Entity the validator is requested for. + + to validate . Possibly null if no validation + has been specified for the entity. + + + + + Returns a validator to validate . + + Navigation property the validator is requested for. + + Validator to validate . Possibly null if no validation + has been specified for the requested property. + + + + + Gets a validator for the . + + Entity validator. + Property to get a validator for. + + Validator to validate . Possibly null if there is no validation for the + . + + + For complex properties this method walks up the type hierarchy to get to the entity level and then goes down + and gets a validator for the child property that is an ancestor of the property to validate. If a validator + returned for an ancestor is null it means that there is no validation defined beneath and the method just + propagates (and eventually returns) null. + + + + + Creates for . + + Entity entry for which a validation context needs to be created. + User defined dictionary containing additional info for custom validation. This parameter is optional and can be null. + An instance of class. + + + + + Allows configuration to be performed for an complex type in a model. + + A ComplexTypeConfiguration can be obtained via the ComplexType method on + or a custom type derived from ComplexTypeConfiguration + can be registered via the Configurations property on . + + The complex type to be configured. + + + + Allows configuration to be performed for a type in a model. + + The type to be configured. + + + + Configures a property that is defined on this type. + + The type of the property being configured. + + A lambda expression representing the property to be configured. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to configure the property. + + + + Configures a property that is defined on this type. + + The type of the property being configured. + + A lambda expression representing the property to be configured. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to configure the property. + + + + Configures a property that is defined on this type. + + + A lambda expression representing the property to be configured. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to configure the property. + + + + Configures a property that is defined on this type. + + + A lambda expression representing the property to be configured. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to configure the property. + + + + Configures a property that is defined on this type. + + + A lambda expression representing the property to be configured. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to configure the property. + + + + Configures a property that is defined on this type. + + + A lambda expression representing the property to be configured. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to configure the property. + + + + Configures a property that is defined on this type. + + + A lambda expression representing the property to be configured. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to configure the property. + + + + Configures a property that is defined on this type. + + + A lambda expression representing the property to be configured. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to configure the property. + + + + Configures a property that is defined on this type. + + + A lambda expression representing the property to be configured. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to configure the property. + + + + Configures a property that is defined on this type. + + + A lambda expression representing the property to be configured. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to configure the property. + + + + Configures a property that is defined on this type. + + + A lambda expression representing the property to be configured. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to configure the property. + + + + Configures a property that is defined on this type. + + + A lambda expression representing the property to be configured. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to configure the property. + + + + Excludes a property from the model so that it will not be mapped to the database. + + The type of the property to be ignored. + + A lambda expression representing the property to be configured. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + + + + Initializes a new instance of ComplexTypeConfiguration + + + + + Allows the conventions used by a instance to be customized. + Currently removal of one or more default conventions is the only supported operation. + The default conventions can be found in the System.Data.Entity.Conventions namespace. + + + + + Disables a convention for the . + The default conventions that are available for removal can be found in the System.Data.Entity.Conventions namespace. + + The type of the convention to be disabled. + + + + Moves a foreign key constraint from oldTable to newTable and updates column references + + + + + Move any FK constraints that are now completely in newTable and used to refer to oldColumn + + + + + Configures a database column used to store a string values. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Configures the column to allow the maximum length supported by the database provider. + + The same StringColumnConfiguration instance so that multiple calls can be chained. + + + + + Configures the column to be fixed length. + Use HasMaxLength to set the length that the property is fixed to. + + The same StringColumnConfiguration instance so that multiple calls can be chained. + + + + Configures the column to be variable length. + Columns are variable length by default. + + The same StringColumnConfiguration instance so that multiple calls can be chained. + + + + Configures the column to be optional. + + The same StringColumnConfiguration instance so that multiple calls can be chained. + + + + Configures the column to be required. + + The same StringColumnConfiguration instance so that multiple calls can be chained. + + + + Configures the data type of the database column. + + Name of the database provider specific data type. + The same StringColumnConfiguration instance so that multiple calls can be chained. + + + + Configures the order of the database column. + + The order that this column should appear in the database table. + The same StringColumnConfiguration instance so that multiple calls can be chained. + + + + Configures the column to support Unicode string content. + + The same StringColumnConfiguration instance so that multiple calls can be chained. + + + + Configures whether or not the column supports Unicode string content. + + + Value indicating if the column supports Unicode string content or not. + Specifying 'null' will remove the Unicode facet from the column. + Specifying 'null' will cause the same runtime behavior as specifying 'false'. + + The same StringColumnConfiguration instance so that multiple calls can be chained. + + + + Base class for performing configuration of a relationship. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Configures the table and column mapping of a relationship that does not expose foreign key properties in the object model. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Configures the name of the column(s) for the foreign key. + + + The foreign key column names. + When using multiple foreign key properties, the properties must be specified in the same order that the + the primary key properties were configured for the target entity type. + + The same ForeignKeyAssociationMappingConfiguration instance so that multiple calls can be chained. + + + + Configures the table name that the foreign key column(s) reside in. + The table that is specified must already be mapped for the entity type. + + If you want the foreign key(s) to reside in their own table then use the Map method + on to perform + entity splitting to create the table with just the primary key property. Foreign keys can + then be added to the table via this method. + + Name of the table. + The same ForeignKeyAssociationMappingConfiguration instance so that multiple calls can be chained. + + + + Configures the table name and schema that the foreign key column(s) reside in. + The table that is specified must already be mapped for the entity type. + + If you want the foreign key(s) to reside in their own table then use the Map method + on to perform + entity splitting to create the table with just the primary key property. Foreign keys can + then be added to the table via this method. + + Name of the table. + Schema of the table. + The same ForeignKeyAssociationMappingConfiguration instance so that multiple calls can be chained. + + + + Configures the table and column mapping of a many:many relationship. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Configures the join table name for the relationship. + + Name of the table. + The same ManyToManyAssociationMappingConfiguration instance so that multiple calls can be chained. + + + + Configures the join table name and schema for the relationship. + + Name of the table. + Schema of the table. + The same ManyToManyAssociationMappingConfiguration instance so that multiple calls can be chained. + + + + Configures the name of the column(s) for the left foreign key. + The left foreign key represents the navigation property specified in the HasMany call. + + + The foreign key column names. + When using multiple foreign key properties, the properties must be specified in the same order that the + the primary key properties were configured for the target entity type. + + The same ManyToManyAssociationMappingConfiguration instance so that multiple calls can be chained. + + + + Configures the name of the column(s) for the right foreign key. + The right foreign key represents the navigation property specified in the WithMany call. + + + The foreign key column names. + When using multiple foreign key properties, the properties must be specified in the same order that the + the primary key properties were configured for the target entity type. + + The same ManyToManyAssociationMappingConfiguration instance so that multiple calls can be chained. + + + + Configures a relationship that can only support foreign key properties that are not exposed in the object model. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Configures a relationship that can support cascade on delete functionality. + + + + + Configures cascade delete to be on for the relationship. + + + + + Configures whether or not cascade delete is on for the relationship. + + Value indicating if cascade delete is on or not. + + + + Configures the relationship to use foreign key property(s) that are not exposed in the object model. + The column(s) and table can be customized by specifying a configuration action. + If an empty configuration action is specified then column name(s) will be generated by convention. + If foreign key properties are exposed in the object model then use the HasForeignKey method. + Not all relationships support exposing foreign key properties in the object model. + + Action that configures the foreign key column(s) and table. + + A configuration object that can be used to further configure the relationship. + + + + + Used to configure a property of an entity type or complex type. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Used to configure a property with length facets for an entity type or complex type. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Used to configure a primitive property of an entity type or complex type. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Configures the property to be optional. + The database column used to store this property will be nullable. + + The same PrimitivePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be required. + The database column used to store this property will be non-nullable. + + The same PrimitivePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures how values for the property are generated by the database. + + + The pattern used to generate values for the property in the database. + Setting 'null' will remove the database generated pattern facet from the property. + Setting 'null' will cause the same runtime behavior as specifying 'None'. + + The same PrimitivePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be used as an optimistic concurrency token. + + The same PrimitivePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures whether or not the property is to be used as an optimistic concurrency token. + + + Value indicating if the property is a concurrency token or not. + Specifying 'null' will remove the concurrency token facet from the property. + Specifying 'null' will cause the same runtime behavior as specifying 'false'. + + The same PrimitivePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the data type of the database column used to store the property. + + Name of the database provider specific data type. + The same PrimitivePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the name of the database column used to store the property. + + The name of the column. + The same PrimitivePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the order of the database column used to store the property. + This method is also used to specify key ordering when an entity type has a composite key. + + The order that this column should appear in the database table. + The same PrimitivePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to allow the maximum length supported by the database provider. + + The same LengthPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to have the specified maximum length. + + + The maximum length for the property. + Setting 'null' will remove any maximum length restriction from the property and a default length will be used for the database column. + + The same LengthPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be fixed length. + Use HasMaxLength to set the length that the property is fixed to. + + The same LengthPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be variable length. + Properties are variable length by default. + + The same LengthPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to allow the maximum length supported by the database provider. + + The same BinaryPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to have the specified maximum length. + + + The maximum length for the property. + Setting 'null' will remove any maximum length restriction from the property. + + The same BinaryPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be fixed length. + Use HasMaxLength to set the length that the property is fixed to. + + The same BinaryPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be variable length. + properties are variable length by default. + + The same BinaryPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be optional. + The database column used to store this property will be nullable. + properties are optional by default. + + The same BinaryPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be required. + The database column used to store this property will be non-nullable. + + The same BinaryPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures how values for the property are generated by the database. + + + The pattern used to generate values for the property in the database. + Setting 'null' will remove the database generated pattern facet from the property. + Setting 'null' will cause the same runtime behavior as specifying 'None'. + + The same BinaryPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be used as an optimistic concurrency token. + + The same BinaryPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures whether or not the property is to be used as an optimistic concurrency token. + + + Value indicating if the property is a concurrency token or not. + Specifying 'null' will remove the concurrency token facet from the property. + Specifying 'null' will cause the same runtime behavior as specifying 'false'. + + The same BinaryPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the name of the database column used to store the property. + + The name of the column. + The same BinaryPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the data type of the database column used to store the property. + + Name of the database provider specific data type. + The same BinaryPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the order of the database column used to store the property. + This method is also used to specify key ordering when an entity type has a composite key. + + The order that this column should appear in the database table. + The same BinaryPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be a row version in the database. + The actual data type will vary depending on the database provider being used. + Setting the property to be a row version will automatically configure it to be an + optimistic concurrency token. + + The same BinaryPropertyConfiguration instance so that multiple calls can be chained. + + + + Used to configure a property of an entity type or complex type. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Configures the property to be optional. + The database column used to store this property will be nullable. + + The same DateTimePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be required. + The database column used to store this property will be non-nullable. + properties are required by default. + + The same DateTimePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures how values for the property are generated by the database. + + + The pattern used to generate values for the property in the database. + Setting 'null' will remove the database generated pattern facet from the property. + Setting 'null' will cause the same runtime behavior as specifying 'None'. + + The same DateTimePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be used as an optimistic concurrency token. + + The same DateTimePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures whether or not the property is to be used as an optimistic concurrency token. + + + Value indicating if the property is a concurrency token or not. + Specifying 'null' will remove the concurrency token facet from the property. + Specifying 'null' will cause the same runtime behavior as specifying 'false'. + + The same DateTimePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the name of the database column used to store the property. + + The name of the column. + The same DateTimePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the data type of the database column used to store the property. + + Name of the database provider specific data type. + The same DateTimePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the order of the database column used to store the property. + This method is also used to specify key ordering when an entity type has a composite key. + + The order that this column should appear in the database table. + The same DateTimePropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the precision of the property. + If the database provider does not support precision for the data type of the column then the value is ignored. + + Precision of the property. + The same DateTimePropertyConfiguration instance so that multiple calls can be chained. + + + + Used to configure a property of an entity type or complex type. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Configures the property to be optional. + The database column used to store this property will be nullable. + + The same DecimalPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be required. + The database column used to store this property will be non-nullable. + properties are required by default. + + The same DecimalPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures how values for the property are generated by the database. + + + The pattern used to generate values for the property in the database. + Setting 'null' will remove the database generated pattern facet from the property. + Setting 'null' will cause the same runtime behavior as specifying 'None'. + + The same DecimalPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be used as an optimistic concurrency token. + + The same DecimalPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures whether or not the property is to be used as an optimistic concurrency token. + + + Value indicating if the property is a concurrency token or not. + Specifying 'null' will remove the concurrency token facet from the property. + Specifying 'null' will cause the same runtime behavior as specifying 'false'. + + The same DecimalPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the name of the database column used to store the property. + + The name of the column. + The same DecimalPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the data type of the database column used to store the property. + + Name of the database provider specific data type. + The same DecimalPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the order of the database column used to store the property. + This method is also used to specify key ordering when an entity type has a composite key. + + The order that this column should appear in the database table. + The same DecimalPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the precision and scale of the property. + + The precision of the property. + The scale of the property. + The same DecimalPropertyConfiguration instance so that multiple calls can be chained. + + + + Used to configure a property of an entity type or complex type. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Configures the property to allow the maximum length supported by the database provider. + + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to have the specified maximum length. + + + The maximum length for the property. + Setting 'null' will remove any maximum length restriction from the property and a default length will be used for the database column.. + + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be fixed length. + Use HasMaxLength to set the length that the property is fixed to. + + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be variable length. + properties are variable length by default. + + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be optional. + The database column used to store this property will be nullable. + properties are optional by default. + + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be required. + The database column used to store this property will be non-nullable. + + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures how values for the property are generated by the database. + + + The pattern used to generate values for the property in the database. + Setting 'null' will remove the database generated pattern facet from the property. + Setting 'null' will cause the same runtime behavior as specifying 'None'. + + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to be used as an optimistic concurrency token. + + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures whether or not the property is to be used as an optimistic concurrency token. + + + Value indicating if the property is a concurrency token or not. + Specifying 'null' will remove the concurrency token facet from the property. + Specifying 'null' will cause the same runtime behavior as specifying 'false'. + + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the name of the database column used to store the property. + + The name of the column. + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the data type of the database column used to store the property. + + Name of the database provider specific data type. + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the order of the database column used to store the property. + This method is also used to specify key ordering when an entity type has a composite key. + + The order that this column should appear in the database table. + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures the property to support Unicode string content. + + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Configures whether or not the property supports Unicode string content. + + + Value indicating if the property supports Unicode string content or not. + Specifying 'null' will remove the Unicode facet from the property. + Specifying 'null' will cause the same runtime behavior as specifying 'false'. + + The same StringPropertyConfiguration instance so that multiple calls can be chained. + + + + Convention to process instances of found on foreign key properties in the model. + + + + + Base class for conventions that process CLR attributes found in the model. + + The type of member to look for. + The type of the configuration to look for. + The type of the attribute to look for. + + + + Convention to process instances of found on properties in the model. + + + + + Convention to add a cascade delete to the join table from both tables involved in a many to many relationship. + + + + + Convention to ensure an invalid/unsupported mapping is not created when mapping inherited properties + + + + + Convention to set precision to 18 and scale to 2 for decimal properties. + + + + + Configures a relationship that can support foreign key properties that are exposed in the object model. + This configuration functionality is available via the Code First Fluent API, see . + + The dependent entity type. + + + + Configures the relationship to use foreign key property(s) that are exposed in the object model. + If the foreign key property(s) are not exposed in the object model then use the Map method. + + The type of the key. + + A lambda expression representing the property to be used as the foreign key. + If the foreign key is made up of multiple properties then specify an anonymous type including the properties. + When using multiple foreign key properties, the properties must be specified in the same order that the + the primary key properties were configured for the principal entity type. + + A configuration object that can be used to further configure the relationship. + + + + Configures a many:many relationship. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Configures the foreign key column(s) and table used to store the relationship. + + Action that configures the foreign key column(s) and table. + + + + Configures the table and column mapping for an entity type or a sub-set of properties from an entity type. + This configuration functionality is available via the Code First Fluent API, see . + + The entity type to be mapped. + + + + Configures the properties that will be included in this mapping fragment. + If this method is not called then all properties that have not yet been + included in a mapping fragment will be configured. + + An anonymous type including the properties to be mapped. + + A lambda expression to an anonymous type that contains the properties to be mapped. + C#: t => new { t.Id, t.Property1, t.Property2 } + VB.Net: Function(t) New From { p.Id, t.Property1, t.Property2 } + + + + + Re-maps all properties inherited from base types. + + When configuring a derived type to be mapped to a separate table this will cause all properties to + be included in the table rather than just the non-inherited properties. This is known as + Table per Concrete Type (TPC) mapping. + + + + + Configures the table name to be mapped to. + + Name of the table. + + + + Configures the table name and schema to be mapped to. + + Name of the table. + Schema of the table. + + + + Configures the discriminator column used to differentiate between types in an inheritance hierarchy. + + The name of the discriminator column. + A configuration object to further configure the discriminator column and values. + + + + Configures the discriminator condition used to differentiate between types in an inheritance hierarchy. + + The type of the property being used to discriminate between types. + + A lambda expression representing the property being used to discriminate between types. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object to further configure the discriminator condition. + + + + Configures a condition used to discriminate between types in an inheritance hierarchy based on the values assigned to a property. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Configures the condition to require a value in the property. + + Rows that do not have a value assigned to column that this property is stored in are + assumed to be of the base type of this entity type. + + + + + Configures a discriminator column used to differentiate between types in an inheritance hierarchy. + This configuration functionality is available via the Code First Fluent API, see . + + + + + Configures the discriminator value used to identify the entity type being + configured from other types in the inheritance hierarchy. + + Type of the discriminator value. + The value to be used to identify the entity type. + A configuration object to configure the column used to store discriminator values. + + + + Configures the discriminator value used to identify the entity type being + configured from other types in the inheritance hierarchy. + + Type of the discriminator value. + The value to be used to identify the entity type. + A configuration object to configure the column used to store discriminator values. + + + + Configures the discriminator value used to identify the entity type being + configured from other types in the inheritance hierarchy. + + The value to be used to identify the entity type. + A configuration object to configure the column used to store discriminator values. + + + + Allows derived configuration classes for entities and complex types to be registered with a . + + + Derived configuration classes are created by deriving from + or and using a type to be included in the model as the generic + parameter. + + Configuration can be performed without creating derived configuration classes via the Entity and ComplexType + methods on . + + + + + Adds an to the . + Only one can be added for each type in a model. + + The entity type being configured. + The entity type configuration to be added. + The same ConfigurationRegistrar instance so that multiple calls can be chained. + + + + Adds an to the . + Only one can be added for each type in a model. + + The complex type being configured. + The complex type configuration to be added + The same ConfigurationRegistrar instance so that multiple calls can be chained. + + + + True if this configuration can be replaced in the model configuration, false otherwise + This is only set to true for configurations that are registered automatically via the DbContext + + + + + Configures a many relationship from an entity type. + + The entity type that the relationship originates from. + The entity type that the relationship targets. + + + + Configures the relationship to be many:many with a navigation property on the other side of the relationship. + + + An lambda expression representing the navigation property on the other end of the relationship. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be many:many without a navigation property on the other side of the relationship. + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be many:required with a navigation property on the other side of the relationship. + + + An lambda expression representing the navigation property on the other end of the relationship. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be many:required without a navigation property on the other side of the relationship. + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be many:optional with a navigation property on the other side of the relationship. + + + An lambda expression representing the navigation property on the other end of the relationship. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be many:optional without a navigation property on the other side of the relationship. + + A configuration object that can be used to further configure the relationship. + + + + Initializes configurations in the ModelConfiguration so that configuration data + is in a single place + + + + + Configures an optional relationship from an entity type. + + The entity type that the relationship originates from. + The entity type that the relationship targets. + + + + Configures the relationship to be optional:many with a navigation property on the other side of the relationship. + + + An lambda expression representing the navigation property on the other end of the relationship. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be optional:many without a navigation property on the other side of the relationship. + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be optional:required with a navigation property on the other side of the relationship. + + + An lambda expression representing the navigation property on the other end of the relationship. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be optional:required without a navigation property on the other side of the relationship. + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be optional:optional with a navigation property on the other side of the relationship. + The entity type being configured will be the dependent and contain a foreign key to the principal. + The entity type that the relationship targets will be the principal in the relationship. + + + An lambda expression representing the navigation property on the other end of the relationship. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be optional:optional without a navigation property on the other side of the relationship. + The entity type being configured will be the dependent and contain a foreign key to the principal. + The entity type that the relationship targets will be the principal in the relationship. + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be optional:optional with a navigation property on the other side of the relationship. + The entity type being configured will be the principal in the relationship. + The entity type that the relationship targets will be the dependent and contain a foreign key to the principal. + + + A lambda expression representing the navigation property on the other end of the relationship. + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be optional:optional without a navigation property on the other side of the relationship. + The entity type being configured will be the principal in the relationship. + The entity type that the relationship targets will be the dependent and contain a foreign key to the principal. + + A configuration object that can be used to further configure the relationship. + + + + Convention to process instances of found on properties in the model + + + + + Convention to process instances of found on properties in the model. + + + + + Convention to process instances of found on navigation properties in the model. + + + + + Convention to process instances of found on properties in the model. + + + + + Convention to process instances of found on properties in the model. + + + + + Convention to process instances of found on primitive properties in the model. + + + + + Convention to process instances of found on properties in the model. + + + + + Convention to process instances of found on properties in the model. + + + + + Convention to process instances of found on types in the model. + + + + + Convention to process instances of found on types in the model. + + + + + Convention to process instances of found on properties in the model. + + + + + Convention to process instances of found on types in the model. + + + + + Convention to process instances of found on properties in the model. + + + + + Convention to move primary key properties to appear first. + + + + + Convention to apply column ordering specified via or the API. + + + + + Convention to convert any data types that were explicitly specified, via data annotations or API, + to be lower case. The default SqlClient provider is case sensitive and requires data types to be lower case. This convention + allows the and API to be case insensitive. + + + + + Convention to set a default maximum length of 128 for properties whose type supports length facets. + + + + + Convention to set the entity set name to be a pluralized version of the entity type name. + + + + + This class provide service for both the singularization and pluralization, it takes the word pairs + in the ctor following the rules that the first one is singular and the second one is plural. + + + + + Factory method for PluralizationService. Only support english pluralization. + Please set the PluralizationService on the System.Data.Entity.Design.EntityModelSchemaGenerator + to extend the service to other locales. + + CultureInfo + PluralizationService + + + + captalize the return word if the parameter is capitalized + if word is "Table", then return "Tables" + + + + + + + + separate one combine word in to two parts, prefix word and the last word(suffix word) + + + + + + + + return true when the word is "[\s]*" or leading or tailing with spaces + or contains non alphabetical characters + + + + + + + This method allow you to add word to internal PluralizationService of English. + If the singluar or the plural value was already added by this method, then an ArgumentException will be thrown. + + + + + + + Convention to set the table name to be a pluralized version of the entity type name. + + + + + Convention to configure the primary key(s) of the dependent entity type as foreign key(s) in a one:one relationship. + + + + + Convention to distinguish between optional and required relationships based on CLR nullability of the foreign key property. + + + + + Convention to detect primary key properties. + Recognized naming patterns in order of precedence are: + 1. 'Id' + 2. [type name]Id + Primary key detection is case insensitive. + + + + + Handles mapping from a CLR property to an EDM assocation and nav. prop. + + + + + True if the NavigationProperty's declaring type is the principal end, false if it is not, null if it is not known + + + + + Exception thrown by during model creation when an invalid model is generated. + + + + + Initializes a new instance of ModelValidationException + + + + + Initializes a new instance of ModelValidationException + + The exception message. + + + + Initializes a new instance of ModelValidationException + + The exception message. + The inner exception. + + + + Convention to detect navigation properties to be inverses of each other when only one pair + of navigation properties exists between the related types. + + + + + Convention to configure a type as a complex type if it has no primary key, no mapped base type and no navigation properties. + + + + + Convention to discover foreign key properties whose names are a combination + of the dependent navigation property name and the principal type primary key property name(s). + + + + + Allows configuration to be performed for an entity type in a model. + + An EntityTypeConfiguration can be obtained via the Entity method on + or a custom type derived from EntityTypeConfiguration + can be registered via the Configurations property on . + + + + + Initializes a new instance of EntityTypeConfiguration + + + + + Configures the primary key property(s) for this entity type. + + The type of the key. + + A lambda expression representing the property to be used as the primary key. + C#: t => t.Id + VB.Net: Function(t) t.Id + + If the primary key is made up of multiple properties then specify an anonymous type including the properties. + C#: t => new { t.Id1, t.Id2 } + VB.Net: Function(t) New From { t.Id1, t.Id2 } + + The same EntityTypeConfiguration instance so that multiple calls can be chained. + + + + Configures the entity set name to be used for this entity type. + The entity set name can only be configured for the base type in each set. + + The name of the entity set. + The same EntityTypeConfiguration instance so that multiple calls can be chained. + + + + Configures the table name that this entity type is mapped to. + + The name of the table. + + + + Configures the table name that this entity type is mapped to. + + The name of the table. + The database schema of the table. + + + + Allows advanced configuration related to how this entity type is mapped to the database schema. + By default, any configuration will also apply to any type derived from this entity type. + + Derived types can be configured via the overload of Map that configures a derived type or + by using an EntityTypeConfiguration for the derived type. + + The properties of an entity can be split between multiple tables using multiple Map calls. + + Calls to Map are additive, subsequent calls will not override configuration already preformed via Map. + + An action that performs configuration against an . + The same EntityTypeConfiguration instance so that multiple calls can be chained. + + + + Allows advanced configuration related to how a derived entity type is mapped to the database schema. + Calls to Map are additive, subsequent calls will not override configuration already preformed via Map. + + The derived entity type to be configured. + An action that performs configuration against an . + The same EntityTypeConfiguration instance so that multiple calls can be chained. + + + + Configures an optional relationship from this entity type. + Instances of the entity type will be able to be saved to the database without this relationship being specified. + The foreign key in the database will be nullable. + + The type of the entity at the other end of the relationship. + + A lambda expression representing the navigation property for the relationship. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to further configure the relationship. + + + + Configures a required relationship from this entity type. + Instances of the entity type will not be able to be saved to the database unless this relationship is specified. + The foreign key in the database will be non-nullable. + + The type of the entity at the other end of the relationship. + + A lambda expression representing the navigation property for the relationship. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to further configure the relationship. + + + + Configures a many relationship from this entity type. + + The type of the entity at the other end of the relationship. + + A lambda expression representing the navigation property for the relationship. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to further configure the relationship. + + + + DbModelBuilder is used to map CLR classes to a database schema. + This code centric approach to building an Entity Data Model (EDM) model is known as 'Code First'. + + + DbModelBuilder is typically used to configure a model by overriding . + You can also use DbModelBuilder independently of DbContext to build a model and then construct a + or . + The recommended approach, however, is to use OnModelCreating in as + the workflow is more intuitive and takes care of common tasks, such as caching the created model. + + Types that form your model are registered with DbModelBuilder and optional configuration can be + performed by applying data annotations to your classes and/or using the fluent style DbModelBuilder + API. + + When the Build method is called a set of conventions are run to discover the initial model. + These conventions will automatically discover aspects of the model, such as primary keys, and + will also process any data annotations that were specified on your classes. Finally + any configuration that was performed using the DbModelBuilder API is applied. + + Configuration done via the DbModelBuilder API takes precedence over data annotations which + in turn take precedence over the default conventions. + + + + + Initializes a new instance of the class. + + The process of discovering the initial model will use the set of conventions included + in the most recent version of the Entity Framework installed on your machine. + + + Upgrading to newer versions of the Entity Framework may cause breaking changes + in your application because new conventions may cause the initial model to be + configured differently. There is an alternate constructor that allows a specific + version of conventions to be specified. + + + + + Initializes a new instance of the class that will use + a specific set of conventions to discover the initial model. + + The version of conventions to be used. + + + + Excludes a type from the model. This is used to remove types from the model that were added + by convention during initial model discovery. + + The type to be excluded. + The same DbModelBuilder instance so that multiple calls can be chained. + + + + Excludes a type(s) from the model. This is used to remove types from the model that were added + by convention during initial model discovery. + + The types to be excluded from the model. + The same DbModelBuilder instance so that multiple calls can be chained. + + + + Registers an entity type as part of the model and returns an object that can be used to + configure the entity. This method can be called multiple times for the same entity to + perform multiple lines of configuration. + + The type to be registered or configured. + The configuration object for the specified entity type. + + + + Registers a type as an entity in the model and returns an object that can be used to + configure the entity. This method can be called multiple times for the same type to + perform multiple lines of configuration. + + The type to be registered or configured. + The configuration object for the specified entity type. + + + + Registers a type as a complex type in the model and returns an object that can be used to + configure the complex type. This method can be called multiple times for the same type to + perform multiple lines of configuration. + + The type to be registered or configured. + The configuration object for the specified complex type. + + + + Creates a based on the configuration performed using this builder. + The connection is used to determine the database provider being used as this + affects the database layer of the generated model. + + Connection to use to determine provider information. + The model that was built. + + + + Creates a based on the configuration performed using this builder. + Provider information must be specified because this affects the database layer of the generated model. + For SqlClient the invariant name is 'System.Data.SqlClient' and the manifest token is the version year (i.e. '2005', '2008' etc.) + + The database provider that the model will be used with. + The model that was built. + + + + Provides access to the settings of this DbModelBuilder that deal with conventions. + + + + + Gets the for this DbModelBuilder. + The registrar allows derived entity and complex type configurations to be registered with this builder. + + + + + Convention to enable cascade delete for any required relationships. + + + + + Convention to discover foreign key properties whose names match the principal type primary key property name(s). + + + + + Convention to configure integer primary keys to be identity. + + + + + Convention to discover foreign key properties whose names are a combination + of the principal type name and the principal type primary key property name(s). + + + + + Attempt to determine the principal and dependent ends of this association. + + The following table illustrates the solution space. + + Source | Target || Prin | Dep | + -------|--------||-------|-------| + 1 | 1 || - | - | + 1 | 0..1 || Sr | Ta | + 1 | * || Sr | Ta | + 0..1 | 1 || Ta | Sr | + 0..1 | 0..1 || - | - | + 0..1 | * || Sr | Ta | + * | 1 || Ta | Sr | + * | 0..1 || Ta | Sr | + * | * || - | - | + + + + + Configures an required relationship from an entity type. + + The entity type that the relationship originates from. + The entity type that the relationship targets. + + + + Configures the relationship to be required:many with a navigation property on the other side of the relationship. + + + An lambda expression representing the navigation property on the other end of the relationship. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be required:many without a navigation property on the other side of the relationship. + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be required:optional with a navigation property on the other side of the relationship. + + + An lambda expression representing the navigation property on the other end of the relationship. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be required:optional without a navigation property on the other side of the relationship. + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be required:required with a navigation property on the other side of the relationship. + The entity type being configured will be the dependent and contain a foreign key to the principal. + The entity type that the relationship targets will be the principal in the relationship. + + + An lambda expression representing the navigation property on the other end of the relationship. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be required:required without a navigation property on the other side of the relationship. + The entity type being configured will be the dependent and contain a foreign key to the principal. + The entity type that the relationship targets will be the principal in the relationship. + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be required:required with a navigation property on the other side of the relationship. + The entity type being configured will be the principal in the relationship. + The entity type that the relationship targets will be the dependent and contain a foreign key to the principal. + + + An lambda expression representing the navigation property on the other end of the relationship. + C#: t => t.MyProperty + VB.Net: Function(t) t.MyProperty + + A configuration object that can be used to further configure the relationship. + + + + Configures the relationship to be required:required without a navigation property on the other side of the relationship. + The entity type being configured will be the principal in the relationship. + The entity type that the relationship targets will be the dependent and contain a foreign key to the principal. + + A configuration object that can be used to further configure the relationship. + + + + Code Contracts hook methods - Called when contracts fail. Here we detect the most common preconditions + so we can throw the correct exceptions. It also means that we can write preconditions using the + simplest Contract.Requires() form. + + + + + Returns true if a variable of this type can be assigned a null value + + + + True if a reference type or a nullable value type, + false otherwise + + + + + Exception thrown from when validating entities fails. + + + + + Initializes a new instance of DbEntityValidationException + + + + + Initializes a new instance of DbEntityValidationException + + The exception message. + + + + Initializes a new instance of DbEntityValidationException + + The exception message. + Validation results. + + + + Initializes a new instance of DbEntityValidationException + + The exception message. + The inner exception. + + + + Initializes a new instance of DbEntityValidationException + + The exception message. + Validation results. + The inner exception. + + + + Subscribes the SerializeObjectState event. + + + + + Validation results. + + + + + Holds exception state that will be serialized when the exception is serialized. + + + + + Validation results. + + + + + Completes the deserialization. + + The deserialized object. + + + + Validation results. + + + + + Represents validation results for single entity. + + + + + Entity entry the results applies to. Never null. + + + + + List of instances. Never null. Can be empty meaning the entity is valid. + + + + + Creates an instance of class. + + + Entity entry the results applies to. Never null. + + + List of instances. Never null. Can be empty meaning the entity is valid. + + + + + Creates an instance of class. + + + Entity entry the results applies to. Never null. + + + List of instances. Never null. Can be empty meaning the entity is valid. + + + + + Gets an instance of the results applies to. + + + + + Gets validation errors. Never null. + + + + + Gets an indicator if the entity is valid. + + + + + Validation error. Can be either entity or property level validation error. + + + + + Name of the invalid property. Can be null (e.g. for entity level validations) + + + + + Validation error message. + + + + + Creates an instance of . + + Name of the invalid property. Can be null. + Validation error message. Can be null. + + + + Gets name of the invalid property. + + + + + Gets validation error message. + + + + + Denotes a property used as a foreign key in a relationship. + The annotation may be placed on the foreign key property and specify the associated navigation property name, + or placed on a navigation property and specify the associated foreign key name. + + + + + Initializes a new instance of the class. + + + If placed on a foreign key property, the name of the associated navigation property. + If placed on a navigation property, the name of the associated foreign key(s). + If a navigation property has multiple foreign keys, a comma separated list should be supplied. + + + + + If placed on a foreign key property, the name of the associated navigation property. + If placed on a navigation property, the name of the associated foreign key(s). + + + + + Specifies the inverse of a navigation property that represents the other end of the same relationship. + + + + + Initializes a new instance of the class. + + The navigation property representing the other end of the same relationship. + + + + The navigation property representing the other end of the same relationship. + + + + + Specifies the database column that a property is mapped to. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The name of the column the property is mapped to. + + + + The name of the column the property is mapped to. + + + + + The zero-based order of the column the property is mapped to. + + + + + The database provider specific data type of the column the property is mapped to. + + + + + Specifies the maximum length of array/string data allowed in a property. + + + + + Initializes a new instance of the class. + + + The maximum allowable length of array/string data. + Value must be greater than zero. + + + + + Initializes a new instance of the class. + The maximum allowable length supported by the database will be used. + + + + + Determines whether a specified object is valid. (Overrides ) + + + This method returns true if the is null. + It is assumed the is used if the value may not be null. + + The object to validate. + true if the value is null or less than or equal to the specified maximum length, otherwise false + Length is zero or less than negative one. + + + + Applies formatting to a specified error message. (Overrides ) + + The name to include in the formatted string. + A localized string to describe the maximum acceptable length. + + + + Checks that Length has a legal value. Throws InvalidOperationException if not. + + + + + Gets the maximum allowable length of the array/string data. + + + + + Specifies the minimum length of array/string data allowed in a property. + + + + + Initializes a new instance of the class. + + + The minimum allowable length of array/string data. + Value must be greater than or equal to zero. + + + + + Determines whether a specified object is valid. (Overrides ) + + + This method returns true if the is null. + It is assumed the is used if the value may not be null. + + The object to validate. + true if the value is null or greater than or equal to the specified minimum length, otherwise false + Length is less than zero. + + + + Applies formatting to a specified error message. (Overrides ) + + The name to include in the formatted string. + A localized string to describe the minimum acceptable length. + + + + Checks that Length has a legal value. Throws InvalidOperationException if not. + + + + + Gets the minimum allowable length of the array/string data. + + + + + Specifies how the database generates values for a property. + + + + + Initializes a new instance of the class. + + The pattern used to generate values for the property in the database. + + + + The pattern used to generate values for the property in the database. + + + + + The pattern used to generate values for a property in the database. + + + + + The database does not generate values. + + + + + The database generates a value when a row is inserted. + + + + + The database generates a value when a row is inserted or updated. + + + + + Denotes that a property or class should be excluded from database mapping. + + + + + Denotes that the class is a complex type. + Complex types are non-scalar properties of entity types that enable scalar properties to be organized within entities. + Complex types do not have keys and cannot be managed by the Entity Framework apart from the parent object. + + + + + Specifies the database table that a class is mapped to. + + + + + Initializes a new instance of the class. + + The name of the table the class is mapped to. + + + + The name of the table the class is mapped to. + + + + + The schema of the table the class is mapped to. + + + + + Constructs a new sys description. + + + description text. + + + + + Retrieves the description text. + + + description + + + + + AutoGenerated resource class. Usage: + + string s = ResourceProvider.GetString(ResourceProvider.MyIdenfitier); + + + + + Constructs a new sys description. + + + description text. + + + + + Retrieves the description text. + + + description + + + + + AutoGenerated resource class. Usage: + + string s = ResourceProvider.GetString(ResourceProvider.MyIdenfitier); + + + + + Constructs a new sys description. + + + description text. + + + + + Retrieves the description text. + + + description + + + + + AutoGenerated resource class. Usage: + + string s = ResourceProvider.GetString(ResourceProvider.MyIdenfitier); + + + + + Constructs a new sys description. + + + description text. + + + + + Retrieves the description text. + + + description + + + + + AutoGenerated resource class. Usage: + + string s = EntityRes.GetString(EntityRes.MyIdenfitier); + + + + diff --git a/packages/Modernizr.1.7/Content/Scripts/modernizr-1.7.js b/packages/Modernizr.1.7/Content/Scripts/modernizr-1.7.js new file mode 100644 index 0000000..7bc212a --- /dev/null +++ b/packages/Modernizr.1.7/Content/Scripts/modernizr-1.7.js @@ -0,0 +1,969 @@ +/*! +* Note: While Microsoft is not the author of this file, Microsoft is +* offering you a license subject to the terms of the Microsoft Software +* License Terms for Microsoft ASP.NET Model View Controller 3. +* Microsoft reserves all other rights. The notices below are provided +* for informational purposes only and are not the license terms under +* which Microsoft distributed this file. +* +* Modernizr v1.7 +* http://www.modernizr.com +* +* Developed by: +* - Faruk Ates http://farukat.es/ +* - Paul Irish http://paulirish.com/ +* +* Copyright (c) 2009-2011 +*/ + + +/* + * Modernizr is a script that detects native CSS3 and HTML5 features + * available in the current UA and provides an object containing all + * features with a true/false value, depending on whether the UA has + * native support for it or not. + * + * Modernizr will also add classes to the element of the page, + * one for each feature it detects. If the UA supports it, a class + * like "cssgradients" will be added. If not, the class name will be + * "no-cssgradients". This allows for simple if-conditionals in your + * CSS, giving you fine control over the look & feel of your website. + * + * @author Faruk Ates + * @author Paul Irish + * @copyright (c) 2009-2011 Faruk Ates. + * @contributor Ben Alman + */ + +window.Modernizr = (function(window,document,undefined){ + + var version = '1.7', + + ret = {}, + + /** + * !! DEPRECATED !! + * + * enableHTML5 is a private property for advanced use only. If enabled, + * it will make Modernizr.init() run through a brief while() loop in + * which it will create all HTML5 elements in the DOM to allow for + * styling them in Internet Explorer, which does not recognize any + * non-HTML4 elements unless created in the DOM this way. + * + * enableHTML5 is ON by default. + * + * The enableHTML5 toggle option is DEPRECATED as per 1.6, and will be + * replaced in 2.0 in lieu of the modular, configurable nature of 2.0. + */ + enableHTML5 = true, + + + docElement = document.documentElement, + docHead = document.head || document.getElementsByTagName('head')[0], + + /** + * Create our "modernizr" element that we do most feature tests on. + */ + mod = 'modernizr', + modElem = document.createElement( mod ), + m_style = modElem.style, + + /** + * Create the input element for various Web Forms feature tests. + */ + inputElem = document.createElement( 'input' ), + + smile = ':)', + + tostring = Object.prototype.toString, + + // List of property values to set for css tests. See ticket #21 + prefixes = ' -webkit- -moz- -o- -ms- -khtml- '.split(' '), + + // Following spec is to expose vendor-specific style properties as: + // elem.style.WebkitBorderRadius + // and the following would be incorrect: + // elem.style.webkitBorderRadius + + // Webkit ghosts their properties in lowercase but Opera & Moz do not. + // Microsoft foregoes prefixes entirely <= IE8, but appears to + // use a lowercase `ms` instead of the correct `Ms` in IE9 + + // More here: http://github.com/Modernizr/Modernizr/issues/issue/21 + domPrefixes = 'Webkit Moz O ms Khtml'.split(' '), + + ns = {'svg': 'http://www.w3.org/2000/svg'}, + + tests = {}, + inputs = {}, + attrs = {}, + + classes = [], + + featurename, // used in testing loop + + + + // todo: consider using http://javascript.nwbox.com/CSSSupport/css-support.js instead + testMediaQuery = function(mq){ + + var st = document.createElement('style'), + div = document.createElement('div'), + ret; + + st.textContent = mq + '{#modernizr{height:3px}}'; + docHead.appendChild(st); + div.id = 'modernizr'; + docElement.appendChild(div); + + ret = div.offsetHeight === 3; + + st.parentNode.removeChild(st); + div.parentNode.removeChild(div); + + return !!ret; + + }, + + + /** + * isEventSupported determines if a given element supports the given event + * function from http://yura.thinkweb2.com/isEventSupported/ + */ + isEventSupported = (function(){ + + var TAGNAMES = { + 'select':'input','change':'input', + 'submit':'form','reset':'form', + 'error':'img','load':'img','abort':'img' + }; + + function isEventSupported(eventName, element) { + + element = element || document.createElement(TAGNAMES[eventName] || 'div'); + eventName = 'on' + eventName; + + // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those + var isSupported = (eventName in element); + + if (!isSupported) { + // If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element + if (!element.setAttribute) { + element = document.createElement('div'); + } + if (element.setAttribute && element.removeAttribute) { + element.setAttribute(eventName, ''); + isSupported = is(element[eventName], 'function'); + + // If property was created, "remove it" (by setting value to `undefined`) + if (!is(element[eventName], undefined)) { + element[eventName] = undefined; + } + element.removeAttribute(eventName); + } + } + + element = null; + return isSupported; + } + return isEventSupported; + })(); + + + // hasOwnProperty shim by kangax needed for Safari 2.0 support + var _hasOwnProperty = ({}).hasOwnProperty, hasOwnProperty; + if (!is(_hasOwnProperty, undefined) && !is(_hasOwnProperty.call, undefined)) { + hasOwnProperty = function (object, property) { + return _hasOwnProperty.call(object, property); + }; + } + else { + hasOwnProperty = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */ + return ((property in object) && is(object.constructor.prototype[property], undefined)); + }; + } + + /** + * set_css applies given styles to the Modernizr DOM node. + */ + function set_css( str ) { + m_style.cssText = str; + } + + /** + * set_css_all extrapolates all vendor-specific css strings. + */ + function set_css_all( str1, str2 ) { + return set_css(prefixes.join(str1 + ';') + ( str2 || '' )); + } + + /** + * is returns a boolean for if typeof obj is exactly type. + */ + function is( obj, type ) { + return typeof obj === type; + } + + /** + * contains returns a boolean for if substr is found within str. + */ + function contains( str, substr ) { + return (''+str).indexOf( substr ) !== -1; + } + + /** + * test_props is a generic CSS / DOM property test; if a browser supports + * a certain property, it won't return undefined for it. + * A supported CSS property returns empty string when its not yet set. + */ + function test_props( props, callback ) { + for ( var i in props ) { + if ( m_style[ props[i] ] !== undefined && ( !callback || callback( props[i], modElem ) ) ) { + return true; + } + } + } + + /** + * test_props_all tests a list of DOM properties we want to check against. + * We specify literally ALL possible (known and/or likely) properties on + * the element including the non-vendor prefixed one, for forward- + * compatibility. + */ + function test_props_all( prop, callback ) { + + var uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1), + props = (prop + ' ' + domPrefixes.join(uc_prop + ' ') + uc_prop).split(' '); + + return !!test_props( props, callback ); + } + + + /** + * Tests + * ----- + */ + + tests['flexbox'] = function() { + /** + * set_prefixed_value_css sets the property of a specified element + * adding vendor prefixes to the VALUE of the property. + * @param {Element} element + * @param {string} property The property name. This will not be prefixed. + * @param {string} value The value of the property. This WILL be prefixed. + * @param {string=} extra Additional CSS to append unmodified to the end of + * the CSS string. + */ + function set_prefixed_value_css(element, property, value, extra) { + property += ':'; + element.style.cssText = (property + prefixes.join(value + ';' + property)).slice(0, -property.length) + (extra || ''); + } + + /** + * set_prefixed_property_css sets the property of a specified element + * adding vendor prefixes to the NAME of the property. + * @param {Element} element + * @param {string} property The property name. This WILL be prefixed. + * @param {string} value The value of the property. This will not be prefixed. + * @param {string=} extra Additional CSS to append unmodified to the end of + * the CSS string. + */ + function set_prefixed_property_css(element, property, value, extra) { + element.style.cssText = prefixes.join(property + ':' + value + ';') + (extra || ''); + } + + var c = document.createElement('div'), + elem = document.createElement('div'); + + set_prefixed_value_css(c, 'display', 'box', 'width:42px;padding:0;'); + set_prefixed_property_css(elem, 'box-flex', '1', 'width:10px;'); + + c.appendChild(elem); + docElement.appendChild(c); + + var ret = elem.offsetWidth === 42; + + c.removeChild(elem); + docElement.removeChild(c); + + return ret; + }; + + // On the S60 and BB Storm, getContext exists, but always returns undefined + // http://github.com/Modernizr/Modernizr/issues/issue/97/ + + tests['canvas'] = function() { + var elem = document.createElement( 'canvas' ); + return !!(elem.getContext && elem.getContext('2d')); + }; + + tests['canvastext'] = function() { + return !!(ret['canvas'] && is(document.createElement( 'canvas' ).getContext('2d').fillText, 'function')); + }; + + // This WebGL test false positives in FF depending on graphics hardware. But really it's quite impossible to know + // wether webgl will succeed until after you create the context. You might have hardware that can support + // a 100x100 webgl canvas, but will not support a 1000x1000 webgl canvas. So this feature inference is weak, + // but intentionally so. + tests['webgl'] = function(){ + return !!window.WebGLRenderingContext; + }; + + /* + * The Modernizr.touch test only indicates if the browser supports + * touch events, which does not necessarily reflect a touchscreen + * device, as evidenced by tablets running Windows 7 or, alas, + * the Palm Pre / WebOS (touch) phones. + * + * Additionally, Chrome (desktop) used to lie about its support on this, + * but that has since been rectified: http://crbug.com/36415 + * + * We also test for Firefox 4 Multitouch Support. + * + * For more info, see: http://modernizr.github.com/Modernizr/touch.html + */ + + tests['touch'] = function() { + + return ('ontouchstart' in window) || testMediaQuery('@media ('+prefixes.join('touch-enabled),(')+'modernizr)'); + + }; + + + /** + * geolocation tests for the new Geolocation API specification. + * This test is a standards compliant-only test; for more complete + * testing, including a Google Gears fallback, please see: + * http://code.google.com/p/geo-location-javascript/ + * or view a fallback solution using google's geo API: + * http://gist.github.com/366184 + */ + tests['geolocation'] = function() { + return !!navigator.geolocation; + }; + + // Per 1.6: + // This used to be Modernizr.crosswindowmessaging but the longer + // name has been deprecated in favor of a shorter and property-matching one. + // The old API is still available in 1.6, but as of 2.0 will throw a warning, + // and in the first release thereafter disappear entirely. + tests['postmessage'] = function() { + return !!window.postMessage; + }; + + // Web SQL database detection is tricky: + + // In chrome incognito mode, openDatabase is truthy, but using it will + // throw an exception: http://crbug.com/42380 + // We can create a dummy database, but there is no way to delete it afterwards. + + // Meanwhile, Safari users can get prompted on any database creation. + // If they do, any page with Modernizr will give them a prompt: + // http://github.com/Modernizr/Modernizr/issues/closed#issue/113 + + // We have chosen to allow the Chrome incognito false positive, so that Modernizr + // doesn't litter the web with these test databases. As a developer, you'll have + // to account for this gotcha yourself. + tests['websqldatabase'] = function() { + var result = !!window.openDatabase; + /* if (result){ + try { + result = !!openDatabase( mod + "testdb", "1.0", mod + "testdb", 2e4); + } catch(e) { + } + } */ + return result; + }; + + // Vendors have inconsistent prefixing with the experimental Indexed DB: + // - Firefox is shipping indexedDB in FF4 as moz_indexedDB + // - Webkit's implementation is accessible through webkitIndexedDB + // We test both styles. + tests['indexedDB'] = function(){ + for (var i = -1, len = domPrefixes.length; ++i < len; ){ + var prefix = domPrefixes[i].toLowerCase(); + if (window[prefix + '_indexedDB'] || window[prefix + 'IndexedDB']){ + return true; + } + } + return false; + }; + + // documentMode logic from YUI to filter out IE8 Compat Mode + // which false positives. + tests['hashchange'] = function() { + return isEventSupported('hashchange', window) && ( document.documentMode === undefined || document.documentMode > 7 ); + }; + + // Per 1.6: + // This used to be Modernizr.historymanagement but the longer + // name has been deprecated in favor of a shorter and property-matching one. + // The old API is still available in 1.6, but as of 2.0 will throw a warning, + // and in the first release thereafter disappear entirely. + tests['history'] = function() { + return !!(window.history && history.pushState); + }; + + tests['draganddrop'] = function() { + return isEventSupported('dragstart') && isEventSupported('drop'); + }; + + tests['websockets'] = function(){ + return ('WebSocket' in window); + }; + + + // http://css-tricks.com/rgba-browser-support/ + tests['rgba'] = function() { + // Set an rgba() color and check the returned value + + set_css( 'background-color:rgba(150,255,150,.5)' ); + + return contains( m_style.backgroundColor, 'rgba' ); + }; + + tests['hsla'] = function() { + // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally, + // except IE9 who retains it as hsla + + set_css('background-color:hsla(120,40%,100%,.5)' ); + + return contains( m_style.backgroundColor, 'rgba' ) || contains( m_style.backgroundColor, 'hsla' ); + }; + + tests['multiplebgs'] = function() { + // Setting multiple images AND a color on the background shorthand property + // and then querying the style.background property value for the number of + // occurrences of "url(" is a reliable method for detecting ACTUAL support for this! + + set_css( 'background:url(//:),url(//:),red url(//:)' ); + + // If the UA supports multiple backgrounds, there should be three occurrences + // of the string "url(" in the return value for elem_style.background + + return new RegExp("(url\\s*\\(.*?){3}").test(m_style.background); + }; + + + // In testing support for a given CSS property, it's legit to test: + // `elem.style[styleName] !== undefined` + // If the property is supported it will return an empty string, + // if unsupported it will return undefined. + + // We'll take advantage of this quick test and skip setting a style + // on our modernizr element, but instead just testing undefined vs + // empty string. + + + tests['backgroundsize'] = function() { + return test_props_all( 'backgroundSize' ); + }; + + tests['borderimage'] = function() { + return test_props_all( 'borderImage' ); + }; + + + // Super comprehensive table about all the unique implementations of + // border-radius: http://muddledramblings.com/table-of-css3-border-radius-compliance + + tests['borderradius'] = function() { + return test_props_all( 'borderRadius', '', function( prop ) { + return contains( prop, 'orderRadius' ); + }); + }; + + // WebOS unfortunately false positives on this test. + tests['boxshadow'] = function() { + return test_props_all( 'boxShadow' ); + }; + + // FF3.0 will false positive on this test + tests['textshadow'] = function(){ + return document.createElement('div').style.textShadow === ''; + }; + + + tests['opacity'] = function() { + // Browsers that actually have CSS Opacity implemented have done so + // according to spec, which means their return values are within the + // range of [0.0,1.0] - including the leading zero. + + set_css_all( 'opacity:.55' ); + + // The non-literal . in this regex is intentional: + // German Chrome returns this value as 0,55 + // https://github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632 + return /^0.55$/.test(m_style.opacity); + }; + + + tests['cssanimations'] = function() { + return test_props_all( 'animationName' ); + }; + + + tests['csscolumns'] = function() { + return test_props_all( 'columnCount' ); + }; + + + tests['cssgradients'] = function() { + /** + * For CSS Gradients syntax, please see: + * http://webkit.org/blog/175/introducing-css-gradients/ + * https://developer.mozilla.org/en/CSS/-moz-linear-gradient + * https://developer.mozilla.org/en/CSS/-moz-radial-gradient + * http://dev.w3.org/csswg/css3-images/#gradients- + */ + + var str1 = 'background-image:', + str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', + str3 = 'linear-gradient(left top,#9f9, white);'; + + set_css( + (str1 + prefixes.join(str2 + str1) + prefixes.join(str3 + str1)).slice(0,-str1.length) + ); + + return contains( m_style.backgroundImage, 'gradient' ); + }; + + + tests['cssreflections'] = function() { + return test_props_all( 'boxReflect' ); + }; + + + tests['csstransforms'] = function() { + return !!test_props([ 'transformProperty', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ]); + }; + + + tests['csstransforms3d'] = function() { + + var ret = !!test_props([ 'perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective' ]); + + // Webkit’s 3D transforms are passed off to the browser's own graphics renderer. + // It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in + // some conditions. As a result, Webkit typically recognizes the syntax but + // will sometimes throw a false positive, thus we must do a more thorough check: + if (ret && 'webkitPerspective' in docElement.style){ + + // Webkit allows this media query to succeed only if the feature is enabled. + // `@media (transform-3d),(-o-transform-3d),(-moz-transform-3d),(-ms-transform-3d),(-webkit-transform-3d),(modernizr){ ... }` + ret = testMediaQuery('@media ('+prefixes.join('transform-3d),(')+'modernizr)'); + } + return ret; + }; + + + tests['csstransitions'] = function() { + return test_props_all( 'transitionProperty' ); + }; + + + // @font-face detection routine by Diego Perini + // http://javascript.nwbox.com/CSSSupport/ + tests['fontface'] = function(){ + + var + sheet, bool, + head = docHead || docElement, + style = document.createElement("style"), + impl = document.implementation || { hasFeature: function() { return false; } }; + + style.type = 'text/css'; + head.insertBefore(style, head.firstChild); + sheet = style.sheet || style.styleSheet; + + var supportAtRule = impl.hasFeature('CSS2', '') ? + function(rule) { + if (!(sheet && rule)) return false; + var result = false; + try { + sheet.insertRule(rule, 0); + result = (/src/i).test(sheet.cssRules[0].cssText); + sheet.deleteRule(sheet.cssRules.length - 1); + } catch(e) { } + return result; + } : + function(rule) { + if (!(sheet && rule)) return false; + sheet.cssText = rule; + + return sheet.cssText.length !== 0 && (/src/i).test(sheet.cssText) && + sheet.cssText + .replace(/\r+|\n+/g, '') + .indexOf(rule.split(' ')[0]) === 0; + }; + + bool = supportAtRule('@font-face { font-family: "font"; src: url(data:,); }'); + head.removeChild(style); + return bool; + }; + + + // These tests evaluate support of the video/audio elements, as well as + // testing what types of content they support. + // + // We're using the Boolean constructor here, so that we can extend the value + // e.g. Modernizr.video // true + // Modernizr.video.ogg // 'probably' + // + // Codec values from : http://github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845 + // thx to NielsLeenheer and zcorpan + + // Note: in FF 3.5.1 and 3.5.0, "no" was a return value instead of empty string. + // Modernizr does not normalize for that. + + tests['video'] = function() { + var elem = document.createElement('video'), + bool = !!elem.canPlayType; + + if (bool){ + bool = new Boolean(bool); + bool.ogg = elem.canPlayType('video/ogg; codecs="theora"'); + + // Workaround required for IE9, which doesn't report video support without audio codec specified. + // bug 599718 @ msft connect + var h264 = 'video/mp4; codecs="avc1.42E01E'; + bool.h264 = elem.canPlayType(h264 + '"') || elem.canPlayType(h264 + ', mp4a.40.2"'); + + bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"'); + } + return bool; + }; + + tests['audio'] = function() { + var elem = document.createElement('audio'), + bool = !!elem.canPlayType; + + if (bool){ + bool = new Boolean(bool); + bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"'); + bool.mp3 = elem.canPlayType('audio/mpeg;'); + + // Mimetypes accepted: + // https://developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements + // http://bit.ly/iphoneoscodecs + bool.wav = elem.canPlayType('audio/wav; codecs="1"'); + bool.m4a = elem.canPlayType('audio/x-m4a;') || elem.canPlayType('audio/aac;'); + } + return bool; + }; + + + // Firefox has made these tests rather unfun. + + // In FF4, if disabled, window.localStorage should === null. + + // Normally, we could not test that directly and need to do a + // `('localStorage' in window) && ` test first because otherwise Firefox will + // throw http://bugzil.la/365772 if cookies are disabled + + // However, in Firefox 4 betas, if dom.storage.enabled == false, just mentioning + // the property will throw an exception. http://bugzil.la/599479 + // This looks to be fixed for FF4 Final. + + // Because we are forced to try/catch this, we'll go aggressive. + + // FWIW: IE8 Compat mode supports these features completely: + // http://www.quirksmode.org/dom/html5.html + // But IE8 doesn't support either with local files + + tests['localstorage'] = function() { + try { + return !!localStorage.getItem; + } catch(e) { + return false; + } + }; + + tests['sessionstorage'] = function() { + try { + return !!sessionStorage.getItem; + } catch(e){ + return false; + } + }; + + + tests['webWorkers'] = function () { + return !!window.Worker; + }; + + + tests['applicationcache'] = function() { + return !!window.applicationCache; + }; + + + // Thanks to Erik Dahlstrom + tests['svg'] = function(){ + return !!document.createElementNS && !!document.createElementNS(ns.svg, "svg").createSVGRect; + }; + + tests['inlinesvg'] = function() { + var div = document.createElement('div'); + div.innerHTML = ''; + return (div.firstChild && div.firstChild.namespaceURI) == ns.svg; + }; + + // Thanks to F1lt3r and lucideer + // http://github.com/Modernizr/Modernizr/issues#issue/35 + tests['smil'] = function(){ + return !!document.createElementNS && /SVG/.test(tostring.call(document.createElementNS(ns.svg,'animate'))); + }; + + tests['svgclippaths'] = function(){ + // Possibly returns a false positive in Safari 3.2? + return !!document.createElementNS && /SVG/.test(tostring.call(document.createElementNS(ns.svg,'clipPath'))); + }; + + + // input features and input types go directly onto the ret object, bypassing the tests loop. + // Hold this guy to execute in a moment. + function webforms(){ + + // Run through HTML5's new input attributes to see if the UA understands any. + // We're using f which is the element created early on + // Mike Taylr has created a comprehensive resource for testing these attributes + // when applied to all input types: + // http://miketaylr.com/code/input-type-attr.html + // spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary + ret['input'] = (function(props) { + for (var i = 0, len = props.length; i>BEGIN IEPP + // Enable HTML 5 elements for styling in IE. + // fyi: jscript version does not reflect trident version + // therefore ie9 in ie7 mode will still have a jScript v.9 + if ( enableHTML5 && window.attachEvent && (function(){ var elem = document.createElement("div"); + elem.innerHTML = ""; + return elem.childNodes.length !== 1; })()) { + // iepp v1.6.2 by @jon_neal : code.google.com/p/ie-print-protector + (function(win, doc) { + var elems = 'abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video', + elemsArr = elems.split('|'), + elemsArrLen = elemsArr.length, + elemRegExp = new RegExp('(^|\\s)('+elems+')', 'gi'), + tagRegExp = new RegExp('<(\/*)('+elems+')', 'gi'), + ruleRegExp = new RegExp('(^|[^\\n]*?\\s)('+elems+')([^\\n]*)({[\\n\\w\\W]*?})', 'gi'), + docFrag = doc.createDocumentFragment(), + html = doc.documentElement, + head = html.firstChild, + bodyElem = doc.createElement('body'), + styleElem = doc.createElement('style'), + body; + function shim(doc) { + var a = -1; + while (++a < elemsArrLen) + // Use createElement so IE allows HTML5-named elements in a document + doc.createElement(elemsArr[a]); + } + function getCSS(styleSheetList, mediaType) { + var a = -1, + len = styleSheetList.length, + styleSheet, + cssTextArr = []; + while (++a < len) { + styleSheet = styleSheetList[a]; + // Get css from all non-screen stylesheets and their imports + if ((mediaType = styleSheet.media || mediaType) != 'screen') cssTextArr.push(getCSS(styleSheet.imports, mediaType), styleSheet.cssText); + } + return cssTextArr.join(''); + } + // Shim the document and iepp fragment + shim(doc); + shim(docFrag); + // Add iepp custom print style element + head.insertBefore(styleElem, head.firstChild); + styleElem.media = 'print'; + win.attachEvent( + 'onbeforeprint', + function() { + var a = -1, + cssText = getCSS(doc.styleSheets, 'all'), + cssTextArr = [], + rule; + body = body || doc.body; + // Get only rules which reference HTML5 elements by name + while ((rule = ruleRegExp.exec(cssText)) != null) + // Replace all html5 element references with iepp substitute classnames + cssTextArr.push((rule[1]+rule[2]+rule[3]).replace(elemRegExp, '$1.iepp_$2')+rule[4]); + // Write iepp custom print CSS + styleElem.styleSheet.cssText = cssTextArr.join('\n'); + while (++a < elemsArrLen) { + var nodeList = doc.getElementsByTagName(elemsArr[a]), + nodeListLen = nodeList.length, + b = -1; + while (++b < nodeListLen) + if (nodeList[b].className.indexOf('iepp_') < 0) + // Append iepp substitute classnames to all html5 elements + nodeList[b].className += ' iepp_'+elemsArr[a]; + } + docFrag.appendChild(body); + html.appendChild(bodyElem); + // Write iepp substitute print-safe document + bodyElem.className = body.className; + // Replace HTML5 elements with which is print-safe and shouldn't conflict since it isn't part of html5 + bodyElem.innerHTML = body.innerHTML.replace(tagRegExp, '<$1font'); + } + ); + win.attachEvent( + 'onafterprint', + function() { + // Undo everything done in onbeforeprint + bodyElem.innerHTML = ''; + html.removeChild(bodyElem); + html.appendChild(body); + styleElem.styleSheet.cssText = ''; + } + ); + })(window, document); + } + //>>END IEPP + + // Assign private properties to the return object with prefix + ret._enableHTML5 = enableHTML5; + ret._version = version; + + // Remove "no-js" class from element, if it exists: + docElement.className = docElement.className.replace(/\bno-js\b/,'') + + ' js ' + + // Add the new classes to the element. + + classes.join( ' ' ); + + return ret; + +})(this,this.document); \ No newline at end of file diff --git a/packages/Modernizr.1.7/Content/Scripts/modernizr-1.7.min.js b/packages/Modernizr.1.7/Content/Scripts/modernizr-1.7.min.js new file mode 100644 index 0000000..4b4fcc1 --- /dev/null +++ b/packages/Modernizr.1.7/Content/Scripts/modernizr-1.7.min.js @@ -0,0 +1,10 @@ +/*! +* Note: While Microsoft is not the author of this file, Microsoft is +* offering you a license subject to the terms of the Microsoft Software +* License Terms for Microsoft ASP.NET Model View Controller 3. +* Microsoft reserves all other rights. The notices below are provided +* for informational purposes only and are not the license terms under +* which Microsoft distributed this file. +*/ +// Modernizr v1.7 www.modernizr.com +window.Modernizr=function(a,b,c){function G(){e.input=function(a){for(var b=0,c=a.length;b7)},r.history=function(){return !!(a.history&&history.pushState)},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){return"WebSocket"in a},r.rgba=function(){A("background-color:rgba(150,255,150,.5)");return D(k.backgroundColor,"rgba")},r.hsla=function(){A("background-color:hsla(120,40%,100%,.5)");return D(k.backgroundColor,"rgba")||D(k.backgroundColor,"hsla")},r.multiplebgs=function(){A("background:url(//:),url(//:),red url(//:)");return(new RegExp("(url\\s*\\(.*?){3}")).test(k.background)},r.backgroundsize=function(){return F("backgroundSize")},r.borderimage=function(){return F("borderImage")},r.borderradius=function(){return F("borderRadius","",function(a){return D(a,"orderRadius")})},r.boxshadow=function(){return F("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){B("opacity:.55");return/^0.55$/.test(k.opacity)},r.cssanimations=function(){return F("animationName")},r.csscolumns=function(){return F("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";A((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return D(k.backgroundImage,"gradient")},r.cssreflections=function(){return F("boxReflect")},r.csstransforms=function(){return!!E(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!E(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=w("@media ("+o.join("transform-3d),(")+"modernizr)"));return a},r.csstransitions=function(){return F("transitionProperty")},r.fontface=function(){var a,c,d=h||g,e=b.createElement("style"),f=b.implementation||{hasFeature:function(){return!1}};e.type="text/css",d.insertBefore(e,d.firstChild),a=e.sheet||e.styleSheet;var i=f.hasFeature("CSS2","")?function(b){if(!a||!b)return!1;var c=!1;try{a.insertRule(b,0),c=/src/i.test(a.cssRules[0].cssText),a.deleteRule(a.cssRules.length-1)}catch(d){}return c}:function(b){if(!a||!b)return!1;a.cssText=b;return a.cssText.length!==0&&/src/i.test(a.cssText)&&a.cssText.replace(/\r+|\n+/g,"").indexOf(b.split(" ")[0])===0};c=i('@font-face { font-family: "font"; src: url(data:,); }'),d.removeChild(e);return c},r.video=function(){var a=b.createElement("video"),c=!!a.canPlayType;if(c){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return c},r.audio=function(){var a=b.createElement("audio"),c=!!a.canPlayType;c&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webWorkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");a.innerHTML="";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var H in r)z(r,H)&&(v=H.toLowerCase(),e[v]=r[H](),u.push((e[v]?"":"no-")+v));e.input||G(),e.crosswindowmessaging=e.postmessage,e.historymanagement=e.history,e.addTest=function(a,b){a=a.toLowerCase();if(!e[a]){b=!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b;return e}},A(""),j=l=null,f&&a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="";return a.childNodes.length!==1}()&&function(a,b){function p(a,b){var c=-1,d=a.length,e,f=[];while(++c + + + Moq + + + + + Implements the fluent API. + + + + + The expectation will be considered only in the former condition. + + + + + + + The expectation will be considered only in the former condition. + + + + + + + + Setups the get. + + The type of the property. + The expression. + + + + + Setups the set. + + The type of the property. + The setter expression. + + + + + Setups the set. + + The setter expression. + + + + + Defines the Callback verb and overloads. + + + + + Helper interface used to hide the base + members from the fluent API to make it much cleaner + in Visual Studio intellisense. + + + + + + + + + + + + + + + + + Specifies a callback to invoke when the method is called. + + The callback method to invoke. + + The following example specifies a callback to set a boolean + value that can be used later: + + var called = false; + mock.Setup(x => x.Execute()) + .Callback(() => called = true); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The argument type of the invoked method. + The callback method to invoke. + + Invokes the given callback with the concrete invocation argument value. + + Notice how the specific string argument is retrieved by simply declaring + it as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute(It.IsAny<string>())) + .Callback((string command) => Console.WriteLine(command)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3) => Console.WriteLine(arg1 + arg2 + arg3)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The type of the sixteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16)); + + + + + + Defines the Callback verb and overloads for callbacks on + setups that return a value. + + Mocked type. + Type of the return value of the setup. + + + + Specifies a callback to invoke when the method is called. + + The callback method to invoke. + + The following example specifies a callback to set a boolean value that can be used later: + + var called = false; + mock.Setup(x => x.Execute()) + .Callback(() => called = true) + .Returns(true); + + Note that in the case of value-returning methods, after the Callback + call you can still specify the return value. + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the argument of the invoked method. + Callback method to invoke. + + Invokes the given callback with the concrete invocation argument value. + + Notice how the specific string argument is retrieved by simply declaring + it as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute(It.IsAny<string>())) + .Callback(command => Console.WriteLine(command)) + .Returns(true); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2) => Console.WriteLine(arg1 + arg2)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3) => Console.WriteLine(arg1 + arg2 + arg3)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The type of the sixteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16)); + + + + + + Defines the Raises verb. + + + + + Specifies the event that will be raised + when the setup is met. + + An expression that represents an event attach or detach action. + The event arguments to pass for the raised event. + + The following example shows how to raise an event when + the setup is met: + + var mock = new Mock<IContainer>(); + + mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>())) + .Raises(add => add.Added += null, EventArgs.Empty); + + + + + + Specifies the event that will be raised + when the setup is matched. + + An expression that represents an event attach or detach action. + A function that will build the + to pass when raising the event. + + + + + Specifies the custom event that will be raised + when the setup is matched. + + An expression that represents an event attach or detach action. + The arguments to pass to the custom delegate (non EventHandler-compatible). + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + The type of the thirteenth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + The type of the thirteenth argument received by the expected invocation. + The type of the fourteenth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + The type of the thirteenth argument received by the expected invocation. + The type of the fourteenth argument received by the expected invocation. + The type of the fifteenth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + The type of the thirteenth argument received by the expected invocation. + The type of the fourteenth argument received by the expected invocation. + The type of the fifteenth argument received by the expected invocation. + The type of the sixteenth argument received by the expected invocation. + + + + + Defines the Returns verb. + + Mocked type. + Type of the return value from the expression. + + + + Specifies the value to return. + + The value to return, or . + + Return a true value from the method call: + + mock.Setup(x => x.Execute("ping")) + .Returns(true); + + + + + + Specifies a function that will calculate the value to return from the method. + + The function that will calculate the return value. + + Return a calculated value when the method is called: + + mock.Setup(x => x.Execute("ping")) + .Returns(() => returnValues[0]); + + The lambda expression to retrieve the return value is lazy-executed, + meaning that its value may change depending on the moment the method + is executed and the value the returnValues array has at + that moment. + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the argument of the invoked method. + The function that will calculate the return value. + + Return a calculated value which is evaluated lazily at the time of the invocation. + + The lookup list can change between invocations and the setup + will return different values accordingly. Also, notice how the specific + string argument is retrieved by simply declaring it as part of the lambda + expression: + + + mock.Setup(x => x.Execute(It.IsAny<string>())) + .Returns((string command) => returnValues[command]); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2) => arg1 + arg2); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3) => arg1 + arg2 + arg3); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4) => arg1 + arg2 + arg3 + arg4); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5) => arg1 + arg2 + arg3 + arg4 + arg5); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The type of the sixteenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16); + + + + + + Language for ReturnSequence + + + + + Returns value + + + + + Throws an exception + + + + + Throws an exception + + + + + The first method call or member access will be the + last segment of the expression (depth-first traversal), + which is the one we have to Setup rather than FluentMock. + And the last one is the one we have to Mock.Get rather + than FluentMock. + + + + + Base class for mocks and static helper class with methods that + apply to mocked objects, such as to + retrieve a from an object instance. + + + + + Creates an mock object of the indicated type. + + The type of the mocked object. + The mocked object created. + + + + Creates an mock object of the indicated type. + + The predicate with the specification of how the mocked object should behave. + The type of the mocked object. + The mocked object created. + + + + Initializes a new instance of the class. + + + + + Retrieves the mock object for the given object instance. + + Type of the mock to retrieve. Can be omitted as it's inferred + from the object instance passed in as the instance. + The instance of the mocked object.The mock associated with the mocked object. + The received instance + was not created by Moq. + + The following example shows how to add a new setup to an object + instance which is not the original but rather + the object associated with it: + + // Typed instance, not the mock, is retrieved from some test API. + HttpContextBase context = GetMockContext(); + + // context.Request is the typed object from the "real" API + // so in order to add a setup to it, we need to get + // the mock that "owns" it + Mock<HttpRequestBase> request = Mock.Get(context.Request); + mock.Setup(req => req.AppRelativeCurrentExecutionFilePath) + .Returns(tempUrl); + + + + + + Returns the mocked object value. + + + + + Verifies that all verifiable expectations have been met. + + This example sets up an expectation and marks it as verifiable. After + the mock is used, a Verify() call is issued on the mock + to ensure the method in the setup was invoked: + + var mock = new Mock<IWarehouse>(); + this.Setup(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true); + ... + // other test code + ... + // Will throw if the test code has didn't call HasInventory. + this.Verify(); + + Not all verifiable expectations were met. + + + + Verifies all expectations regardless of whether they have + been flagged as verifiable. + + This example sets up an expectation without marking it as verifiable. After + the mock is used, a call is issued on the mock + to ensure that all expectations are met: + + var mock = new Mock<IWarehouse>(); + this.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); + ... + // other test code + ... + // Will throw if the test code has didn't call HasInventory, even + // that expectation was not marked as verifiable. + this.VerifyAll(); + + At least one expectation was not met. + + + + Gets the interceptor target for the given expression and root mock, + building the intermediate hierarchy of mock objects if necessary. + + + + + Raises the associated event with the given + event argument data. + + + + + Raises the associated event with the given + event argument data. + + + + + Adds an interface implementation to the mock, + allowing setups to be specified for it. + + This method can only be called before the first use + of the mock property, at which + point the runtime type has already been generated + and no more interfaces can be added to it. + + Also, must be an + interface and not a class, which must be specified + when creating the mock instead. + + + The mock type + has already been generated by accessing the property. + + The specified + is not an interface. + + The following example creates a mock for the main interface + and later adds to it to verify + it's called by the consumer code: + + var mock = new Mock<IProcessor>(); + mock.Setup(x => x.Execute("ping")); + + // add IDisposable interface + var disposable = mock.As<IDisposable>(); + disposable.Setup(d => d.Dispose()).Verifiable(); + + Type of interface to cast the mock to. + + + + + + + Behavior of the mock, according to the value set in the constructor. + + + + + Whether the base member virtual implementation will be called + for mocked classes if no setup is matched. Defaults to . + + + + + Specifies the behavior to use when returning default values for + unexpected invocations on loose mocks. + + + + + Gets the mocked object instance. + + + + + Retrieves the type of the mocked object, its generic type argument. + This is used in the auto-mocking of hierarchy access. + + + + + Specifies the class that will determine the default + value to return when invocations are made that + have no setups and need to return a default + value (for loose mocks). + + + + + Exposes the list of extra interfaces implemented by the mock. + + + + + Utility repository class to use to construct multiple + mocks when consistent verification is + desired for all of them. + + + If multiple mocks will be created during a test, passing + the desired (if different than the + or the one + passed to the repository constructor) and later verifying each + mock can become repetitive and tedious. + + This repository class helps in that scenario by providing a + simplified creation of multiple mocks with a default + (unless overriden by calling + ) and posterior verification. + + + + The following is a straightforward example on how to + create and automatically verify strict mocks using a : + + var repository = new MockRepository(MockBehavior.Strict); + + var foo = repository.Create<IFoo>(); + var bar = repository.Create<IBar>(); + + // no need to call Verifiable() on the setup + // as we'll be validating all of them anyway. + foo.Setup(f => f.Do()); + bar.Setup(b => b.Redo()); + + // exercise the mocks here + + repository.VerifyAll(); + // At this point all setups are already checked + // and an optional MockException might be thrown. + // Note also that because the mocks are strict, any invocation + // that doesn't have a matching setup will also throw a MockException. + + The following examples shows how to setup the repository + to create loose mocks and later verify only verifiable setups: + + var repository = new MockRepository(MockBehavior.Loose); + + var foo = repository.Create<IFoo>(); + var bar = repository.Create<IBar>(); + + // this setup will be verified when we verify the repository + foo.Setup(f => f.Do()).Verifiable(); + + // this setup will NOT be verified + foo.Setup(f => f.Calculate()); + + // this setup will be verified when we verify the repository + bar.Setup(b => b.Redo()).Verifiable(); + + // exercise the mocks here + // note that because the mocks are Loose, members + // called in the interfaces for which no matching + // setups exist will NOT throw exceptions, + // and will rather return default values. + + repository.Verify(); + // At this point verifiable setups are already checked + // and an optional MockException might be thrown. + + The following examples shows how to setup the repository with a + default strict behavior, overriding that default for a + specific mock: + + var repository = new MockRepository(MockBehavior.Strict); + + // this particular one we want loose + var foo = repository.Create<IFoo>(MockBehavior.Loose); + var bar = repository.Create<IBar>(); + + // specify setups + + // exercise the mocks here + + repository.Verify(); + + + + + + + Utility factory class to use to construct multiple + mocks when consistent verification is + desired for all of them. + + + If multiple mocks will be created during a test, passing + the desired (if different than the + or the one + passed to the factory constructor) and later verifying each + mock can become repetitive and tedious. + + This factory class helps in that scenario by providing a + simplified creation of multiple mocks with a default + (unless overriden by calling + ) and posterior verification. + + + + The following is a straightforward example on how to + create and automatically verify strict mocks using a : + + var factory = new MockFactory(MockBehavior.Strict); + + var foo = factory.Create<IFoo>(); + var bar = factory.Create<IBar>(); + + // no need to call Verifiable() on the setup + // as we'll be validating all of them anyway. + foo.Setup(f => f.Do()); + bar.Setup(b => b.Redo()); + + // exercise the mocks here + + factory.VerifyAll(); + // At this point all setups are already checked + // and an optional MockException might be thrown. + // Note also that because the mocks are strict, any invocation + // that doesn't have a matching setup will also throw a MockException. + + The following examples shows how to setup the factory + to create loose mocks and later verify only verifiable setups: + + var factory = new MockFactory(MockBehavior.Loose); + + var foo = factory.Create<IFoo>(); + var bar = factory.Create<IBar>(); + + // this setup will be verified when we verify the factory + foo.Setup(f => f.Do()).Verifiable(); + + // this setup will NOT be verified + foo.Setup(f => f.Calculate()); + + // this setup will be verified when we verify the factory + bar.Setup(b => b.Redo()).Verifiable(); + + // exercise the mocks here + // note that because the mocks are Loose, members + // called in the interfaces for which no matching + // setups exist will NOT throw exceptions, + // and will rather return default values. + + factory.Verify(); + // At this point verifiable setups are already checked + // and an optional MockException might be thrown. + + The following examples shows how to setup the factory with a + default strict behavior, overriding that default for a + specific mock: + + var factory = new MockFactory(MockBehavior.Strict); + + // this particular one we want loose + var foo = factory.Create<IFoo>(MockBehavior.Loose); + var bar = factory.Create<IBar>(); + + // specify setups + + // exercise the mocks here + + factory.Verify(); + + + + + + + Initializes the factory with the given + for newly created mocks from the factory. + + The behavior to use for mocks created + using the factory method if not overriden + by using the overload. + + + + Creates a new mock with the default + specified at factory construction time. + + Type to mock. + A new . + + + var factory = new MockFactory(MockBehavior.Strict); + + var foo = factory.Create<IFoo>(); + // use mock on tests + + factory.VerifyAll(); + + + + + + Creates a new mock with the default + specified at factory construction time and with the + the given constructor arguments for the class. + + + The mock will try to find the best match constructor given the + constructor arguments, and invoke that to initialize the instance. + This applies only to classes, not interfaces. + + Type to mock. + Constructor arguments for mocked classes. + A new . + + + var factory = new MockFactory(MockBehavior.Default); + + var mock = factory.Create<MyBase>("Foo", 25, true); + // use mock on tests + + factory.Verify(); + + + + + + Creates a new mock with the given . + + Type to mock. + Behavior to use for the mock, which overrides + the default behavior specified at factory construction time. + A new . + + The following example shows how to create a mock with a different + behavior to that specified as the default for the factory: + + var factory = new MockFactory(MockBehavior.Strict); + + var foo = factory.Create<IFoo>(MockBehavior.Loose); + + + + + + Creates a new mock with the given + and with the the given constructor arguments for the class. + + + The mock will try to find the best match constructor given the + constructor arguments, and invoke that to initialize the instance. + This applies only to classes, not interfaces. + + Type to mock. + Behavior to use for the mock, which overrides + the default behavior specified at factory construction time. + Constructor arguments for mocked classes. + A new . + + The following example shows how to create a mock with a different + behavior to that specified as the default for the factory, passing + constructor arguments: + + var factory = new MockFactory(MockBehavior.Default); + + var mock = factory.Create<MyBase>(MockBehavior.Strict, "Foo", 25, true); + + + + + + Implements creation of a new mock within the factory. + + Type to mock. + The behavior for the new mock. + Optional arguments for the construction of the mock. + + + + Verifies all verifiable expectations on all mocks created + by this factory. + + + One or more mocks had expectations that were not satisfied. + + + + Verifies all verifiable expectations on all mocks created + by this factory. + + + One or more mocks had expectations that were not satisfied. + + + + Invokes for each mock + in , and accumulates the resulting + that might be + thrown from the action. + + The action to execute against + each mock. + + + + Whether the base member virtual implementation will be called + for mocked classes if no setup is matched. Defaults to . + + + + + Specifies the behavior to use when returning default values for + unexpected invocations on loose mocks. + + + + + Gets the mocks that have been created by this factory and + that will get verified together. + + + + + Access the universe of mocks of the given type, to retrieve those + that behave according to the LINQ query specification. + + The type of the mocked object to query. + + + + Access the universe of mocks of the given type, to retrieve those + that behave according to the LINQ query specification. + + The predicate with the setup expressions. + The type of the mocked object to query. + + + + Creates an mock object of the indicated type. + + The type of the mocked object. + The mocked object created. + + + + Creates an mock object of the indicated type. + + The predicate with the setup expressions. + The type of the mocked object. + The mocked object created. + + + + Creates the mock query with the underlying queriable implementation. + + + + + Wraps the enumerator inside a queryable. + + + + + Method that is turned into the actual call from .Query{T}, to + transform the queryable query into a normal enumerable query. + This method is never used directly by consumers. + + + + + Initializes the repository with the given + for newly created mocks from the repository. + + The behavior to use for mocks created + using the repository method if not overriden + by using the overload. + + + + A that returns an empty default value + for invocations that do not have setups or return values, with loose mocks. + This is the default behavior for a mock. + + + + + Interface to be implemented by classes that determine the + default value of non-expected invocations. + + + + + Defines the default value to return in all the methods returning . + The type of the return value.The value to set as default. + + + + Provides a value for the given member and arguments. + + The member to provide a default value for. + + + + + The intention of is to create a more readable + string representation for the failure message. + + + + + Implements the fluent API. + + + + + Defines the Throws verb. + + + + + Specifies the exception to throw when the method is invoked. + + Exception instance to throw. + + This example shows how to throw an exception when the method is + invoked with an empty string argument: + + mock.Setup(x => x.Execute("")) + .Throws(new ArgumentException()); + + + + + + Specifies the type of exception to throw when the method is invoked. + + Type of exception to instantiate and throw when the setup is matched. + + This example shows how to throw an exception when the method is + invoked with an empty string argument: + + mock.Setup(x => x.Execute("")) + .Throws<ArgumentException>(); + + + + + + Implements the fluent API. + + + + + Defines occurrence members to constraint setups. + + + + + The expected invocation can happen at most once. + + + + var mock = new Mock<ICommand>(); + mock.Setup(foo => foo.Execute("ping")) + .AtMostOnce(); + + + + + + The expected invocation can happen at most specified number of times. + + The number of times to accept calls. + + + var mock = new Mock<ICommand>(); + mock.Setup(foo => foo.Execute("ping")) + .AtMost( 5 ); + + + + + + Defines the Verifiable verb. + + + + + Marks the expectation as verifiable, meaning that a call + to will check if this particular + expectation was met. + + + The following example marks the expectation as verifiable: + + mock.Expect(x => x.Execute("ping")) + .Returns(true) + .Verifiable(); + + + + + + Marks the expectation as verifiable, meaning that a call + to will check if this particular + expectation was met, and specifies a message for failures. + + + The following example marks the expectation as verifiable: + + mock.Expect(x => x.Execute("ping")) + .Returns(true) + .Verifiable("Ping should be executed always!"); + + + + + + Implements the fluent API. + + + + + We need this non-generics base class so that + we can use from + generic code. + + + + + Implements the fluent API. + + + + + Implements the fluent API. + + + + + Implements the fluent API. + + + + + Defines the Callback verb for property getter setups. + + + Mocked type. + Type of the property. + + + + Specifies a callback to invoke when the property is retrieved. + + Callback method to invoke. + + Invokes the given callback with the property value being set. + + mock.SetupGet(x => x.Suspended) + .Callback(() => called = true) + .Returns(true); + + + + + + Implements the fluent API. + + + + + Defines the Returns verb for property get setups. + + Mocked type. + Type of the property. + + + + Specifies the value to return. + + The value to return, or . + + Return a true value from the property getter call: + + mock.SetupGet(x => x.Suspended) + .Returns(true); + + + + + + Specifies a function that will calculate the value to return for the property. + + The function that will calculate the return value. + + Return a calculated value when the property is retrieved: + + mock.SetupGet(x => x.Suspended) + .Returns(() => returnValues[0]); + + The lambda expression to retrieve the return value is lazy-executed, + meaning that its value may change depending on the moment the property + is retrieved and the value the returnValues array has at + that moment. + + + + + Implements the fluent API. + + + + + Encapsulates a method that has five parameters and does not return a value. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + + + + Encapsulates a method that has five parameters and returns a value of the type specified by the parameter. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the return value of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The return value of the method that this delegate encapsulates. + + + + Encapsulates a method that has six parameters and does not return a value. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + + + + Encapsulates a method that has six parameters and returns a value of the type specified by the parameter. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the return value of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The return value of the method that this delegate encapsulates. + + + + Encapsulates a method that has seven parameters and does not return a value. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + + + + Encapsulates a method that has seven parameters and returns a value of the type specified by the parameter. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the return value of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The return value of the method that this delegate encapsulates. + + + + Encapsulates a method that has eight parameters and does not return a value. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + + + + Encapsulates a method that has eight parameters and returns a value of the type specified by the parameter. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the return value of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The return value of the method that this delegate encapsulates. + + + + Encapsulates a method that has nine parameters and does not return a value. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + + + + Encapsulates a method that has nine parameters and returns a value of the type specified by the parameter. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the return value of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The return value of the method that this delegate encapsulates. + + + + Encapsulates a method that has ten parameters and does not return a value. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + + + + Encapsulates a method that has ten parameters and returns a value of the type specified by the parameter. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The type of the return value of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + The return value of the method that this delegate encapsulates. + + + + Encapsulates a method that has eleven parameters and does not return a value. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The type of the eleventh parameter of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + The eleventh parameter of the method that this delegate encapsulates. + + + + Encapsulates a method that has eleven parameters and returns a value of the type specified by the parameter. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The type of the eleventh parameter of the method that this delegate encapsulates. + The type of the return value of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + The eleventh parameter of the method that this delegate encapsulates. + The return value of the method that this delegate encapsulates. + + + + Encapsulates a method that has twelve parameters and does not return a value. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The type of the eleventh parameter of the method that this delegate encapsulates. + The type of the twelfth parameter of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + The eleventh parameter of the method that this delegate encapsulates. + The twelfth parameter of the method that this delegate encapsulates. + + + + Encapsulates a method that has twelve parameters and returns a value of the type specified by the parameter. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The type of the eleventh parameter of the method that this delegate encapsulates. + The type of the twelfth parameter of the method that this delegate encapsulates. + The type of the return value of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + The eleventh parameter of the method that this delegate encapsulates. + The twelfth parameter of the method that this delegate encapsulates. + The return value of the method that this delegate encapsulates. + + + + Encapsulates a method that has thirteen parameters and does not return a value. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The type of the eleventh parameter of the method that this delegate encapsulates. + The type of the twelfth parameter of the method that this delegate encapsulates. + The type of the thirteenth parameter of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + The eleventh parameter of the method that this delegate encapsulates. + The twelfth parameter of the method that this delegate encapsulates. + The thirteenth parameter of the method that this delegate encapsulates. + + + + Encapsulates a method that has thirteen parameters and returns a value of the type specified by the parameter. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The type of the eleventh parameter of the method that this delegate encapsulates. + The type of the twelfth parameter of the method that this delegate encapsulates. + The type of the thirteenth parameter of the method that this delegate encapsulates. + The type of the return value of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + The eleventh parameter of the method that this delegate encapsulates. + The twelfth parameter of the method that this delegate encapsulates. + The thirteenth parameter of the method that this delegate encapsulates. + The return value of the method that this delegate encapsulates. + + + + Encapsulates a method that has fourteen parameters and does not return a value. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The type of the eleventh parameter of the method that this delegate encapsulates. + The type of the twelfth parameter of the method that this delegate encapsulates. + The type of the thirteenth parameter of the method that this delegate encapsulates. + The type of the fourteenth parameter of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + The eleventh parameter of the method that this delegate encapsulates. + The twelfth parameter of the method that this delegate encapsulates. + The thirteenth parameter of the method that this delegate encapsulates. + The fourteenth parameter of the method that this delegate encapsulates. + + + + Encapsulates a method that has fourteen parameters and returns a value of the type specified by the parameter. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The type of the eleventh parameter of the method that this delegate encapsulates. + The type of the twelfth parameter of the method that this delegate encapsulates. + The type of the thirteenth parameter of the method that this delegate encapsulates. + The type of the fourteenth parameter of the method that this delegate encapsulates. + The type of the return value of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + The eleventh parameter of the method that this delegate encapsulates. + The twelfth parameter of the method that this delegate encapsulates. + The thirteenth parameter of the method that this delegate encapsulates. + The fourteenth parameter of the method that this delegate encapsulates. + The return value of the method that this delegate encapsulates. + + + + Encapsulates a method that has fifteen parameters and does not return a value. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The type of the eleventh parameter of the method that this delegate encapsulates. + The type of the twelfth parameter of the method that this delegate encapsulates. + The type of the thirteenth parameter of the method that this delegate encapsulates. + The type of the fourteenth parameter of the method that this delegate encapsulates. + The type of the fifteenth parameter of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + The eleventh parameter of the method that this delegate encapsulates. + The twelfth parameter of the method that this delegate encapsulates. + The thirteenth parameter of the method that this delegate encapsulates. + The fourteenth parameter of the method that this delegate encapsulates. + The fifteenth parameter of the method that this delegate encapsulates. + + + + Encapsulates a method that has fifteen parameters and returns a value of the type specified by the parameter. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The type of the eleventh parameter of the method that this delegate encapsulates. + The type of the twelfth parameter of the method that this delegate encapsulates. + The type of the thirteenth parameter of the method that this delegate encapsulates. + The type of the fourteenth parameter of the method that this delegate encapsulates. + The type of the fifteenth parameter of the method that this delegate encapsulates. + The type of the return value of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + The eleventh parameter of the method that this delegate encapsulates. + The twelfth parameter of the method that this delegate encapsulates. + The thirteenth parameter of the method that this delegate encapsulates. + The fourteenth parameter of the method that this delegate encapsulates. + The fifteenth parameter of the method that this delegate encapsulates. + The return value of the method that this delegate encapsulates. + + + + Encapsulates a method that has sixteen parameters and does not return a value. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The type of the eleventh parameter of the method that this delegate encapsulates. + The type of the twelfth parameter of the method that this delegate encapsulates. + The type of the thirteenth parameter of the method that this delegate encapsulates. + The type of the fourteenth parameter of the method that this delegate encapsulates. + The type of the fifteenth parameter of the method that this delegate encapsulates. + The type of the sixteenth parameter of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + The eleventh parameter of the method that this delegate encapsulates. + The twelfth parameter of the method that this delegate encapsulates. + The thirteenth parameter of the method that this delegate encapsulates. + The fourteenth parameter of the method that this delegate encapsulates. + The fifteenth parameter of the method that this delegate encapsulates. + The sixteenth parameter of the method that this delegate encapsulates. + + + + Encapsulates a method that has sixteen parameters and returns a value of the type specified by the parameter. + + The type of the first parameter of the method that this delegate encapsulates. + The type of the second parameter of the method that this delegate encapsulates. + The type of the third parameter of the method that this delegate encapsulates. + The type of the fourth parameter of the method that this delegate encapsulates. + The type of the fifth parameter of the method that this delegate encapsulates. + The type of the sixth parameter of the method that this delegate encapsulates. + The type of the seventh parameter of the method that this delegate encapsulates. + The type of the eighth parameter of the method that this delegate encapsulates. + The type of the nineth parameter of the method that this delegate encapsulates. + The type of the tenth parameter of the method that this delegate encapsulates. + The type of the eleventh parameter of the method that this delegate encapsulates. + The type of the twelfth parameter of the method that this delegate encapsulates. + The type of the thirteenth parameter of the method that this delegate encapsulates. + The type of the fourteenth parameter of the method that this delegate encapsulates. + The type of the fifteenth parameter of the method that this delegate encapsulates. + The type of the sixteenth parameter of the method that this delegate encapsulates. + The type of the return value of the method that this delegate encapsulates. + The first parameter of the method that this delegate encapsulates. + The second parameter of the method that this delegate encapsulates. + The third parameter of the method that this delegate encapsulates. + The fourth parameter of the method that this delegate encapsulates. + The fifth parameter of the method that this delegate encapsulates. + The sixth parameter of the method that this delegate encapsulates. + The seventh parameter of the method that this delegate encapsulates. + The eighth parameter of the method that this delegate encapsulates. + The nineth parameter of the method that this delegate encapsulates. + The tenth parameter of the method that this delegate encapsulates. + The eleventh parameter of the method that this delegate encapsulates. + The twelfth parameter of the method that this delegate encapsulates. + The thirteenth parameter of the method that this delegate encapsulates. + The fourteenth parameter of the method that this delegate encapsulates. + The fifteenth parameter of the method that this delegate encapsulates. + The sixteenth parameter of the method that this delegate encapsulates. + The return value of the method that this delegate encapsulates. + + + + Helper class to setup a full trace between many mocks + + + + + Initialize a trace setup + + + + + Allow sequence to be repeated + + + + + define nice api + + + + + Perform an expectation in the trace. + + + + + Marks a method as a matcher, which allows complete replacement + of the built-in class with your own argument + matching rules. + + + This feature has been deprecated in favor of the new + and simpler . + + + The argument matching is used to determine whether a concrete + invocation in the mock matches a given setup. This + matching mechanism is fully extensible. + + + There are two parts of a matcher: the compiler matcher + and the runtime matcher. + + + Compiler matcher + Used to satisfy the compiler requirements for the + argument. Needs to be a method optionally receiving any arguments + you might need for the matching, but with a return type that + matches that of the argument. + + Let's say I want to match a lists of orders that contains + a particular one. I might create a compiler matcher like the following: + + + public static class Orders + { + [Matcher] + public static IEnumerable<Order> Contains(Order order) + { + return null; + } + } + + Now we can invoke this static method instead of an argument in an + invocation: + + var order = new Order { ... }; + var mock = new Mock<IRepository<Order>>(); + + mock.Setup(x => x.Save(Orders.Contains(order))) + .Throws<ArgumentException>(); + + Note that the return value from the compiler matcher is irrelevant. + This method will never be called, and is just used to satisfy the + compiler and to signal Moq that this is not a method that we want + to be invoked at runtime. + + + + Runtime matcher + + The runtime matcher is the one that will actually perform evaluation + when the test is run, and is defined by convention to have the + same signature as the compiler matcher, but where the return + value is the first argument to the call, which contains the + object received by the actual invocation at runtime: + + public static bool Contains(IEnumerable<Order> orders, Order order) + { + return orders.Contains(order); + } + + At runtime, the mocked method will be invoked with a specific + list of orders. This value will be passed to this runtime + matcher as the first argument, while the second argument is the + one specified in the setup (x.Save(Orders.Contains(order))). + + The boolean returned determines whether the given argument has been + matched. If all arguments to the expected method are matched, then + the setup matches and is evaluated. + + + + + + Using this extensible infrastructure, you can easily replace the entire + set of matchers with your own. You can also avoid the + typical (and annoying) lengthy expressions that result when you have + multiple arguments that use generics. + + + The following is the complete example explained above: + + public static class Orders + { + [Matcher] + public static IEnumerable<Order> Contains(Order order) + { + return null; + } + + public static bool Contains(IEnumerable<Order> orders, Order order) + { + return orders.Contains(order); + } + } + + And the concrete test using this matcher: + + var order = new Order { ... }; + var mock = new Mock<IRepository<Order>>(); + + mock.Setup(x => x.Save(Orders.Contains(order))) + .Throws<ArgumentException>(); + + // use mock, invoke Save, and have the matcher filter. + + + + + + Provides a mock implementation of . + + Any interface type can be used for mocking, but for classes, only abstract and virtual members can be mocked. + + The behavior of the mock with regards to the setups and the actual calls is determined + by the optional that can be passed to the + constructor. + + Type to mock, which can be an interface or a class. + The following example shows establishing setups with specific values + for method invocations: + + // Arrange + var order = new Order(TALISKER, 50); + var mock = new Mock<IWarehouse>(); + + mock.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); + + // Act + order.Fill(mock.Object); + + // Assert + Assert.True(order.IsFilled); + + The following example shows how to use the class + to specify conditions for arguments instead of specific values: + + // Arrange + var order = new Order(TALISKER, 50); + var mock = new Mock<IWarehouse>(); + + // shows how to expect a value within a range + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsInRange(0, 100, Range.Inclusive))) + .Returns(false); + + // shows how to throw for unexpected calls. + mock.Setup(x => x.Remove( + It.IsAny<string>(), + It.IsAny<int>())) + .Throws(new InvalidOperationException()); + + // Act + order.Fill(mock.Object); + + // Assert + Assert.False(order.IsFilled); + + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Ctor invoked by AsTInterface exclusively. + + + + + Initializes an instance of the mock with default behavior. + + var mock = new Mock<IFormatProvider>(); + + + + + Initializes an instance of the mock with default behavior and with + the given constructor arguments for the class. (Only valid when is a class) + + The mock will try to find the best match constructor given the constructor arguments, and invoke that + to initialize the instance. This applies only for classes, not interfaces. + + var mock = new Mock<MyProvider>(someArgument, 25); + Optional constructor arguments if the mocked type is a class. + + + + Initializes an instance of the mock with the specified behavior. + + var mock = new Mock<IFormatProvider>(MockBehavior.Relaxed); + Behavior of the mock. + + + + Initializes an instance of the mock with a specific behavior with + the given constructor arguments for the class. + + The mock will try to find the best match constructor given the constructor arguments, and invoke that + to initialize the instance. This applies only to classes, not interfaces. + + var mock = new Mock<MyProvider>(someArgument, 25); + Behavior of the mock.Optional constructor arguments if the mocked type is a class. + + + + Returns the mocked object value. + + + + + Specifies a setup on the mocked type for a call to + to a void method. + + If more than one setup is specified for the same method or property, + the latest one wins and is the one that will be executed. + Lambda expression that specifies the expected method invocation. + + var mock = new Mock<IProcessor>(); + mock.Setup(x => x.Execute("ping")); + + + + + + Specifies a setup on the mocked type for a call to + to a value returning method. + Type of the return value. Typically omitted as it can be inferred from the expression. + If more than one setup is specified for the same method or property, + the latest one wins and is the one that will be executed. + Lambda expression that specifies the method invocation. + + mock.Setup(x => x.HasInventory("Talisker", 50)).Returns(true); + + + + + + Specifies a setup on the mocked type for a call to + to a property getter. + + If more than one setup is set for the same property getter, + the latest one wins and is the one that will be executed. + Type of the property. Typically omitted as it can be inferred from the expression.Lambda expression that specifies the property getter. + + mock.SetupGet(x => x.Suspended) + .Returns(true); + + + + + + Specifies a setup on the mocked type for a call to + to a property setter. + + If more than one setup is set for the same property setter, + the latest one wins and is the one that will be executed. + + This overloads allows the use of a callback already + typed for the property type. + + Type of the property. Typically omitted as it can be inferred from the expression.The Lambda expression that sets a property to a value. + + mock.SetupSet(x => x.Suspended = true); + + + + + + Specifies a setup on the mocked type for a call to + to a property setter. + + If more than one setup is set for the same property setter, + the latest one wins and is the one that will be executed. + Lambda expression that sets a property to a value. + + mock.SetupSet(x => x.Suspended = true); + + + + + + Specifies that the given property should have "property behavior", + meaning that setting its value will cause it to be saved and + later returned when the property is requested. (this is also + known as "stubbing"). + + Type of the property, inferred from the property + expression (does not need to be specified). + Property expression to stub. + If you have an interface with an int property Value, you might + stub it using the following straightforward call: + + var mock = new Mock<IHaveValue>(); + mock.Stub(v => v.Value); + + After the Stub call has been issued, setting and + retrieving the object value will behave as expected: + + IHaveValue v = mock.Object; + + v.Value = 5; + Assert.Equal(5, v.Value); + + + + + + Specifies that the given property should have "property behavior", + meaning that setting its value will cause it to be saved and + later returned when the property is requested. This overload + allows setting the initial value for the property. (this is also + known as "stubbing"). + + Type of the property, inferred from the property + expression (does not need to be specified). + Property expression to stub.Initial value for the property. + If you have an interface with an int property Value, you might + stub it using the following straightforward call: + + var mock = new Mock<IHaveValue>(); + mock.SetupProperty(v => v.Value, 5); + + After the SetupProperty call has been issued, setting and + retrieving the object value will behave as expected: + + IHaveValue v = mock.Object; + // Initial value was stored + Assert.Equal(5, v.Value); + + // New value set which changes the initial value + v.Value = 6; + Assert.Equal(6, v.Value); + + + + + + Specifies that the all properties on the mock should have "property behavior", + meaning that setting its value will cause it to be saved and + later returned when the property is requested. (this is also + known as "stubbing"). The default value for each property will be the + one generated as specified by the property for the mock. + + If the mock is set to , + the mocked default values will also get all properties setup recursively. + + + + + + + + Verifies that a specific invocation matching the given expression was performed on the mock. Use + in conjuntion with the default . + + This example assumes that the mock has been used, and later we want to verify that a given + invocation with specific parameters was performed: + + var mock = new Mock<IProcessor>(); + // exercise mock + //... + // Will throw if the test code didn't call Execute with a "ping" string argument. + mock.Verify(proc => proc.Execute("ping")); + + The invocation was not performed on the mock.Expression to verify. + + + + Verifies that a specific invocation matching the given expression was performed on the mock. Use + in conjuntion with the default . + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called. + + + + Verifies that a specific invocation matching the given expression was performed on the mock, + specifying a failure error message. Use in conjuntion with the default + . + + This example assumes that the mock has been used, and later we want to verify that a given + invocation with specific parameters was performed: + + var mock = new Mock<IProcessor>(); + // exercise mock + //... + // Will throw if the test code didn't call Execute with a "ping" string argument. + mock.Verify(proc => proc.Execute("ping")); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. + + + + Verifies that a specific invocation matching the given expression was performed on the mock, + specifying a failure error message. Use in conjuntion with the default + . + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails. + + + + Verifies that a specific invocation matching the given expression was performed on the mock. Use + in conjuntion with the default . + + This example assumes that the mock has been used, and later we want to verify that a given + invocation with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't call HasInventory. + mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50)); + + The invocation was not performed on the mock.Expression to verify.Type of return value from the expression. + + + + Verifies that a specific invocation matching the given + expression was performed on the mock. Use in conjuntion + with the default . + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression. + + + + Verifies that a specific invocation matching the given + expression was performed on the mock, specifying a failure + error message. + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't call HasInventory. + mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50), "When filling orders, inventory has to be checked"); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.Type of return value from the expression. + + + + Verifies that a specific invocation matching the given + expression was performed on the mock, specifying a failure + error message. + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.Type of return value from the expression. + + + + Verifies that a property was read on the mock. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was retrieved from it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't retrieve the IsClosed property. + mock.VerifyGet(warehouse => warehouse.IsClosed); + + The invocation was not performed on the mock.Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was read on the mock. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was read on the mock, specifying a failure + error message. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was retrieved from it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't retrieve the IsClosed property. + mock.VerifyGet(warehouse => warehouse.IsClosed); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was read on the mock, specifying a failure + error message. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was set on the mock. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was set on it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed = true); + + The invocation was not performed on the mock.Expression to verify. + + + + Verifies that a property was set on the mock. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify. + + + + Verifies that a property was set on the mock, specifying + a failure message. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was set on it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed = true, "Warehouse should always be closed after the action"); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. + + + + Verifies that a property was set on the mock, specifying + a failure message. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. + + + + Raises the event referenced in using + the given argument. + + The argument is + invalid for the target event invocation, or the is + not an event attach or detach expression. + + The following example shows how to raise a event: + + var mock = new Mock<IViewModel>(); + + mock.Raise(x => x.PropertyChanged -= null, new PropertyChangedEventArgs("Name")); + + + This example shows how to invoke an event with a custom event arguments + class in a view that will cause its corresponding presenter to + react by changing its state: + + var mockView = new Mock<IOrdersView>(); + var presenter = new OrdersPresenter(mockView.Object); + + // Check that the presenter has no selection by default + Assert.Null(presenter.SelectedOrder); + + // Raise the event with a specific arguments data + mockView.Raise(v => v.SelectionChanged += null, new OrderEventArgs { Order = new Order("moq", 500) }); + + // Now the presenter reacted to the event, and we have a selected order + Assert.NotNull(presenter.SelectedOrder); + Assert.Equal("moq", presenter.SelectedOrder.ProductName); + + + + + + Raises the event referenced in using + the given argument for a non-EventHandler typed event. + + The arguments are + invalid for the target event invocation, or the is + not an event attach or detach expression. + + The following example shows how to raise a custom event that does not adhere to + the standard EventHandler: + + var mock = new Mock<IViewModel>(); + + mock.Raise(x => x.MyEvent -= null, "Name", bool, 25); + + + + + + Exposes the mocked object instance. + + + + + Provides legacy API members as extensions so that + existing code continues to compile, but new code + doesn't see then. + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Provides additional methods on mocks. + + + Provided as extension methods as they confuse the compiler + with the overloads taking Action. + + + + + Specifies a setup on the mocked type for a call to + to a property setter, regardless of its value. + + + If more than one setup is set for the same property setter, + the latest one wins and is the one that will be executed. + + Type of the property. Typically omitted as it can be inferred from the expression. + Type of the mock. + The target mock for the setup. + Lambda expression that specifies the property setter. + + + mock.SetupSet(x => x.Suspended); + + + + This method is not legacy, but must be on an extension method to avoid + confusing the compiler with the new Action syntax. + + + + + Verifies that a property has been set on the mock, regarless of its value. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + Expression to verify. + The mock instance. + Mocked type. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Verifies that a property has been set on the mock, specifying a failure + error message. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + Expression to verify. + Message to show if verification fails. + The mock instance. + Mocked type. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Verifies that a property has been set on the mock, regardless + of the value but only the specified number of times. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + The invocation was not call the times specified by + . + The mock instance. + Mocked type. + The number of times a method is allowed to be called. + Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Verifies that a property has been set on the mock, regardless + of the value but only the specified number of times, and specifying a failure + error message. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + The invocation was not call the times specified by + . + The mock instance. + Mocked type. + The number of times a method is allowed to be called. + Message to show if verification fails. + Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Helper for sequencing return values in the same method. + + + + + Return a sequence of values, once per call. + + + + + Casts the expression to a lambda expression, removing + a cast if there's any. + + + + + Casts the body of the lambda expression to a . + + If the body is not a method call. + + + + Converts the body of the lambda expression into the referenced by it. + + + + + Checks whether the body of the lambda expression is a property access. + + + + + Checks whether the expression is a property access. + + + + + Checks whether the body of the lambda expression is a property indexer, which is true + when the expression is an whose + has + equal to . + + + + + Checks whether the expression is a property indexer, which is true + when the expression is an whose + has + equal to . + + + + + Creates an expression that casts the given expression to the + type. + + + + + TODO: remove this code when https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=331583 + is fixed. + + + + + Provides partial evaluation of subtrees, whenever they can be evaluated locally. + + Matt Warren: http://blogs.msdn.com/mattwar + Documented by InSTEDD: http://www.instedd.org + + + + Performs evaluation and replacement of independent sub-trees + + The root of the expression tree. + A function that decides whether a given expression + node can be part of the local function. + A new tree with sub-trees evaluated and replaced. + + + + Performs evaluation and replacement of independent sub-trees + + The root of the expression tree. + A new tree with sub-trees evaluated and replaced. + + + + Evaluates and replaces sub-trees when first candidate is reached (top-down) + + + + + Performs bottom-up analysis to determine which nodes can possibly + be part of an evaluated sub-tree. + + + + + Ensures the given is not null. + Throws otherwise. + + + + + Ensures the given string is not null or empty. + Throws in the first case, or + in the latter. + + + + + Checks an argument to ensure it is in the specified range including the edges. + + Type of the argument to check, it must be an type. + + The expression containing the name of the argument. + The argument value to check. + The minimun allowed value for the argument. + The maximun allowed value for the argument. + + + + Checks an argument to ensure it is in the specified range excluding the edges. + + Type of the argument to check, it must be an type. + + The expression containing the name of the argument. + The argument value to check. + The minimun allowed value for the argument. + The maximun allowed value for the argument. + + + + Implemented by all generated mock object instances. + + + + + Implemented by all generated mock object instances. + + + + + Reference the Mock that contains this as the mock.Object value. + + + + + Reference the Mock that contains this as the mock.Object value. + + + + + Implements the actual interception and method invocation for + all mocks. + + + + + Get an eventInfo for a given event name. Search type ancestors depth first if necessary. + + Name of the event, with the set_ or get_ prefix already removed + + + + Given a type return all of its ancestors, both types and interfaces. + + The type to find immediate ancestors of + + + + Implements the fluent API. + + + + + Defines the Callback verb for property setter setups. + + Type of the property. + + + + Specifies a callback to invoke when the property is set that receives the + property value being set. + + Callback method to invoke. + + Invokes the given callback with the property value being set. + + mock.SetupSet(x => x.Suspended) + .Callback((bool state) => Console.WriteLine(state)); + + + + + + Allows the specification of a matching condition for an + argument in a method invocation, rather than a specific + argument value. "It" refers to the argument being matched. + + This class allows the setup to match a method invocation + with an arbitrary value, with a value in a specified range, or + even one that matches a given predicate. + + + + + Matches any value of the given type. + + Typically used when the actual argument value for a method + call is not relevant. + + + // Throws an exception for a call to Remove with any string value. + mock.Setup(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException()); + + Type of the value. + + + + Matches any value that satisfies the given predicate. + Type of the argument to check.The predicate used to match the method argument. + Allows the specification of a predicate to perform matching + of method call arguments. + + This example shows how to return the value 1 whenever the argument to the + Do method is an even number. + + mock.Setup(x => x.Do(It.Is<int>(i => i % 2 == 0))) + .Returns(1); + + This example shows how to throw an exception if the argument to the + method is a negative number: + + mock.Setup(x => x.GetUser(It.Is<int>(i => i < 0))) + .Throws(new ArgumentException()); + + + + + + Matches any value that is in the range specified. + Type of the argument to check.The lower bound of the range.The upper bound of the range. + The kind of range. See . + + The following example shows how to expect a method call + with an integer argument within the 0..100 range. + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsInRange(0, 100, Range.Inclusive))) + .Returns(false); + + + + + + Matches a string argument if it matches the given regular expression pattern. + The pattern to use to match the string argument value. + The following example shows how to expect a call to a method where the + string argument matches the given regular expression: + + mock.Setup(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1); + + + + + + Matches a string argument if it matches the given regular expression pattern. + The pattern to use to match the string argument value.The options used to interpret the pattern. + The following example shows how to expect a call to a method where the + string argument matches the given regular expression, in a case insensitive way: + + mock.Setup(x => x.Check(It.IsRegex("[a-z]+", RegexOptions.IgnoreCase))).Returns(1); + + + + + + Matcher to treat static functions as matchers. + + mock.Setup(x => x.StringMethod(A.MagicString())); + + public static class A + { + [Matcher] + public static string MagicString() { return null; } + public static bool MagicString(string arg) + { + return arg == "magic"; + } + } + + Will succeed if: mock.Object.StringMethod("magic"); + and fail with any other call. + + + + + Options to customize the behavior of the mock. + + + + + Causes the mock to always throw + an exception for invocations that don't have a + corresponding setup. + + + + + Will never throw exceptions, returning default + values when necessary (null for reference types, + zero for value types or empty enumerables and arrays). + + + + + Default mock behavior, which equals . + + + + + Exception thrown by mocks when setups are not matched, + the mock is not properly setup, etc. + + + A distinct exception type is provided so that exceptions + thrown by the mock can be differentiated in tests that + expect other exceptions to be thrown (i.e. ArgumentException). + + Richer exception hierarchy/types are not provided as + tests typically should not catch or expect exceptions + from the mocks. These are typically the result of changes + in the tested class or its collaborators implementation, and + result in fixes in the mock setup so that they dissapear and + allow the test to pass. + + + + + + Supports the serialization infrastructure. + + Serialization information. + Streaming context. + + + + Supports the serialization infrastructure. + + Serialization information. + Streaming context. + + + + Made internal as it's of no use for + consumers, but it's important for + our own tests. + + + + + Used by the mock factory to accumulate verification + failures. + + + + + Supports the serialization infrastructure. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Mock type has already been initialized by accessing its Object property. Adding interfaces must be done before that.. + + + + + Looks up a localized string similar to Value cannot be an empty string.. + + + + + Looks up a localized string similar to Can only add interfaces to the mock.. + + + + + Looks up a localized string similar to Can't set return value for void method {0}.. + + + + + Looks up a localized string similar to Constructor arguments cannot be passed for interface mocks.. + + + + + Looks up a localized string similar to A matching constructor for the given arguments was not found on the mocked type.. + + + + + Looks up a localized string similar to Could not locate event for attach or detach method {0}.. + + + + + Looks up a localized string similar to Expression {0} involves a field access, which is not supported. Use properties instead.. + + + + + Looks up a localized string similar to Type to mock must be an interface or an abstract or non-sealed class. . + + + + + Looks up a localized string similar to Cannot retrieve a mock with the given object type {0} as it's not the main type of the mock or any of its additional interfaces. + Please cast the argument to one of the supported types: {1}. + Remember that there's no generics covariance in the CLR, so your object must be one of these types in order for the call to succeed.. + + + + + Looks up a localized string similar to The equals ("==" or "=" in VB) and the conditional 'and' ("&&" or "AndAlso" in VB) operators are the only ones supported in the query specification expression. Unsupported expression: {0}. + + + + + Looks up a localized string similar to LINQ method '{0}' not supported.. + + + + + Looks up a localized string similar to Expression contains a call to a method which is not virtual (overridable in VB) or abstract. Unsupported expression: {0}. + + + + + Looks up a localized string similar to Member {0}.{1} does not exist.. + + + + + Looks up a localized string similar to Method {0}.{1} is public. Use strong-typed Expect overload instead: + mock.Setup(x => x.{1}()); + . + + + + + Looks up a localized string similar to {0} invocation failed with mock behavior {1}. + {2}. + + + + + Looks up a localized string similar to Expected only {0} calls to {1}.. + + + + + Looks up a localized string similar to Expected only one call to {0}.. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at least {2} times, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at least once, but was never performed: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at most {3} times, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at most once, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock between {2} and {3} times (Exclusive), but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock between {2} and {3} times (Inclusive), but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock exactly {2} times, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock should never have been performed, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock once, but was {4} times: {1}. + + + + + Looks up a localized string similar to All invocations on the mock must have a corresponding setup.. + + + + + Looks up a localized string similar to Object instance was not created by Moq.. + + + + + Looks up a localized string similar to Out expression must evaluate to a constant value.. + + + + + Looks up a localized string similar to Property {0}.{1} does not have a getter.. + + + + + Looks up a localized string similar to Property {0}.{1} does not exist.. + + + + + Looks up a localized string similar to Property {0}.{1} is write-only.. + + + + + Looks up a localized string similar to Property {0}.{1} is read-only.. + + + + + Looks up a localized string similar to Property {0}.{1} does not have a setter.. + + + + + Looks up a localized string similar to Cannot raise a mocked event unless it has been associated (attached) to a concrete event in a mocked object.. + + + + + Looks up a localized string similar to Ref expression must evaluate to a constant value.. + + + + + Looks up a localized string similar to Invocation needs to return a value and therefore must have a corresponding setup that provides it.. + + + + + Looks up a localized string similar to A lambda expression is expected as the argument to It.Is<T>.. + + + + + Looks up a localized string similar to Invocation {0} should not have been made.. + + + + + Looks up a localized string similar to Expression is not a method invocation: {0}. + + + + + Looks up a localized string similar to Expression is not a property access: {0}. + + + + + Looks up a localized string similar to Expression is not a property setter invocation.. + + + + + Looks up a localized string similar to Expression references a method that does not belong to the mocked object: {0}. + + + + + Looks up a localized string similar to Invalid setup on a non-virtual (overridable in VB) member: {0}. + + + + + Looks up a localized string similar to Type {0} does not implement required interface {1}. + + + + + Looks up a localized string similar to Type {0} does not from required type {1}. + + + + + Looks up a localized string similar to To specify a setup for public property {0}.{1}, use the typed overloads, such as: + mock.Setup(x => x.{1}).Returns(value); + mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one + mock.SetupSet(x => x.{1}).Callback(callbackDelegate); + . + + + + + Looks up a localized string similar to Unsupported expression: {0}. + + + + + Looks up a localized string similar to Only property accesses are supported in intermediate invocations on a setup. Unsupported expression {0}.. + + + + + Looks up a localized string similar to Expression contains intermediate property access {0}.{1} which is of type {2} and cannot be mocked. Unsupported expression {3}.. + + + + + Looks up a localized string similar to Setter expression cannot use argument matchers that receive parameters.. + + + + + Looks up a localized string similar to Member {0} is not supported for protected mocking.. + + + + + Looks up a localized string similar to Setter expression can only use static custom matchers.. + + + + + Looks up a localized string similar to The following setups were not matched: + {0}. + + + + + Looks up a localized string similar to Invalid verify on a non-virtual (overridable in VB) member: {0}. + + + + + Allows setups to be specified for protected members by using their + name as a string, rather than strong-typing them which is not possible + due to their visibility. + + + + + Specifies a setup for a void method invocation with the given + , optionally specifying arguments for the method call. + + The name of the void method to be invoked. + The optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + + + + Specifies a setup for an invocation on a property or a non void method with the given + , optionally specifying arguments for the method call. + + The name of the method or property to be invoked. + The optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + The return type of the method or property. + + + + Specifies a setup for an invocation on a property getter with the given + . + + The name of the property. + The type of the property. + + + + Specifies a setup for an invocation on a property setter with the given + . + + The name of the property. + The property value. If argument matchers are used, + remember to use rather than . + The type of the property. + + + + Specifies a verify for a void method with the given , + optionally specifying arguments for the method call. Use in conjuntion with the default + . + + The invocation was not call the times specified by + . + The name of the void method to be verified. + The number of times a method is allowed to be called. + The optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + + + + Specifies a verify for an invocation on a property or a non void method with the given + , optionally specifying arguments for the method call. + + The invocation was not call the times specified by + . + The name of the method or property to be invoked. + The optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + The number of times a method is allowed to be called. + The type of return value from the expression. + + + + Specifies a verify for an invocation on a property getter with the given + . + The invocation was not call the times specified by + . + + The name of the property. + The number of times a method is allowed to be called. + The type of the property. + + + + Specifies a setup for an invocation on a property setter with the given + . + + The invocation was not call the times specified by + . + The name of the property. + The number of times a method is allowed to be called. + The property value. + The type of the property. If argument matchers are used, + remember to use rather than . + + + + Allows the specification of a matching condition for an + argument in a protected member setup, rather than a specific + argument value. "ItExpr" refers to the argument being matched. + + + Use this variant of argument matching instead of + for protected setups. + This class allows the setup to match a method invocation + with an arbitrary value, with a value in a specified range, or + even one that matches a given predicate, or null. + + + + + Matches a null value of the given type. + + + Required for protected mocks as the null value cannot be used + directly as it prevents proper method overload selection. + + + + // Throws an exception for a call to Remove with a null string value. + mock.Protected() + .Setup("Remove", ItExpr.IsNull<string>()) + .Throws(new InvalidOperationException()); + + + Type of the value. + + + + Matches any value of the given type. + + + Typically used when the actual argument value for a method + call is not relevant. + + + + // Throws an exception for a call to Remove with any string value. + mock.Protected() + .Setup("Remove", ItExpr.IsAny<string>()) + .Throws(new InvalidOperationException()); + + + Type of the value. + + + + Matches any value that satisfies the given predicate. + + Type of the argument to check. + The predicate used to match the method argument. + + Allows the specification of a predicate to perform matching + of method call arguments. + + + This example shows how to return the value 1 whenever the argument to the + Do method is an even number. + + mock.Protected() + .Setup("Do", ItExpr.Is<int>(i => i % 2 == 0)) + .Returns(1); + + This example shows how to throw an exception if the argument to the + method is a negative number: + + mock.Protected() + .Setup("GetUser", ItExpr.Is<int>(i => i < 0)) + .Throws(new ArgumentException()); + + + + + + Matches any value that is in the range specified. + + Type of the argument to check. + The lower bound of the range. + The upper bound of the range. + The kind of range. See . + + The following example shows how to expect a method call + with an integer argument within the 0..100 range. + + mock.Protected() + .Setup("HasInventory", + ItExpr.IsAny<string>(), + ItExpr.IsInRange(0, 100, Range.Inclusive)) + .Returns(false); + + + + + + Matches a string argument if it matches the given regular expression pattern. + + The pattern to use to match the string argument value. + + The following example shows how to expect a call to a method where the + string argument matches the given regular expression: + + mock.Protected() + .Setup("Check", ItExpr.IsRegex("[a-z]+")) + .Returns(1); + + + + + + Matches a string argument if it matches the given regular expression pattern. + + The pattern to use to match the string argument value. + The options used to interpret the pattern. + + The following example shows how to expect a call to a method where the + string argument matches the given regular expression, in a case insensitive way: + + mock.Protected() + .Setup("Check", ItExpr.IsRegex("[a-z]+", RegexOptions.IgnoreCase)) + .Returns(1); + + + + + + Enables the Protected() method on , + allowing setups to be set for protected members by using their + name as a string, rather than strong-typing them which is not possible + due to their visibility. + + + + + Enable protected setups for the mock. + + Mocked object type. Typically omitted as it can be inferred from the mock instance. + The mock to set the protected setups on. + + + + + + + + + + + + Kind of range to use in a filter specified through + . + + + + + The range includes the to and + from values. + + + + + The range does not include the to and + from values. + + + + + Determines the way default values are generated + calculated for loose mocks. + + + + + Default behavior, which generates empty values for + value types (i.e. default(int)), empty array and + enumerables, and nulls for all other reference types. + + + + + Whenever the default value generated by + is null, replaces this value with a mock (if the type + can be mocked). + + + For sealed classes, a null value will be generated. + + + + + A default implementation of IQueryable for use with QueryProvider + + + + + The is a + static method that returns an IQueryable of Mocks of T which is used to + apply the linq specification to. + + + + + Allows creation custom value matchers that can be used on setups and verification, + completely replacing the built-in class with your own argument + matching rules. + + See also . + + + + + Provided for the sole purpose of rendering the delegate passed to the + matcher constructor if no friendly render lambda is provided. + + + + + Initializes the match with the condition that + will be checked in order to match invocation + values. + The condition to match against actual values. + + + + + + + + + This method is used to set an expression as the last matcher invoked, + which is used in the SetupSet to allow matchers in the prop = value + delegate expression. This delegate is executed in "fluent" mode in + order to capture the value being set, and construct the corresponding + methodcall. + This is also used in the MatcherFactory for each argument expression. + This method ensures that when we execute the delegate, we + also track the matcher that was invoked, so that when we create the + methodcall we build the expression using it, rather than the null/default + value returned from the actual invocation. + + + + + Allows creation custom value matchers that can be used on setups and verification, + completely replacing the built-in class with your own argument + matching rules. + Type of the value to match. + The argument matching is used to determine whether a concrete + invocation in the mock matches a given setup. This + matching mechanism is fully extensible. + + Creating a custom matcher is straightforward. You just need to create a method + that returns a value from a call to with + your matching condition and optional friendly render expression: + + [Matcher] + public Order IsBigOrder() + { + return Match<Order>.Create( + o => o.GrandTotal >= 5000, + /* a friendly expression to render on failures */ + () => IsBigOrder()); + } + + This method can be used in any mock setup invocation: + + mock.Setup(m => m.Submit(IsBigOrder()).Throws<UnauthorizedAccessException>(); + + At runtime, Moq knows that the return value was a matcher (note that the method MUST be + annotated with the [Matcher] attribute in order to determine this) and + evaluates your predicate with the actual value passed into your predicate. + + Another example might be a case where you want to match a lists of orders + that contains a particular one. You might create matcher like the following: + + + public static class Orders + { + [Matcher] + public static IEnumerable<Order> Contains(Order order) + { + return Match<IEnumerable<Order>>.Create(orders => orders.Contains(order)); + } + } + + Now we can invoke this static method instead of an argument in an + invocation: + + var order = new Order { ... }; + var mock = new Mock<IRepository<Order>>(); + + mock.Setup(x => x.Save(Orders.Contains(order))) + .Throws<ArgumentException>(); + + + + + + Tracks the current mock and interception context. + + + + + Having an active fluent mock context means that the invocation + is being performed in "trial" mode, just to gather the + target method and arguments that need to be matched later + when the actual invocation is made. + + + + + A that returns an empty default value + for non-mockeable types, and mocks for all other types (interfaces and + non-sealed classes) that can be mocked. + + + + + Allows querying the universe of mocks for those that behave + according to the LINQ query specification. + + + This entry-point into Linq to Mocks is the only one in the root Moq + namespace to ease discovery. But to get all the mocking extension + methods on Object, a using of Moq.Linq must be done, so that the + polluting of the intellisense for all objects is an explicit opt-in. + + + + + Access the universe of mocks of the given type, to retrieve those + that behave according to the LINQ query specification. + + The type of the mocked object to query. + + + + Access the universe of mocks of the given type, to retrieve those + that behave according to the LINQ query specification. + + The predicate with the setup expressions. + The type of the mocked object to query. + + + + Creates an mock object of the indicated type. + + The type of the mocked object. + The mocked object created. + + + + Creates an mock object of the indicated type. + + The predicate with the setup expressions. + The type of the mocked object. + The mocked object created. + + + + Creates the mock query with the underlying queriable implementation. + + + + + Wraps the enumerator inside a queryable. + + + + + Method that is turned into the actual call from .Query{T}, to + transform the queryable query into a normal enumerable query. + This method is never used directly by consumers. + + + + + Extension method used to support Linq-like setup properties that are not virtual but do have + a getter and a setter, thereby allowing the use of Linq to Mocks to quickly initialize Dtos too :) + + + + + Helper extensions that are used by the query translator. + + + + + Retrieves a fluent mock from the given setup expression. + + + + + Defines the number of invocations allowed by a mocked method. + + + + + Specifies that a mocked method should be invoked times as minimum. + The minimun number of times.An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked one time as minimum. + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked time as maximun. + The maximun number of times.An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked one time as maximun. + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked between and + times. + The minimun number of times.The maximun number of times. + The kind of range. See . + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked exactly times. + The times that a method or property can be called.An object defining the allowed number of invocations. + + + + Specifies that a mocked method should not be invoked. + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked exactly one time. + An object defining the allowed number of invocations. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether two specified objects have the same value. + + The first . + + The second . + + true if the value of left is the same as the value of right; otherwise, false. + + + + + Determines whether two specified objects have different values. + + The first . + + The second . + + true if the value of left is different from the value of right; otherwise, false. + + + + diff --git a/packages/Moq.4.0.10827/lib/NET40/Moq.dll b/packages/Moq.4.0.10827/lib/NET40/Moq.dll new file mode 100644 index 0000000..3a3e653 Binary files /dev/null and b/packages/Moq.4.0.10827/lib/NET40/Moq.dll differ diff --git a/packages/Moq.4.0.10827/lib/NET40/Moq.pdb b/packages/Moq.4.0.10827/lib/NET40/Moq.pdb new file mode 100644 index 0000000..03cca56 Binary files /dev/null and b/packages/Moq.4.0.10827/lib/NET40/Moq.pdb differ diff --git a/packages/Moq.4.0.10827/lib/NET40/Moq.xml b/packages/Moq.4.0.10827/lib/NET40/Moq.xml new file mode 100644 index 0000000..e0743a6 --- /dev/null +++ b/packages/Moq.4.0.10827/lib/NET40/Moq.xml @@ -0,0 +1,5120 @@ + + + + Moq + + + + + Implements the fluent API. + + + + + The expectation will be considered only in the former condition. + + + + + + + The expectation will be considered only in the former condition. + + + + + + + + Setups the get. + + The type of the property. + The expression. + + + + + Setups the set. + + The type of the property. + The setter expression. + + + + + Setups the set. + + The setter expression. + + + + + Defines the Callback verb and overloads. + + + + + Helper interface used to hide the base + members from the fluent API to make it much cleaner + in Visual Studio intellisense. + + + + + + + + + + + + + + + + + Specifies a callback to invoke when the method is called. + + The callback method to invoke. + + The following example specifies a callback to set a boolean + value that can be used later: + + var called = false; + mock.Setup(x => x.Execute()) + .Callback(() => called = true); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The argument type of the invoked method. + The callback method to invoke. + + Invokes the given callback with the concrete invocation argument value. + + Notice how the specific string argument is retrieved by simply declaring + it as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute(It.IsAny<string>())) + .Callback((string command) => Console.WriteLine(command)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3) => Console.WriteLine(arg1 + arg2 + arg3)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The type of the sixteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16)); + + + + + + Defines the Callback verb and overloads for callbacks on + setups that return a value. + + Mocked type. + Type of the return value of the setup. + + + + Specifies a callback to invoke when the method is called. + + The callback method to invoke. + + The following example specifies a callback to set a boolean value that can be used later: + + var called = false; + mock.Setup(x => x.Execute()) + .Callback(() => called = true) + .Returns(true); + + Note that in the case of value-returning methods, after the Callback + call you can still specify the return value. + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the argument of the invoked method. + Callback method to invoke. + + Invokes the given callback with the concrete invocation argument value. + + Notice how the specific string argument is retrieved by simply declaring + it as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute(It.IsAny<string>())) + .Callback(command => Console.WriteLine(command)) + .Returns(true); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2) => Console.WriteLine(arg1 + arg2)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3) => Console.WriteLine(arg1 + arg2 + arg3)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The type of the sixteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16)); + + + + + + Defines the Raises verb. + + + + + Specifies the event that will be raised + when the setup is met. + + An expression that represents an event attach or detach action. + The event arguments to pass for the raised event. + + The following example shows how to raise an event when + the setup is met: + + var mock = new Mock<IContainer>(); + + mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>())) + .Raises(add => add.Added += null, EventArgs.Empty); + + + + + + Specifies the event that will be raised + when the setup is matched. + + An expression that represents an event attach or detach action. + A function that will build the + to pass when raising the event. + + + + + Specifies the custom event that will be raised + when the setup is matched. + + An expression that represents an event attach or detach action. + The arguments to pass to the custom delegate (non EventHandler-compatible). + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + The type of the thirteenth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + The type of the thirteenth argument received by the expected invocation. + The type of the fourteenth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + The type of the thirteenth argument received by the expected invocation. + The type of the fourteenth argument received by the expected invocation. + The type of the fifteenth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + The type of the thirteenth argument received by the expected invocation. + The type of the fourteenth argument received by the expected invocation. + The type of the fifteenth argument received by the expected invocation. + The type of the sixteenth argument received by the expected invocation. + + + + + Defines the Returns verb. + + Mocked type. + Type of the return value from the expression. + + + + Specifies the value to return. + + The value to return, or . + + Return a true value from the method call: + + mock.Setup(x => x.Execute("ping")) + .Returns(true); + + + + + + Specifies a function that will calculate the value to return from the method. + + The function that will calculate the return value. + + Return a calculated value when the method is called: + + mock.Setup(x => x.Execute("ping")) + .Returns(() => returnValues[0]); + + The lambda expression to retrieve the return value is lazy-executed, + meaning that its value may change depending on the moment the method + is executed and the value the returnValues array has at + that moment. + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the argument of the invoked method. + The function that will calculate the return value. + + Return a calculated value which is evaluated lazily at the time of the invocation. + + The lookup list can change between invocations and the setup + will return different values accordingly. Also, notice how the specific + string argument is retrieved by simply declaring it as part of the lambda + expression: + + + mock.Setup(x => x.Execute(It.IsAny<string>())) + .Returns((string command) => returnValues[command]); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2) => arg1 + arg2); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3) => arg1 + arg2 + arg3); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4) => arg1 + arg2 + arg3 + arg4); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5) => arg1 + arg2 + arg3 + arg4 + arg5); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The type of the sixteenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16); + + + + + + Language for ReturnSequence + + + + + Returns value + + + + + Throws an exception + + + + + Throws an exception + + + + + The first method call or member access will be the + last segment of the expression (depth-first traversal), + which is the one we have to Setup rather than FluentMock. + And the last one is the one we have to Mock.Get rather + than FluentMock. + + + + + Base class for mocks and static helper class with methods that + apply to mocked objects, such as to + retrieve a from an object instance. + + + + + Creates an mock object of the indicated type. + + The type of the mocked object. + The mocked object created. + + + + Creates an mock object of the indicated type. + + The predicate with the specification of how the mocked object should behave. + The type of the mocked object. + The mocked object created. + + + + Initializes a new instance of the class. + + + + + Retrieves the mock object for the given object instance. + + Type of the mock to retrieve. Can be omitted as it's inferred + from the object instance passed in as the instance. + The instance of the mocked object.The mock associated with the mocked object. + The received instance + was not created by Moq. + + The following example shows how to add a new setup to an object + instance which is not the original but rather + the object associated with it: + + // Typed instance, not the mock, is retrieved from some test API. + HttpContextBase context = GetMockContext(); + + // context.Request is the typed object from the "real" API + // so in order to add a setup to it, we need to get + // the mock that "owns" it + Mock<HttpRequestBase> request = Mock.Get(context.Request); + mock.Setup(req => req.AppRelativeCurrentExecutionFilePath) + .Returns(tempUrl); + + + + + + Returns the mocked object value. + + + + + Verifies that all verifiable expectations have been met. + + This example sets up an expectation and marks it as verifiable. After + the mock is used, a Verify() call is issued on the mock + to ensure the method in the setup was invoked: + + var mock = new Mock<IWarehouse>(); + this.Setup(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true); + ... + // other test code + ... + // Will throw if the test code has didn't call HasInventory. + this.Verify(); + + Not all verifiable expectations were met. + + + + Verifies all expectations regardless of whether they have + been flagged as verifiable. + + This example sets up an expectation without marking it as verifiable. After + the mock is used, a call is issued on the mock + to ensure that all expectations are met: + + var mock = new Mock<IWarehouse>(); + this.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); + ... + // other test code + ... + // Will throw if the test code has didn't call HasInventory, even + // that expectation was not marked as verifiable. + this.VerifyAll(); + + At least one expectation was not met. + + + + Gets the interceptor target for the given expression and root mock, + building the intermediate hierarchy of mock objects if necessary. + + + + + Raises the associated event with the given + event argument data. + + + + + Raises the associated event with the given + event argument data. + + + + + Adds an interface implementation to the mock, + allowing setups to be specified for it. + + This method can only be called before the first use + of the mock property, at which + point the runtime type has already been generated + and no more interfaces can be added to it. + + Also, must be an + interface and not a class, which must be specified + when creating the mock instead. + + + The mock type + has already been generated by accessing the property. + + The specified + is not an interface. + + The following example creates a mock for the main interface + and later adds to it to verify + it's called by the consumer code: + + var mock = new Mock<IProcessor>(); + mock.Setup(x => x.Execute("ping")); + + // add IDisposable interface + var disposable = mock.As<IDisposable>(); + disposable.Setup(d => d.Dispose()).Verifiable(); + + Type of interface to cast the mock to. + + + + + + + Behavior of the mock, according to the value set in the constructor. + + + + + Whether the base member virtual implementation will be called + for mocked classes if no setup is matched. Defaults to . + + + + + Specifies the behavior to use when returning default values for + unexpected invocations on loose mocks. + + + + + Gets the mocked object instance. + + + + + Retrieves the type of the mocked object, its generic type argument. + This is used in the auto-mocking of hierarchy access. + + + + + Specifies the class that will determine the default + value to return when invocations are made that + have no setups and need to return a default + value (for loose mocks). + + + + + Exposes the list of extra interfaces implemented by the mock. + + + + + Utility repository class to use to construct multiple + mocks when consistent verification is + desired for all of them. + + + If multiple mocks will be created during a test, passing + the desired (if different than the + or the one + passed to the repository constructor) and later verifying each + mock can become repetitive and tedious. + + This repository class helps in that scenario by providing a + simplified creation of multiple mocks with a default + (unless overriden by calling + ) and posterior verification. + + + + The following is a straightforward example on how to + create and automatically verify strict mocks using a : + + var repository = new MockRepository(MockBehavior.Strict); + + var foo = repository.Create<IFoo>(); + var bar = repository.Create<IBar>(); + + // no need to call Verifiable() on the setup + // as we'll be validating all of them anyway. + foo.Setup(f => f.Do()); + bar.Setup(b => b.Redo()); + + // exercise the mocks here + + repository.VerifyAll(); + // At this point all setups are already checked + // and an optional MockException might be thrown. + // Note also that because the mocks are strict, any invocation + // that doesn't have a matching setup will also throw a MockException. + + The following examples shows how to setup the repository + to create loose mocks and later verify only verifiable setups: + + var repository = new MockRepository(MockBehavior.Loose); + + var foo = repository.Create<IFoo>(); + var bar = repository.Create<IBar>(); + + // this setup will be verified when we verify the repository + foo.Setup(f => f.Do()).Verifiable(); + + // this setup will NOT be verified + foo.Setup(f => f.Calculate()); + + // this setup will be verified when we verify the repository + bar.Setup(b => b.Redo()).Verifiable(); + + // exercise the mocks here + // note that because the mocks are Loose, members + // called in the interfaces for which no matching + // setups exist will NOT throw exceptions, + // and will rather return default values. + + repository.Verify(); + // At this point verifiable setups are already checked + // and an optional MockException might be thrown. + + The following examples shows how to setup the repository with a + default strict behavior, overriding that default for a + specific mock: + + var repository = new MockRepository(MockBehavior.Strict); + + // this particular one we want loose + var foo = repository.Create<IFoo>(MockBehavior.Loose); + var bar = repository.Create<IBar>(); + + // specify setups + + // exercise the mocks here + + repository.Verify(); + + + + + + + Utility factory class to use to construct multiple + mocks when consistent verification is + desired for all of them. + + + If multiple mocks will be created during a test, passing + the desired (if different than the + or the one + passed to the factory constructor) and later verifying each + mock can become repetitive and tedious. + + This factory class helps in that scenario by providing a + simplified creation of multiple mocks with a default + (unless overriden by calling + ) and posterior verification. + + + + The following is a straightforward example on how to + create and automatically verify strict mocks using a : + + var factory = new MockFactory(MockBehavior.Strict); + + var foo = factory.Create<IFoo>(); + var bar = factory.Create<IBar>(); + + // no need to call Verifiable() on the setup + // as we'll be validating all of them anyway. + foo.Setup(f => f.Do()); + bar.Setup(b => b.Redo()); + + // exercise the mocks here + + factory.VerifyAll(); + // At this point all setups are already checked + // and an optional MockException might be thrown. + // Note also that because the mocks are strict, any invocation + // that doesn't have a matching setup will also throw a MockException. + + The following examples shows how to setup the factory + to create loose mocks and later verify only verifiable setups: + + var factory = new MockFactory(MockBehavior.Loose); + + var foo = factory.Create<IFoo>(); + var bar = factory.Create<IBar>(); + + // this setup will be verified when we verify the factory + foo.Setup(f => f.Do()).Verifiable(); + + // this setup will NOT be verified + foo.Setup(f => f.Calculate()); + + // this setup will be verified when we verify the factory + bar.Setup(b => b.Redo()).Verifiable(); + + // exercise the mocks here + // note that because the mocks are Loose, members + // called in the interfaces for which no matching + // setups exist will NOT throw exceptions, + // and will rather return default values. + + factory.Verify(); + // At this point verifiable setups are already checked + // and an optional MockException might be thrown. + + The following examples shows how to setup the factory with a + default strict behavior, overriding that default for a + specific mock: + + var factory = new MockFactory(MockBehavior.Strict); + + // this particular one we want loose + var foo = factory.Create<IFoo>(MockBehavior.Loose); + var bar = factory.Create<IBar>(); + + // specify setups + + // exercise the mocks here + + factory.Verify(); + + + + + + + Initializes the factory with the given + for newly created mocks from the factory. + + The behavior to use for mocks created + using the factory method if not overriden + by using the overload. + + + + Creates a new mock with the default + specified at factory construction time. + + Type to mock. + A new . + + + var factory = new MockFactory(MockBehavior.Strict); + + var foo = factory.Create<IFoo>(); + // use mock on tests + + factory.VerifyAll(); + + + + + + Creates a new mock with the default + specified at factory construction time and with the + the given constructor arguments for the class. + + + The mock will try to find the best match constructor given the + constructor arguments, and invoke that to initialize the instance. + This applies only to classes, not interfaces. + + Type to mock. + Constructor arguments for mocked classes. + A new . + + + var factory = new MockFactory(MockBehavior.Default); + + var mock = factory.Create<MyBase>("Foo", 25, true); + // use mock on tests + + factory.Verify(); + + + + + + Creates a new mock with the given . + + Type to mock. + Behavior to use for the mock, which overrides + the default behavior specified at factory construction time. + A new . + + The following example shows how to create a mock with a different + behavior to that specified as the default for the factory: + + var factory = new MockFactory(MockBehavior.Strict); + + var foo = factory.Create<IFoo>(MockBehavior.Loose); + + + + + + Creates a new mock with the given + and with the the given constructor arguments for the class. + + + The mock will try to find the best match constructor given the + constructor arguments, and invoke that to initialize the instance. + This applies only to classes, not interfaces. + + Type to mock. + Behavior to use for the mock, which overrides + the default behavior specified at factory construction time. + Constructor arguments for mocked classes. + A new . + + The following example shows how to create a mock with a different + behavior to that specified as the default for the factory, passing + constructor arguments: + + var factory = new MockFactory(MockBehavior.Default); + + var mock = factory.Create<MyBase>(MockBehavior.Strict, "Foo", 25, true); + + + + + + Implements creation of a new mock within the factory. + + Type to mock. + The behavior for the new mock. + Optional arguments for the construction of the mock. + + + + Verifies all verifiable expectations on all mocks created + by this factory. + + + One or more mocks had expectations that were not satisfied. + + + + Verifies all verifiable expectations on all mocks created + by this factory. + + + One or more mocks had expectations that were not satisfied. + + + + Invokes for each mock + in , and accumulates the resulting + that might be + thrown from the action. + + The action to execute against + each mock. + + + + Whether the base member virtual implementation will be called + for mocked classes if no setup is matched. Defaults to . + + + + + Specifies the behavior to use when returning default values for + unexpected invocations on loose mocks. + + + + + Gets the mocks that have been created by this factory and + that will get verified together. + + + + + Access the universe of mocks of the given type, to retrieve those + that behave according to the LINQ query specification. + + The type of the mocked object to query. + + + + Access the universe of mocks of the given type, to retrieve those + that behave according to the LINQ query specification. + + The predicate with the setup expressions. + The type of the mocked object to query. + + + + Creates an mock object of the indicated type. + + The type of the mocked object. + The mocked object created. + + + + Creates an mock object of the indicated type. + + The predicate with the setup expressions. + The type of the mocked object. + The mocked object created. + + + + Creates the mock query with the underlying queriable implementation. + + + + + Wraps the enumerator inside a queryable. + + + + + Method that is turned into the actual call from .Query{T}, to + transform the queryable query into a normal enumerable query. + This method is never used directly by consumers. + + + + + Initializes the repository with the given + for newly created mocks from the repository. + + The behavior to use for mocks created + using the repository method if not overriden + by using the overload. + + + + A that returns an empty default value + for invocations that do not have setups or return values, with loose mocks. + This is the default behavior for a mock. + + + + + Interface to be implemented by classes that determine the + default value of non-expected invocations. + + + + + Defines the default value to return in all the methods returning . + The type of the return value.The value to set as default. + + + + Provides a value for the given member and arguments. + + The member to provide a default value for. + + + + + The intention of is to create a more readable + string representation for the failure message. + + + + + Implements the fluent API. + + + + + Defines the Throws verb. + + + + + Specifies the exception to throw when the method is invoked. + + Exception instance to throw. + + This example shows how to throw an exception when the method is + invoked with an empty string argument: + + mock.Setup(x => x.Execute("")) + .Throws(new ArgumentException()); + + + + + + Specifies the type of exception to throw when the method is invoked. + + Type of exception to instantiate and throw when the setup is matched. + + This example shows how to throw an exception when the method is + invoked with an empty string argument: + + mock.Setup(x => x.Execute("")) + .Throws<ArgumentException>(); + + + + + + Implements the fluent API. + + + + + Defines occurrence members to constraint setups. + + + + + The expected invocation can happen at most once. + + + + var mock = new Mock<ICommand>(); + mock.Setup(foo => foo.Execute("ping")) + .AtMostOnce(); + + + + + + The expected invocation can happen at most specified number of times. + + The number of times to accept calls. + + + var mock = new Mock<ICommand>(); + mock.Setup(foo => foo.Execute("ping")) + .AtMost( 5 ); + + + + + + Defines the Verifiable verb. + + + + + Marks the expectation as verifiable, meaning that a call + to will check if this particular + expectation was met. + + + The following example marks the expectation as verifiable: + + mock.Expect(x => x.Execute("ping")) + .Returns(true) + .Verifiable(); + + + + + + Marks the expectation as verifiable, meaning that a call + to will check if this particular + expectation was met, and specifies a message for failures. + + + The following example marks the expectation as verifiable: + + mock.Expect(x => x.Execute("ping")) + .Returns(true) + .Verifiable("Ping should be executed always!"); + + + + + + Implements the fluent API. + + + + + We need this non-generics base class so that + we can use from + generic code. + + + + + Implements the fluent API. + + + + + Implements the fluent API. + + + + + Implements the fluent API. + + + + + Defines the Callback verb for property getter setups. + + + Mocked type. + Type of the property. + + + + Specifies a callback to invoke when the property is retrieved. + + Callback method to invoke. + + Invokes the given callback with the property value being set. + + mock.SetupGet(x => x.Suspended) + .Callback(() => called = true) + .Returns(true); + + + + + + Implements the fluent API. + + + + + Defines the Returns verb for property get setups. + + Mocked type. + Type of the property. + + + + Specifies the value to return. + + The value to return, or . + + Return a true value from the property getter call: + + mock.SetupGet(x => x.Suspended) + .Returns(true); + + + + + + Specifies a function that will calculate the value to return for the property. + + The function that will calculate the return value. + + Return a calculated value when the property is retrieved: + + mock.SetupGet(x => x.Suspended) + .Returns(() => returnValues[0]); + + The lambda expression to retrieve the return value is lazy-executed, + meaning that its value may change depending on the moment the property + is retrieved and the value the returnValues array has at + that moment. + + + + + Implements the fluent API. + + + + + Helper class to setup a full trace between many mocks + + + + + Initialize a trace setup + + + + + Allow sequence to be repeated + + + + + define nice api + + + + + Perform an expectation in the trace. + + + + + Marks a method as a matcher, which allows complete replacement + of the built-in class with your own argument + matching rules. + + + This feature has been deprecated in favor of the new + and simpler . + + + The argument matching is used to determine whether a concrete + invocation in the mock matches a given setup. This + matching mechanism is fully extensible. + + + There are two parts of a matcher: the compiler matcher + and the runtime matcher. + + + Compiler matcher + Used to satisfy the compiler requirements for the + argument. Needs to be a method optionally receiving any arguments + you might need for the matching, but with a return type that + matches that of the argument. + + Let's say I want to match a lists of orders that contains + a particular one. I might create a compiler matcher like the following: + + + public static class Orders + { + [Matcher] + public static IEnumerable<Order> Contains(Order order) + { + return null; + } + } + + Now we can invoke this static method instead of an argument in an + invocation: + + var order = new Order { ... }; + var mock = new Mock<IRepository<Order>>(); + + mock.Setup(x => x.Save(Orders.Contains(order))) + .Throws<ArgumentException>(); + + Note that the return value from the compiler matcher is irrelevant. + This method will never be called, and is just used to satisfy the + compiler and to signal Moq that this is not a method that we want + to be invoked at runtime. + + + + Runtime matcher + + The runtime matcher is the one that will actually perform evaluation + when the test is run, and is defined by convention to have the + same signature as the compiler matcher, but where the return + value is the first argument to the call, which contains the + object received by the actual invocation at runtime: + + public static bool Contains(IEnumerable<Order> orders, Order order) + { + return orders.Contains(order); + } + + At runtime, the mocked method will be invoked with a specific + list of orders. This value will be passed to this runtime + matcher as the first argument, while the second argument is the + one specified in the setup (x.Save(Orders.Contains(order))). + + The boolean returned determines whether the given argument has been + matched. If all arguments to the expected method are matched, then + the setup matches and is evaluated. + + + + + + Using this extensible infrastructure, you can easily replace the entire + set of matchers with your own. You can also avoid the + typical (and annoying) lengthy expressions that result when you have + multiple arguments that use generics. + + + The following is the complete example explained above: + + public static class Orders + { + [Matcher] + public static IEnumerable<Order> Contains(Order order) + { + return null; + } + + public static bool Contains(IEnumerable<Order> orders, Order order) + { + return orders.Contains(order); + } + } + + And the concrete test using this matcher: + + var order = new Order { ... }; + var mock = new Mock<IRepository<Order>>(); + + mock.Setup(x => x.Save(Orders.Contains(order))) + .Throws<ArgumentException>(); + + // use mock, invoke Save, and have the matcher filter. + + + + + + Provides a mock implementation of . + + Any interface type can be used for mocking, but for classes, only abstract and virtual members can be mocked. + + The behavior of the mock with regards to the setups and the actual calls is determined + by the optional that can be passed to the + constructor. + + Type to mock, which can be an interface or a class. + The following example shows establishing setups with specific values + for method invocations: + + // Arrange + var order = new Order(TALISKER, 50); + var mock = new Mock<IWarehouse>(); + + mock.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); + + // Act + order.Fill(mock.Object); + + // Assert + Assert.True(order.IsFilled); + + The following example shows how to use the class + to specify conditions for arguments instead of specific values: + + // Arrange + var order = new Order(TALISKER, 50); + var mock = new Mock<IWarehouse>(); + + // shows how to expect a value within a range + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsInRange(0, 100, Range.Inclusive))) + .Returns(false); + + // shows how to throw for unexpected calls. + mock.Setup(x => x.Remove( + It.IsAny<string>(), + It.IsAny<int>())) + .Throws(new InvalidOperationException()); + + // Act + order.Fill(mock.Object); + + // Assert + Assert.False(order.IsFilled); + + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Ctor invoked by AsTInterface exclusively. + + + + + Initializes an instance of the mock with default behavior. + + var mock = new Mock<IFormatProvider>(); + + + + + Initializes an instance of the mock with default behavior and with + the given constructor arguments for the class. (Only valid when is a class) + + The mock will try to find the best match constructor given the constructor arguments, and invoke that + to initialize the instance. This applies only for classes, not interfaces. + + var mock = new Mock<MyProvider>(someArgument, 25); + Optional constructor arguments if the mocked type is a class. + + + + Initializes an instance of the mock with the specified behavior. + + var mock = new Mock<IFormatProvider>(MockBehavior.Relaxed); + Behavior of the mock. + + + + Initializes an instance of the mock with a specific behavior with + the given constructor arguments for the class. + + The mock will try to find the best match constructor given the constructor arguments, and invoke that + to initialize the instance. This applies only to classes, not interfaces. + + var mock = new Mock<MyProvider>(someArgument, 25); + Behavior of the mock.Optional constructor arguments if the mocked type is a class. + + + + Returns the mocked object value. + + + + + Specifies a setup on the mocked type for a call to + to a void method. + + If more than one setup is specified for the same method or property, + the latest one wins and is the one that will be executed. + Lambda expression that specifies the expected method invocation. + + var mock = new Mock<IProcessor>(); + mock.Setup(x => x.Execute("ping")); + + + + + + Specifies a setup on the mocked type for a call to + to a value returning method. + Type of the return value. Typically omitted as it can be inferred from the expression. + If more than one setup is specified for the same method or property, + the latest one wins and is the one that will be executed. + Lambda expression that specifies the method invocation. + + mock.Setup(x => x.HasInventory("Talisker", 50)).Returns(true); + + + + + + Specifies a setup on the mocked type for a call to + to a property getter. + + If more than one setup is set for the same property getter, + the latest one wins and is the one that will be executed. + Type of the property. Typically omitted as it can be inferred from the expression.Lambda expression that specifies the property getter. + + mock.SetupGet(x => x.Suspended) + .Returns(true); + + + + + + Specifies a setup on the mocked type for a call to + to a property setter. + + If more than one setup is set for the same property setter, + the latest one wins and is the one that will be executed. + + This overloads allows the use of a callback already + typed for the property type. + + Type of the property. Typically omitted as it can be inferred from the expression.The Lambda expression that sets a property to a value. + + mock.SetupSet(x => x.Suspended = true); + + + + + + Specifies a setup on the mocked type for a call to + to a property setter. + + If more than one setup is set for the same property setter, + the latest one wins and is the one that will be executed. + Lambda expression that sets a property to a value. + + mock.SetupSet(x => x.Suspended = true); + + + + + + Specifies that the given property should have "property behavior", + meaning that setting its value will cause it to be saved and + later returned when the property is requested. (this is also + known as "stubbing"). + + Type of the property, inferred from the property + expression (does not need to be specified). + Property expression to stub. + If you have an interface with an int property Value, you might + stub it using the following straightforward call: + + var mock = new Mock<IHaveValue>(); + mock.Stub(v => v.Value); + + After the Stub call has been issued, setting and + retrieving the object value will behave as expected: + + IHaveValue v = mock.Object; + + v.Value = 5; + Assert.Equal(5, v.Value); + + + + + + Specifies that the given property should have "property behavior", + meaning that setting its value will cause it to be saved and + later returned when the property is requested. This overload + allows setting the initial value for the property. (this is also + known as "stubbing"). + + Type of the property, inferred from the property + expression (does not need to be specified). + Property expression to stub.Initial value for the property. + If you have an interface with an int property Value, you might + stub it using the following straightforward call: + + var mock = new Mock<IHaveValue>(); + mock.SetupProperty(v => v.Value, 5); + + After the SetupProperty call has been issued, setting and + retrieving the object value will behave as expected: + + IHaveValue v = mock.Object; + // Initial value was stored + Assert.Equal(5, v.Value); + + // New value set which changes the initial value + v.Value = 6; + Assert.Equal(6, v.Value); + + + + + + Specifies that the all properties on the mock should have "property behavior", + meaning that setting its value will cause it to be saved and + later returned when the property is requested. (this is also + known as "stubbing"). The default value for each property will be the + one generated as specified by the property for the mock. + + If the mock is set to , + the mocked default values will also get all properties setup recursively. + + + + + + + + Verifies that a specific invocation matching the given expression was performed on the mock. Use + in conjuntion with the default . + + This example assumes that the mock has been used, and later we want to verify that a given + invocation with specific parameters was performed: + + var mock = new Mock<IProcessor>(); + // exercise mock + //... + // Will throw if the test code didn't call Execute with a "ping" string argument. + mock.Verify(proc => proc.Execute("ping")); + + The invocation was not performed on the mock.Expression to verify. + + + + Verifies that a specific invocation matching the given expression was performed on the mock. Use + in conjuntion with the default . + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called. + + + + Verifies that a specific invocation matching the given expression was performed on the mock, + specifying a failure error message. Use in conjuntion with the default + . + + This example assumes that the mock has been used, and later we want to verify that a given + invocation with specific parameters was performed: + + var mock = new Mock<IProcessor>(); + // exercise mock + //... + // Will throw if the test code didn't call Execute with a "ping" string argument. + mock.Verify(proc => proc.Execute("ping")); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. + + + + Verifies that a specific invocation matching the given expression was performed on the mock, + specifying a failure error message. Use in conjuntion with the default + . + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails. + + + + Verifies that a specific invocation matching the given expression was performed on the mock. Use + in conjuntion with the default . + + This example assumes that the mock has been used, and later we want to verify that a given + invocation with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't call HasInventory. + mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50)); + + The invocation was not performed on the mock.Expression to verify.Type of return value from the expression. + + + + Verifies that a specific invocation matching the given + expression was performed on the mock. Use in conjuntion + with the default . + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression. + + + + Verifies that a specific invocation matching the given + expression was performed on the mock, specifying a failure + error message. + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't call HasInventory. + mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50), "When filling orders, inventory has to be checked"); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.Type of return value from the expression. + + + + Verifies that a specific invocation matching the given + expression was performed on the mock, specifying a failure + error message. + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.Type of return value from the expression. + + + + Verifies that a property was read on the mock. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was retrieved from it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't retrieve the IsClosed property. + mock.VerifyGet(warehouse => warehouse.IsClosed); + + The invocation was not performed on the mock.Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was read on the mock. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was read on the mock, specifying a failure + error message. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was retrieved from it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't retrieve the IsClosed property. + mock.VerifyGet(warehouse => warehouse.IsClosed); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was read on the mock, specifying a failure + error message. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was set on the mock. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was set on it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed = true); + + The invocation was not performed on the mock.Expression to verify. + + + + Verifies that a property was set on the mock. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify. + + + + Verifies that a property was set on the mock, specifying + a failure message. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was set on it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed = true, "Warehouse should always be closed after the action"); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. + + + + Verifies that a property was set on the mock, specifying + a failure message. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. + + + + Raises the event referenced in using + the given argument. + + The argument is + invalid for the target event invocation, or the is + not an event attach or detach expression. + + The following example shows how to raise a event: + + var mock = new Mock<IViewModel>(); + + mock.Raise(x => x.PropertyChanged -= null, new PropertyChangedEventArgs("Name")); + + + This example shows how to invoke an event with a custom event arguments + class in a view that will cause its corresponding presenter to + react by changing its state: + + var mockView = new Mock<IOrdersView>(); + var presenter = new OrdersPresenter(mockView.Object); + + // Check that the presenter has no selection by default + Assert.Null(presenter.SelectedOrder); + + // Raise the event with a specific arguments data + mockView.Raise(v => v.SelectionChanged += null, new OrderEventArgs { Order = new Order("moq", 500) }); + + // Now the presenter reacted to the event, and we have a selected order + Assert.NotNull(presenter.SelectedOrder); + Assert.Equal("moq", presenter.SelectedOrder.ProductName); + + + + + + Raises the event referenced in using + the given argument for a non-EventHandler typed event. + + The arguments are + invalid for the target event invocation, or the is + not an event attach or detach expression. + + The following example shows how to raise a custom event that does not adhere to + the standard EventHandler: + + var mock = new Mock<IViewModel>(); + + mock.Raise(x => x.MyEvent -= null, "Name", bool, 25); + + + + + + Exposes the mocked object instance. + + + + + Provides legacy API members as extensions so that + existing code continues to compile, but new code + doesn't see then. + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Provides additional methods on mocks. + + + Provided as extension methods as they confuse the compiler + with the overloads taking Action. + + + + + Specifies a setup on the mocked type for a call to + to a property setter, regardless of its value. + + + If more than one setup is set for the same property setter, + the latest one wins and is the one that will be executed. + + Type of the property. Typically omitted as it can be inferred from the expression. + Type of the mock. + The target mock for the setup. + Lambda expression that specifies the property setter. + + + mock.SetupSet(x => x.Suspended); + + + + This method is not legacy, but must be on an extension method to avoid + confusing the compiler with the new Action syntax. + + + + + Verifies that a property has been set on the mock, regarless of its value. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + Expression to verify. + The mock instance. + Mocked type. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Verifies that a property has been set on the mock, specifying a failure + error message. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + Expression to verify. + Message to show if verification fails. + The mock instance. + Mocked type. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Verifies that a property has been set on the mock, regardless + of the value but only the specified number of times. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + The invocation was not call the times specified by + . + The mock instance. + Mocked type. + The number of times a method is allowed to be called. + Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Verifies that a property has been set on the mock, regardless + of the value but only the specified number of times, and specifying a failure + error message. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + The invocation was not call the times specified by + . + The mock instance. + Mocked type. + The number of times a method is allowed to be called. + Message to show if verification fails. + Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Helper for sequencing return values in the same method. + + + + + Return a sequence of values, once per call. + + + + + Casts the expression to a lambda expression, removing + a cast if there's any. + + + + + Casts the body of the lambda expression to a . + + If the body is not a method call. + + + + Converts the body of the lambda expression into the referenced by it. + + + + + Checks whether the body of the lambda expression is a property access. + + + + + Checks whether the expression is a property access. + + + + + Checks whether the body of the lambda expression is a property indexer, which is true + when the expression is an whose + has + equal to . + + + + + Checks whether the expression is a property indexer, which is true + when the expression is an whose + has + equal to . + + + + + Creates an expression that casts the given expression to the + type. + + + + + TODO: remove this code when https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=331583 + is fixed. + + + + + Provides partial evaluation of subtrees, whenever they can be evaluated locally. + + Matt Warren: http://blogs.msdn.com/mattwar + Documented by InSTEDD: http://www.instedd.org + + + + Performs evaluation and replacement of independent sub-trees + + The root of the expression tree. + A function that decides whether a given expression + node can be part of the local function. + A new tree with sub-trees evaluated and replaced. + + + + Performs evaluation and replacement of independent sub-trees + + The root of the expression tree. + A new tree with sub-trees evaluated and replaced. + + + + Evaluates and replaces sub-trees when first candidate is reached (top-down) + + + + + Performs bottom-up analysis to determine which nodes can possibly + be part of an evaluated sub-tree. + + + + + Ensures the given is not null. + Throws otherwise. + + + + + Ensures the given string is not null or empty. + Throws in the first case, or + in the latter. + + + + + Checks an argument to ensure it is in the specified range including the edges. + + Type of the argument to check, it must be an type. + + The expression containing the name of the argument. + The argument value to check. + The minimun allowed value for the argument. + The maximun allowed value for the argument. + + + + Checks an argument to ensure it is in the specified range excluding the edges. + + Type of the argument to check, it must be an type. + + The expression containing the name of the argument. + The argument value to check. + The minimun allowed value for the argument. + The maximun allowed value for the argument. + + + + Implemented by all generated mock object instances. + + + + + Implemented by all generated mock object instances. + + + + + Reference the Mock that contains this as the mock.Object value. + + + + + Reference the Mock that contains this as the mock.Object value. + + + + + Implements the actual interception and method invocation for + all mocks. + + + + + Get an eventInfo for a given event name. Search type ancestors depth first if necessary. + + Name of the event, with the set_ or get_ prefix already removed + + + + Given a type return all of its ancestors, both types and interfaces. + + The type to find immediate ancestors of + + + + Implements the fluent API. + + + + + Defines the Callback verb for property setter setups. + + Type of the property. + + + + Specifies a callback to invoke when the property is set that receives the + property value being set. + + Callback method to invoke. + + Invokes the given callback with the property value being set. + + mock.SetupSet(x => x.Suspended) + .Callback((bool state) => Console.WriteLine(state)); + + + + + + Allows the specification of a matching condition for an + argument in a method invocation, rather than a specific + argument value. "It" refers to the argument being matched. + + This class allows the setup to match a method invocation + with an arbitrary value, with a value in a specified range, or + even one that matches a given predicate. + + + + + Matches any value of the given type. + + Typically used when the actual argument value for a method + call is not relevant. + + + // Throws an exception for a call to Remove with any string value. + mock.Setup(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException()); + + Type of the value. + + + + Matches any value that satisfies the given predicate. + Type of the argument to check.The predicate used to match the method argument. + Allows the specification of a predicate to perform matching + of method call arguments. + + This example shows how to return the value 1 whenever the argument to the + Do method is an even number. + + mock.Setup(x => x.Do(It.Is<int>(i => i % 2 == 0))) + .Returns(1); + + This example shows how to throw an exception if the argument to the + method is a negative number: + + mock.Setup(x => x.GetUser(It.Is<int>(i => i < 0))) + .Throws(new ArgumentException()); + + + + + + Matches any value that is in the range specified. + Type of the argument to check.The lower bound of the range.The upper bound of the range. + The kind of range. See . + + The following example shows how to expect a method call + with an integer argument within the 0..100 range. + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsInRange(0, 100, Range.Inclusive))) + .Returns(false); + + + + + + Matches a string argument if it matches the given regular expression pattern. + The pattern to use to match the string argument value. + The following example shows how to expect a call to a method where the + string argument matches the given regular expression: + + mock.Setup(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1); + + + + + + Matches a string argument if it matches the given regular expression pattern. + The pattern to use to match the string argument value.The options used to interpret the pattern. + The following example shows how to expect a call to a method where the + string argument matches the given regular expression, in a case insensitive way: + + mock.Setup(x => x.Check(It.IsRegex("[a-z]+", RegexOptions.IgnoreCase))).Returns(1); + + + + + + Matcher to treat static functions as matchers. + + mock.Setup(x => x.StringMethod(A.MagicString())); + + public static class A + { + [Matcher] + public static string MagicString() { return null; } + public static bool MagicString(string arg) + { + return arg == "magic"; + } + } + + Will succeed if: mock.Object.StringMethod("magic"); + and fail with any other call. + + + + + Options to customize the behavior of the mock. + + + + + Causes the mock to always throw + an exception for invocations that don't have a + corresponding setup. + + + + + Will never throw exceptions, returning default + values when necessary (null for reference types, + zero for value types or empty enumerables and arrays). + + + + + Default mock behavior, which equals . + + + + + Exception thrown by mocks when setups are not matched, + the mock is not properly setup, etc. + + + A distinct exception type is provided so that exceptions + thrown by the mock can be differentiated in tests that + expect other exceptions to be thrown (i.e. ArgumentException). + + Richer exception hierarchy/types are not provided as + tests typically should not catch or expect exceptions + from the mocks. These are typically the result of changes + in the tested class or its collaborators implementation, and + result in fixes in the mock setup so that they dissapear and + allow the test to pass. + + + + + + Supports the serialization infrastructure. + + Serialization information. + Streaming context. + + + + Supports the serialization infrastructure. + + Serialization information. + Streaming context. + + + + Made internal as it's of no use for + consumers, but it's important for + our own tests. + + + + + Used by the mock factory to accumulate verification + failures. + + + + + Supports the serialization infrastructure. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Mock type has already been initialized by accessing its Object property. Adding interfaces must be done before that.. + + + + + Looks up a localized string similar to Value cannot be an empty string.. + + + + + Looks up a localized string similar to Can only add interfaces to the mock.. + + + + + Looks up a localized string similar to Can't set return value for void method {0}.. + + + + + Looks up a localized string similar to Constructor arguments cannot be passed for interface mocks.. + + + + + Looks up a localized string similar to A matching constructor for the given arguments was not found on the mocked type.. + + + + + Looks up a localized string similar to Could not locate event for attach or detach method {0}.. + + + + + Looks up a localized string similar to Expression {0} involves a field access, which is not supported. Use properties instead.. + + + + + Looks up a localized string similar to Type to mock must be an interface or an abstract or non-sealed class. . + + + + + Looks up a localized string similar to Cannot retrieve a mock with the given object type {0} as it's not the main type of the mock or any of its additional interfaces. + Please cast the argument to one of the supported types: {1}. + Remember that there's no generics covariance in the CLR, so your object must be one of these types in order for the call to succeed.. + + + + + Looks up a localized string similar to The equals ("==" or "=" in VB) and the conditional 'and' ("&&" or "AndAlso" in VB) operators are the only ones supported in the query specification expression. Unsupported expression: {0}. + + + + + Looks up a localized string similar to LINQ method '{0}' not supported.. + + + + + Looks up a localized string similar to Expression contains a call to a method which is not virtual (overridable in VB) or abstract. Unsupported expression: {0}. + + + + + Looks up a localized string similar to Member {0}.{1} does not exist.. + + + + + Looks up a localized string similar to Method {0}.{1} is public. Use strong-typed Expect overload instead: + mock.Setup(x => x.{1}()); + . + + + + + Looks up a localized string similar to {0} invocation failed with mock behavior {1}. + {2}. + + + + + Looks up a localized string similar to Expected only {0} calls to {1}.. + + + + + Looks up a localized string similar to Expected only one call to {0}.. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at least {2} times, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at least once, but was never performed: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at most {3} times, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at most once, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock between {2} and {3} times (Exclusive), but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock between {2} and {3} times (Inclusive), but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock exactly {2} times, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock should never have been performed, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock once, but was {4} times: {1}. + + + + + Looks up a localized string similar to All invocations on the mock must have a corresponding setup.. + + + + + Looks up a localized string similar to Object instance was not created by Moq.. + + + + + Looks up a localized string similar to Out expression must evaluate to a constant value.. + + + + + Looks up a localized string similar to Property {0}.{1} does not have a getter.. + + + + + Looks up a localized string similar to Property {0}.{1} does not exist.. + + + + + Looks up a localized string similar to Property {0}.{1} is write-only.. + + + + + Looks up a localized string similar to Property {0}.{1} is read-only.. + + + + + Looks up a localized string similar to Property {0}.{1} does not have a setter.. + + + + + Looks up a localized string similar to Cannot raise a mocked event unless it has been associated (attached) to a concrete event in a mocked object.. + + + + + Looks up a localized string similar to Ref expression must evaluate to a constant value.. + + + + + Looks up a localized string similar to Invocation needs to return a value and therefore must have a corresponding setup that provides it.. + + + + + Looks up a localized string similar to A lambda expression is expected as the argument to It.Is<T>.. + + + + + Looks up a localized string similar to Invocation {0} should not have been made.. + + + + + Looks up a localized string similar to Expression is not a method invocation: {0}. + + + + + Looks up a localized string similar to Expression is not a property access: {0}. + + + + + Looks up a localized string similar to Expression is not a property setter invocation.. + + + + + Looks up a localized string similar to Expression references a method that does not belong to the mocked object: {0}. + + + + + Looks up a localized string similar to Invalid setup on a non-virtual (overridable in VB) member: {0}. + + + + + Looks up a localized string similar to Type {0} does not implement required interface {1}. + + + + + Looks up a localized string similar to Type {0} does not from required type {1}. + + + + + Looks up a localized string similar to To specify a setup for public property {0}.{1}, use the typed overloads, such as: + mock.Setup(x => x.{1}).Returns(value); + mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one + mock.SetupSet(x => x.{1}).Callback(callbackDelegate); + . + + + + + Looks up a localized string similar to Unsupported expression: {0}. + + + + + Looks up a localized string similar to Only property accesses are supported in intermediate invocations on a setup. Unsupported expression {0}.. + + + + + Looks up a localized string similar to Expression contains intermediate property access {0}.{1} which is of type {2} and cannot be mocked. Unsupported expression {3}.. + + + + + Looks up a localized string similar to Setter expression cannot use argument matchers that receive parameters.. + + + + + Looks up a localized string similar to Member {0} is not supported for protected mocking.. + + + + + Looks up a localized string similar to Setter expression can only use static custom matchers.. + + + + + Looks up a localized string similar to The following setups were not matched: + {0}. + + + + + Looks up a localized string similar to Invalid verify on a non-virtual (overridable in VB) member: {0}. + + + + + Allows setups to be specified for protected members by using their + name as a string, rather than strong-typing them which is not possible + due to their visibility. + + + + + Specifies a setup for a void method invocation with the given + , optionally specifying arguments for the method call. + + The name of the void method to be invoked. + The optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + + + + Specifies a setup for an invocation on a property or a non void method with the given + , optionally specifying arguments for the method call. + + The name of the method or property to be invoked. + The optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + The return type of the method or property. + + + + Specifies a setup for an invocation on a property getter with the given + . + + The name of the property. + The type of the property. + + + + Specifies a setup for an invocation on a property setter with the given + . + + The name of the property. + The property value. If argument matchers are used, + remember to use rather than . + The type of the property. + + + + Specifies a verify for a void method with the given , + optionally specifying arguments for the method call. Use in conjuntion with the default + . + + The invocation was not call the times specified by + . + The name of the void method to be verified. + The number of times a method is allowed to be called. + The optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + + + + Specifies a verify for an invocation on a property or a non void method with the given + , optionally specifying arguments for the method call. + + The invocation was not call the times specified by + . + The name of the method or property to be invoked. + The optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + The number of times a method is allowed to be called. + The type of return value from the expression. + + + + Specifies a verify for an invocation on a property getter with the given + . + The invocation was not call the times specified by + . + + The name of the property. + The number of times a method is allowed to be called. + The type of the property. + + + + Specifies a setup for an invocation on a property setter with the given + . + + The invocation was not call the times specified by + . + The name of the property. + The number of times a method is allowed to be called. + The property value. + The type of the property. If argument matchers are used, + remember to use rather than . + + + + Allows the specification of a matching condition for an + argument in a protected member setup, rather than a specific + argument value. "ItExpr" refers to the argument being matched. + + + Use this variant of argument matching instead of + for protected setups. + This class allows the setup to match a method invocation + with an arbitrary value, with a value in a specified range, or + even one that matches a given predicate, or null. + + + + + Matches a null value of the given type. + + + Required for protected mocks as the null value cannot be used + directly as it prevents proper method overload selection. + + + + // Throws an exception for a call to Remove with a null string value. + mock.Protected() + .Setup("Remove", ItExpr.IsNull<string>()) + .Throws(new InvalidOperationException()); + + + Type of the value. + + + + Matches any value of the given type. + + + Typically used when the actual argument value for a method + call is not relevant. + + + + // Throws an exception for a call to Remove with any string value. + mock.Protected() + .Setup("Remove", ItExpr.IsAny<string>()) + .Throws(new InvalidOperationException()); + + + Type of the value. + + + + Matches any value that satisfies the given predicate. + + Type of the argument to check. + The predicate used to match the method argument. + + Allows the specification of a predicate to perform matching + of method call arguments. + + + This example shows how to return the value 1 whenever the argument to the + Do method is an even number. + + mock.Protected() + .Setup("Do", ItExpr.Is<int>(i => i % 2 == 0)) + .Returns(1); + + This example shows how to throw an exception if the argument to the + method is a negative number: + + mock.Protected() + .Setup("GetUser", ItExpr.Is<int>(i => i < 0)) + .Throws(new ArgumentException()); + + + + + + Matches any value that is in the range specified. + + Type of the argument to check. + The lower bound of the range. + The upper bound of the range. + The kind of range. See . + + The following example shows how to expect a method call + with an integer argument within the 0..100 range. + + mock.Protected() + .Setup("HasInventory", + ItExpr.IsAny<string>(), + ItExpr.IsInRange(0, 100, Range.Inclusive)) + .Returns(false); + + + + + + Matches a string argument if it matches the given regular expression pattern. + + The pattern to use to match the string argument value. + + The following example shows how to expect a call to a method where the + string argument matches the given regular expression: + + mock.Protected() + .Setup("Check", ItExpr.IsRegex("[a-z]+")) + .Returns(1); + + + + + + Matches a string argument if it matches the given regular expression pattern. + + The pattern to use to match the string argument value. + The options used to interpret the pattern. + + The following example shows how to expect a call to a method where the + string argument matches the given regular expression, in a case insensitive way: + + mock.Protected() + .Setup("Check", ItExpr.IsRegex("[a-z]+", RegexOptions.IgnoreCase)) + .Returns(1); + + + + + + Enables the Protected() method on , + allowing setups to be set for protected members by using their + name as a string, rather than strong-typing them which is not possible + due to their visibility. + + + + + Enable protected setups for the mock. + + Mocked object type. Typically omitted as it can be inferred from the mock instance. + The mock to set the protected setups on. + + + + + + + + + + + + Kind of range to use in a filter specified through + . + + + + + The range includes the to and + from values. + + + + + The range does not include the to and + from values. + + + + + Determines the way default values are generated + calculated for loose mocks. + + + + + Default behavior, which generates empty values for + value types (i.e. default(int)), empty array and + enumerables, and nulls for all other reference types. + + + + + Whenever the default value generated by + is null, replaces this value with a mock (if the type + can be mocked). + + + For sealed classes, a null value will be generated. + + + + + A default implementation of IQueryable for use with QueryProvider + + + + + The is a + static method that returns an IQueryable of Mocks of T which is used to + apply the linq specification to. + + + + + Allows creation custom value matchers that can be used on setups and verification, + completely replacing the built-in class with your own argument + matching rules. + + See also . + + + + + Provided for the sole purpose of rendering the delegate passed to the + matcher constructor if no friendly render lambda is provided. + + + + + Initializes the match with the condition that + will be checked in order to match invocation + values. + The condition to match against actual values. + + + + + + + + + This method is used to set an expression as the last matcher invoked, + which is used in the SetupSet to allow matchers in the prop = value + delegate expression. This delegate is executed in "fluent" mode in + order to capture the value being set, and construct the corresponding + methodcall. + This is also used in the MatcherFactory for each argument expression. + This method ensures that when we execute the delegate, we + also track the matcher that was invoked, so that when we create the + methodcall we build the expression using it, rather than the null/default + value returned from the actual invocation. + + + + + Allows creation custom value matchers that can be used on setups and verification, + completely replacing the built-in class with your own argument + matching rules. + Type of the value to match. + The argument matching is used to determine whether a concrete + invocation in the mock matches a given setup. This + matching mechanism is fully extensible. + + Creating a custom matcher is straightforward. You just need to create a method + that returns a value from a call to with + your matching condition and optional friendly render expression: + + [Matcher] + public Order IsBigOrder() + { + return Match<Order>.Create( + o => o.GrandTotal >= 5000, + /* a friendly expression to render on failures */ + () => IsBigOrder()); + } + + This method can be used in any mock setup invocation: + + mock.Setup(m => m.Submit(IsBigOrder()).Throws<UnauthorizedAccessException>(); + + At runtime, Moq knows that the return value was a matcher (note that the method MUST be + annotated with the [Matcher] attribute in order to determine this) and + evaluates your predicate with the actual value passed into your predicate. + + Another example might be a case where you want to match a lists of orders + that contains a particular one. You might create matcher like the following: + + + public static class Orders + { + [Matcher] + public static IEnumerable<Order> Contains(Order order) + { + return Match<IEnumerable<Order>>.Create(orders => orders.Contains(order)); + } + } + + Now we can invoke this static method instead of an argument in an + invocation: + + var order = new Order { ... }; + var mock = new Mock<IRepository<Order>>(); + + mock.Setup(x => x.Save(Orders.Contains(order))) + .Throws<ArgumentException>(); + + + + + + Tracks the current mock and interception context. + + + + + Having an active fluent mock context means that the invocation + is being performed in "trial" mode, just to gather the + target method and arguments that need to be matched later + when the actual invocation is made. + + + + + A that returns an empty default value + for non-mockeable types, and mocks for all other types (interfaces and + non-sealed classes) that can be mocked. + + + + + Allows querying the universe of mocks for those that behave + according to the LINQ query specification. + + + This entry-point into Linq to Mocks is the only one in the root Moq + namespace to ease discovery. But to get all the mocking extension + methods on Object, a using of Moq.Linq must be done, so that the + polluting of the intellisense for all objects is an explicit opt-in. + + + + + Access the universe of mocks of the given type, to retrieve those + that behave according to the LINQ query specification. + + The type of the mocked object to query. + + + + Access the universe of mocks of the given type, to retrieve those + that behave according to the LINQ query specification. + + The predicate with the setup expressions. + The type of the mocked object to query. + + + + Creates an mock object of the indicated type. + + The type of the mocked object. + The mocked object created. + + + + Creates an mock object of the indicated type. + + The predicate with the setup expressions. + The type of the mocked object. + The mocked object created. + + + + Creates the mock query with the underlying queriable implementation. + + + + + Wraps the enumerator inside a queryable. + + + + + Method that is turned into the actual call from .Query{T}, to + transform the queryable query into a normal enumerable query. + This method is never used directly by consumers. + + + + + Extension method used to support Linq-like setup properties that are not virtual but do have + a getter and a setter, thereby allowing the use of Linq to Mocks to quickly initialize Dtos too :) + + + + + Helper extensions that are used by the query translator. + + + + + Retrieves a fluent mock from the given setup expression. + + + + + Defines the number of invocations allowed by a mocked method. + + + + + Specifies that a mocked method should be invoked times as minimum. + The minimun number of times.An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked one time as minimum. + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked time as maximun. + The maximun number of times.An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked one time as maximun. + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked between and + times. + The minimun number of times.The maximun number of times. + The kind of range. See . + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked exactly times. + The times that a method or property can be called.An object defining the allowed number of invocations. + + + + Specifies that a mocked method should not be invoked. + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked exactly one time. + An object defining the allowed number of invocations. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether two specified objects have the same value. + + The first . + + The second . + + true if the value of left is the same as the value of right; otherwise, false. + + + + + Determines whether two specified objects have different values. + + The first . + + The second . + + true if the value of left is different from the value of right; otherwise, false. + + + + diff --git a/packages/Moq.4.0.10827/lib/Silverlight4/Castle.Core.dll b/packages/Moq.4.0.10827/lib/Silverlight4/Castle.Core.dll new file mode 100644 index 0000000..a887ecd Binary files /dev/null and b/packages/Moq.4.0.10827/lib/Silverlight4/Castle.Core.dll differ diff --git a/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.dll b/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.dll new file mode 100644 index 0000000..fb516c1 Binary files /dev/null and b/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.dll differ diff --git a/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.pdb b/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.pdb new file mode 100644 index 0000000..d33d394 Binary files /dev/null and b/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.pdb differ diff --git a/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.xml b/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.xml new file mode 100644 index 0000000..90efe10 --- /dev/null +++ b/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.xml @@ -0,0 +1,5101 @@ + + + + Moq.Silverlight + + + + + Provides a mock implementation of . + + Any interface type can be used for mocking, but for classes, only abstract and virtual members can be mocked. + + The behavior of the mock with regards to the setups and the actual calls is determined + by the optional that can be passed to the + constructor. + + Type to mock, which can be an interface or a class. + The following example shows establishing setups with specific values + for method invocations: + + // Arrange + var order = new Order(TALISKER, 50); + var mock = new Mock<IWarehouse>(); + + mock.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); + + // Act + order.Fill(mock.Object); + + // Assert + Assert.True(order.IsFilled); + + The following example shows how to use the class + to specify conditions for arguments instead of specific values: + + // Arrange + var order = new Order(TALISKER, 50); + var mock = new Mock<IWarehouse>(); + + // shows how to expect a value within a range + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsInRange(0, 100, Range.Inclusive))) + .Returns(false); + + // shows how to throw for unexpected calls. + mock.Setup(x => x.Remove( + It.IsAny<string>(), + It.IsAny<int>())) + .Throws(new InvalidOperationException()); + + // Act + order.Fill(mock.Object); + + // Assert + Assert.False(order.IsFilled); + + + + + + Base class for mocks and static helper class with methods that + apply to mocked objects, such as to + retrieve a from an object instance. + + + + + Helper interface used to hide the base + members from the fluent API to make it much cleaner + in Visual Studio intellisense. + + + + + + + + + + + + + + + + + Creates an mock object of the indicated type. + + The type of the mocked object. + The mocked object created. + + + + Creates an mock object of the indicated type. + + The predicate with the specification of how the mocked object should behave. + The type of the mocked object. + The mocked object created. + + + + Initializes a new instance of the class. + + + + + Retrieves the mock object for the given object instance. + + Type of the mock to retrieve. Can be omitted as it's inferred + from the object instance passed in as the instance. + The instance of the mocked object.The mock associated with the mocked object. + The received instance + was not created by Moq. + + The following example shows how to add a new setup to an object + instance which is not the original but rather + the object associated with it: + + // Typed instance, not the mock, is retrieved from some test API. + HttpContextBase context = GetMockContext(); + + // context.Request is the typed object from the "real" API + // so in order to add a setup to it, we need to get + // the mock that "owns" it + Mock<HttpRequestBase> request = Mock.Get(context.Request); + mock.Setup(req => req.AppRelativeCurrentExecutionFilePath) + .Returns(tempUrl); + + + + + + Returns the mocked object value. + + + + + Verifies that all verifiable expectations have been met. + + This example sets up an expectation and marks it as verifiable. After + the mock is used, a Verify() call is issued on the mock + to ensure the method in the setup was invoked: + + var mock = new Mock<IWarehouse>(); + this.Setup(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true); + ... + // other test code + ... + // Will throw if the test code has didn't call HasInventory. + this.Verify(); + + Not all verifiable expectations were met. + + + + Verifies all expectations regardless of whether they have + been flagged as verifiable. + + This example sets up an expectation without marking it as verifiable. After + the mock is used, a call is issued on the mock + to ensure that all expectations are met: + + var mock = new Mock<IWarehouse>(); + this.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); + ... + // other test code + ... + // Will throw if the test code has didn't call HasInventory, even + // that expectation was not marked as verifiable. + this.VerifyAll(); + + At least one expectation was not met. + + + + Gets the interceptor target for the given expression and root mock, + building the intermediate hierarchy of mock objects if necessary. + + + + + Raises the associated event with the given + event argument data. + + + + + Raises the associated event with the given + event argument data. + + + + + Adds an interface implementation to the mock, + allowing setups to be specified for it. + + This method can only be called before the first use + of the mock property, at which + point the runtime type has already been generated + and no more interfaces can be added to it. + + Also, must be an + interface and not a class, which must be specified + when creating the mock instead. + + + The mock type + has already been generated by accessing the property. + + The specified + is not an interface. + + The following example creates a mock for the main interface + and later adds to it to verify + it's called by the consumer code: + + var mock = new Mock<IProcessor>(); + mock.Setup(x => x.Execute("ping")); + + // add IDisposable interface + var disposable = mock.As<IDisposable>(); + disposable.Setup(d => d.Dispose()).Verifiable(); + + Type of interface to cast the mock to. + + + + + + + Behavior of the mock, according to the value set in the constructor. + + + + + Whether the base member virtual implementation will be called + for mocked classes if no setup is matched. Defaults to . + + + + + Specifies the behavior to use when returning default values for + unexpected invocations on loose mocks. + + + + + Gets the mocked object instance. + + + + + Retrieves the type of the mocked object, its generic type argument. + This is used in the auto-mocking of hierarchy access. + + + + + Specifies the class that will determine the default + value to return when invocations are made that + have no setups and need to return a default + value (for loose mocks). + + + + + Exposes the list of extra interfaces implemented by the mock. + + + + + Ctor invoked by AsTInterface exclusively. + + + + + Initializes an instance of the mock with default behavior. + + var mock = new Mock<IFormatProvider>(); + + + + + Initializes an instance of the mock with default behavior and with + the given constructor arguments for the class. (Only valid when is a class) + + The mock will try to find the best match constructor given the constructor arguments, and invoke that + to initialize the instance. This applies only for classes, not interfaces. + + var mock = new Mock<MyProvider>(someArgument, 25); + Optional constructor arguments if the mocked type is a class. + + + + Initializes an instance of the mock with the specified behavior. + + var mock = new Mock<IFormatProvider>(MockBehavior.Relaxed); + Behavior of the mock. + + + + Initializes an instance of the mock with a specific behavior with + the given constructor arguments for the class. + + The mock will try to find the best match constructor given the constructor arguments, and invoke that + to initialize the instance. This applies only to classes, not interfaces. + + var mock = new Mock<MyProvider>(someArgument, 25); + Behavior of the mock.Optional constructor arguments if the mocked type is a class. + + + + Returns the mocked object value. + + + + + Specifies a setup on the mocked type for a call to + to a void method. + + If more than one setup is specified for the same method or property, + the latest one wins and is the one that will be executed. + Lambda expression that specifies the expected method invocation. + + var mock = new Mock<IProcessor>(); + mock.Setup(x => x.Execute("ping")); + + + + + + Specifies a setup on the mocked type for a call to + to a value returning method. + Type of the return value. Typically omitted as it can be inferred from the expression. + If more than one setup is specified for the same method or property, + the latest one wins and is the one that will be executed. + Lambda expression that specifies the method invocation. + + mock.Setup(x => x.HasInventory("Talisker", 50)).Returns(true); + + + + + + Specifies a setup on the mocked type for a call to + to a property getter. + + If more than one setup is set for the same property getter, + the latest one wins and is the one that will be executed. + Type of the property. Typically omitted as it can be inferred from the expression.Lambda expression that specifies the property getter. + + mock.SetupGet(x => x.Suspended) + .Returns(true); + + + + + + Specifies a setup on the mocked type for a call to + to a property setter. + + If more than one setup is set for the same property setter, + the latest one wins and is the one that will be executed. + + This overloads allows the use of a callback already + typed for the property type. + + Type of the property. Typically omitted as it can be inferred from the expression.The Lambda expression that sets a property to a value. + + mock.SetupSet(x => x.Suspended = true); + + + + + + Specifies a setup on the mocked type for a call to + to a property setter. + + If more than one setup is set for the same property setter, + the latest one wins and is the one that will be executed. + Lambda expression that sets a property to a value. + + mock.SetupSet(x => x.Suspended = true); + + + + + + Specifies that the given property should have "property behavior", + meaning that setting its value will cause it to be saved and + later returned when the property is requested. (this is also + known as "stubbing"). + + Type of the property, inferred from the property + expression (does not need to be specified). + Property expression to stub. + If you have an interface with an int property Value, you might + stub it using the following straightforward call: + + var mock = new Mock<IHaveValue>(); + mock.Stub(v => v.Value); + + After the Stub call has been issued, setting and + retrieving the object value will behave as expected: + + IHaveValue v = mock.Object; + + v.Value = 5; + Assert.Equal(5, v.Value); + + + + + + Specifies that the given property should have "property behavior", + meaning that setting its value will cause it to be saved and + later returned when the property is requested. This overload + allows setting the initial value for the property. (this is also + known as "stubbing"). + + Type of the property, inferred from the property + expression (does not need to be specified). + Property expression to stub.Initial value for the property. + If you have an interface with an int property Value, you might + stub it using the following straightforward call: + + var mock = new Mock<IHaveValue>(); + mock.SetupProperty(v => v.Value, 5); + + After the SetupProperty call has been issued, setting and + retrieving the object value will behave as expected: + + IHaveValue v = mock.Object; + // Initial value was stored + Assert.Equal(5, v.Value); + + // New value set which changes the initial value + v.Value = 6; + Assert.Equal(6, v.Value); + + + + + + Specifies that the all properties on the mock should have "property behavior", + meaning that setting its value will cause it to be saved and + later returned when the property is requested. (this is also + known as "stubbing"). The default value for each property will be the + one generated as specified by the property for the mock. + + If the mock is set to , + the mocked default values will also get all properties setup recursively. + + + + + + + + Verifies that a specific invocation matching the given expression was performed on the mock. Use + in conjuntion with the default . + + This example assumes that the mock has been used, and later we want to verify that a given + invocation with specific parameters was performed: + + var mock = new Mock<IProcessor>(); + // exercise mock + //... + // Will throw if the test code didn't call Execute with a "ping" string argument. + mock.Verify(proc => proc.Execute("ping")); + + The invocation was not performed on the mock.Expression to verify. + + + + Verifies that a specific invocation matching the given expression was performed on the mock. Use + in conjuntion with the default . + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called. + + + + Verifies that a specific invocation matching the given expression was performed on the mock, + specifying a failure error message. Use in conjuntion with the default + . + + This example assumes that the mock has been used, and later we want to verify that a given + invocation with specific parameters was performed: + + var mock = new Mock<IProcessor>(); + // exercise mock + //... + // Will throw if the test code didn't call Execute with a "ping" string argument. + mock.Verify(proc => proc.Execute("ping")); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. + + + + Verifies that a specific invocation matching the given expression was performed on the mock, + specifying a failure error message. Use in conjuntion with the default + . + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails. + + + + Verifies that a specific invocation matching the given expression was performed on the mock. Use + in conjuntion with the default . + + This example assumes that the mock has been used, and later we want to verify that a given + invocation with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't call HasInventory. + mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50)); + + The invocation was not performed on the mock.Expression to verify.Type of return value from the expression. + + + + Verifies that a specific invocation matching the given + expression was performed on the mock. Use in conjuntion + with the default . + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression. + + + + Verifies that a specific invocation matching the given + expression was performed on the mock, specifying a failure + error message. + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't call HasInventory. + mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50), "When filling orders, inventory has to be checked"); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.Type of return value from the expression. + + + + Verifies that a specific invocation matching the given + expression was performed on the mock, specifying a failure + error message. + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.Type of return value from the expression. + + + + Verifies that a property was read on the mock. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was retrieved from it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't retrieve the IsClosed property. + mock.VerifyGet(warehouse => warehouse.IsClosed); + + The invocation was not performed on the mock.Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was read on the mock. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was read on the mock, specifying a failure + error message. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was retrieved from it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't retrieve the IsClosed property. + mock.VerifyGet(warehouse => warehouse.IsClosed); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was read on the mock, specifying a failure + error message. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was set on the mock. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was set on it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed = true); + + The invocation was not performed on the mock.Expression to verify. + + + + Verifies that a property was set on the mock. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify. + + + + Verifies that a property was set on the mock, specifying + a failure message. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was set on it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed = true, "Warehouse should always be closed after the action"); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. + + + + Verifies that a property was set on the mock, specifying + a failure message. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. + + + + Raises the event referenced in using + the given argument. + + The argument is + invalid for the target event invocation, or the is + not an event attach or detach expression. + + The following example shows how to raise a event: + + var mock = new Mock<IViewModel>(); + + mock.Raise(x => x.PropertyChanged -= null, new PropertyChangedEventArgs("Name")); + + + This example shows how to invoke an event with a custom event arguments + class in a view that will cause its corresponding presenter to + react by changing its state: + + var mockView = new Mock<IOrdersView>(); + var presenter = new OrdersPresenter(mockView.Object); + + // Check that the presenter has no selection by default + Assert.Null(presenter.SelectedOrder); + + // Raise the event with a specific arguments data + mockView.Raise(v => v.SelectionChanged += null, new OrderEventArgs { Order = new Order("moq", 500) }); + + // Now the presenter reacted to the event, and we have a selected order + Assert.NotNull(presenter.SelectedOrder); + Assert.Equal("moq", presenter.SelectedOrder.ProductName); + + + + + + Raises the event referenced in using + the given argument for a non-EventHandler typed event. + + The arguments are + invalid for the target event invocation, or the is + not an event attach or detach expression. + + The following example shows how to raise a custom event that does not adhere to + the standard EventHandler: + + var mock = new Mock<IViewModel>(); + + mock.Raise(x => x.MyEvent -= null, "Name", bool, 25); + + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Exposes the mocked object instance. + + + + + Implements the fluent API. + + + + + The expectation will be considered only in the former condition. + + + + + + + The expectation will be considered only in the former condition. + + + + + + + + Setups the get. + + The type of the property. + The expression. + + + + + Setups the set. + + The type of the property. + The setter expression. + + + + + Setups the set. + + The setter expression. + + + + + Determines the way default values are generated + calculated for loose mocks. + + + + + Default behavior, which generates empty values for + value types (i.e. default(int)), empty array and + enumerables, and nulls for all other reference types. + + + + + Whenever the default value generated by + is null, replaces this value with a mock (if the type + can be mocked). + + + For sealed classes, a null value will be generated. + + + + + A that returns an empty default value + for invocations that do not have setups or return values, with loose mocks. + This is the default behavior for a mock. + + + + + Interface to be implemented by classes that determine the + default value of non-expected invocations. + + + + + Defines the default value to return in all the methods returning . + The type of the return value.The value to set as default. + + + + Provides a value for the given member and arguments. + + The member to provide a default value for. + + + + + Provides partial evaluation of subtrees, whenever they can be evaluated locally. + + Matt Warren: http://blogs.msdn.com/mattwar + Documented by InSTEDD: http://www.instedd.org + + + + Performs evaluation and replacement of independent sub-trees + + The root of the expression tree. + A function that decides whether a given expression + node can be part of the local function. + A new tree with sub-trees evaluated and replaced. + + + + Performs evaluation and replacement of independent sub-trees + + The root of the expression tree. + A new tree with sub-trees evaluated and replaced. + + + + Evaluates and replaces sub-trees when first candidate is reached (top-down) + + + + + Performs bottom-up analysis to determine which nodes can possibly + be part of an evaluated sub-tree. + + + + + Casts the expression to a lambda expression, removing + a cast if there's any. + + + + + Casts the body of the lambda expression to a . + + If the body is not a method call. + + + + Converts the body of the lambda expression into the referenced by it. + + + + + Checks whether the body of the lambda expression is a property access. + + + + + Checks whether the expression is a property access. + + + + + Checks whether the body of the lambda expression is a property indexer, which is true + when the expression is an whose + has + equal to . + + + + + Checks whether the expression is a property indexer, which is true + when the expression is an whose + has + equal to . + + + + + Creates an expression that casts the given expression to the + type. + + + + + TODO: remove this code when https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=331583 + is fixed. + + + + + The intention of is to create a more readable + string representation for the failure message. + + + + + Tracks the current mock and interception context. + + + + + Having an active fluent mock context means that the invocation + is being performed in "trial" mode, just to gather the + target method and arguments that need to be matched later + when the actual invocation is made. + + + + + Ensures the given is not null. + Throws otherwise. + + + + + Ensures the given string is not null or empty. + Throws in the first case, or + in the latter. + + + + + Checks an argument to ensure it is in the specified range including the edges. + + Type of the argument to check, it must be an type. + + The expression containing the name of the argument. + The argument value to check. + The minimun allowed value for the argument. + The maximun allowed value for the argument. + + + + Checks an argument to ensure it is in the specified range excluding the edges. + + Type of the argument to check, it must be an type. + + The expression containing the name of the argument. + The argument value to check. + The minimun allowed value for the argument. + The maximun allowed value for the argument. + + + + Implemented by all generated mock object instances. + + + + + Implemented by all generated mock object instances. + + + + + Reference the Mock that contains this as the mock.Object value. + + + + + Reference the Mock that contains this as the mock.Object value. + + + + + Implements the actual interception and method invocation for + all mocks. + + + + + Get an eventInfo for a given event name. Search type ancestors depth first if necessary. + + Name of the event, with the set_ or get_ prefix already removed + + + + Given a type return all of its ancestors, both types and interfaces. + + The type to find immediate ancestors of + + + + Allows the specification of a matching condition for an + argument in a method invocation, rather than a specific + argument value. "It" refers to the argument being matched. + + This class allows the setup to match a method invocation + with an arbitrary value, with a value in a specified range, or + even one that matches a given predicate. + + + + + Matches any value of the given type. + + Typically used when the actual argument value for a method + call is not relevant. + + + // Throws an exception for a call to Remove with any string value. + mock.Setup(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException()); + + Type of the value. + + + + Matches any value that satisfies the given predicate. + Type of the argument to check.The predicate used to match the method argument. + Allows the specification of a predicate to perform matching + of method call arguments. + + This example shows how to return the value 1 whenever the argument to the + Do method is an even number. + + mock.Setup(x => x.Do(It.Is<int>(i => i % 2 == 0))) + .Returns(1); + + This example shows how to throw an exception if the argument to the + method is a negative number: + + mock.Setup(x => x.GetUser(It.Is<int>(i => i < 0))) + .Throws(new ArgumentException()); + + + + + + Matches any value that is in the range specified. + Type of the argument to check.The lower bound of the range.The upper bound of the range. + The kind of range. See . + + The following example shows how to expect a method call + with an integer argument within the 0..100 range. + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsInRange(0, 100, Range.Inclusive))) + .Returns(false); + + + + + + Matches a string argument if it matches the given regular expression pattern. + The pattern to use to match the string argument value. + The following example shows how to expect a call to a method where the + string argument matches the given regular expression: + + mock.Setup(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1); + + + + + + Matches a string argument if it matches the given regular expression pattern. + The pattern to use to match the string argument value.The options used to interpret the pattern. + The following example shows how to expect a call to a method where the + string argument matches the given regular expression, in a case insensitive way: + + mock.Setup(x => x.Check(It.IsRegex("[a-z]+", RegexOptions.IgnoreCase))).Returns(1); + + + + + + Implements the fluent API. + + + + + Defines the Callback verb and overloads. + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3) => Console.WriteLine(arg1 + arg2 + arg3)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15)); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The type of the sixteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16)); + + + + + + Specifies a callback to invoke when the method is called. + + The callback method to invoke. + + The following example specifies a callback to set a boolean + value that can be used later: + + var called = false; + mock.Setup(x => x.Execute()) + .Callback(() => called = true); + + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The argument type of the invoked method. + The callback method to invoke. + + Invokes the given callback with the concrete invocation argument value. + + Notice how the specific string argument is retrieved by simply declaring + it as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute(It.IsAny<string>())) + .Callback((string command) => Console.WriteLine(command)); + + + + + + Defines occurrence members to constraint setups. + + + + + The expected invocation can happen at most once. + + + + var mock = new Mock<ICommand>(); + mock.Setup(foo => foo.Execute("ping")) + .AtMostOnce(); + + + + + + The expected invocation can happen at most specified number of times. + + The number of times to accept calls. + + + var mock = new Mock<ICommand>(); + mock.Setup(foo => foo.Execute("ping")) + .AtMost( 5 ); + + + + + + Defines the Raises verb. + + + + + Specifies the event that will be raised + when the setup is met. + + An expression that represents an event attach or detach action. + The event arguments to pass for the raised event. + + The following example shows how to raise an event when + the setup is met: + + var mock = new Mock<IContainer>(); + + mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>())) + .Raises(add => add.Added += null, EventArgs.Empty); + + + + + + Specifies the event that will be raised + when the setup is matched. + + An expression that represents an event attach or detach action. + A function that will build the + to pass when raising the event. + + + + + Specifies the custom event that will be raised + when the setup is matched. + + An expression that represents an event attach or detach action. + The arguments to pass to the custom delegate (non EventHandler-compatible). + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + The type of the thirteenth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + The type of the thirteenth argument received by the expected invocation. + The type of the fourteenth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + The type of the thirteenth argument received by the expected invocation. + The type of the fourteenth argument received by the expected invocation. + The type of the fifteenth argument received by the expected invocation. + + + + + Specifies the event that will be raised when the setup is matched. + + The expression that represents an event attach or detach action. + The function that will build the + to pass when raising the event. + The type of the first argument received by the expected invocation. + The type of the second argument received by the expected invocation. + The type of the third argument received by the expected invocation. + The type of the fourth argument received by the expected invocation. + The type of the fifth argument received by the expected invocation. + The type of the sixth argument received by the expected invocation. + The type of the seventh argument received by the expected invocation. + The type of the eighth argument received by the expected invocation. + The type of the nineth argument received by the expected invocation. + The type of the tenth argument received by the expected invocation. + The type of the eleventh argument received by the expected invocation. + The type of the twelfth argument received by the expected invocation. + The type of the thirteenth argument received by the expected invocation. + The type of the fourteenth argument received by the expected invocation. + The type of the fifteenth argument received by the expected invocation. + The type of the sixteenth argument received by the expected invocation. + + + + + Defines the Verifiable verb. + + + + + Marks the expectation as verifiable, meaning that a call + to will check if this particular + expectation was met. + + + The following example marks the expectation as verifiable: + + mock.Expect(x => x.Execute("ping")) + .Returns(true) + .Verifiable(); + + + + + + Marks the expectation as verifiable, meaning that a call + to will check if this particular + expectation was met, and specifies a message for failures. + + + The following example marks the expectation as verifiable: + + mock.Expect(x => x.Execute("ping")) + .Returns(true) + .Verifiable("Ping should be executed always!"); + + + + + + Implements the fluent API. + + + + + Implements the fluent API. + + + + + Defines the Throws verb. + + + + + Specifies the exception to throw when the method is invoked. + + Exception instance to throw. + + This example shows how to throw an exception when the method is + invoked with an empty string argument: + + mock.Setup(x => x.Execute("")) + .Throws(new ArgumentException()); + + + + + + Specifies the type of exception to throw when the method is invoked. + + Type of exception to instantiate and throw when the setup is matched. + + This example shows how to throw an exception when the method is + invoked with an empty string argument: + + mock.Setup(x => x.Execute("")) + .Throws<ArgumentException>(); + + + + + + Implements the fluent API. + + + + + Implements the fluent API. + + + + + Defines the Callback verb and overloads for callbacks on + setups that return a value. + + Mocked type. + Type of the return value of the setup. + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2) => Console.WriteLine(arg1 + arg2)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3) => Console.WriteLine(arg1 + arg2 + arg3)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The type of the sixteenth argument of the invoked method. + The callback method to invoke. + A reference to interface. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16)); + + + + + + Specifies a callback to invoke when the method is called. + + The callback method to invoke. + + The following example specifies a callback to set a boolean value that can be used later: + + var called = false; + mock.Setup(x => x.Execute()) + .Callback(() => called = true) + .Returns(true); + + Note that in the case of value-returning methods, after the Callback + call you can still specify the return value. + + + + + Specifies a callback to invoke when the method is called that receives the original arguments. + + The type of the argument of the invoked method. + Callback method to invoke. + + Invokes the given callback with the concrete invocation argument value. + + Notice how the specific string argument is retrieved by simply declaring + it as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute(It.IsAny<string>())) + .Callback(command => Console.WriteLine(command)) + .Returns(true); + + + + + + Implements the fluent API. + + + + + Defines the Returns verb. + + Mocked type. + Type of the return value from the expression. + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2) => arg1 + arg2); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3) => arg1 + arg2 + arg3); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4) => arg1 + arg2 + arg3 + arg4); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5) => arg1 + arg2 + arg3 + arg4 + arg5); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the first argument of the invoked method. + The type of the second argument of the invoked method. + The type of the third argument of the invoked method. + The type of the fourth argument of the invoked method. + The type of the fifth argument of the invoked method. + The type of the sixth argument of the invoked method. + The type of the seventh argument of the invoked method. + The type of the eighth argument of the invoked method. + The type of the nineth argument of the invoked method. + The type of the tenth argument of the invoked method. + The type of the eleventh argument of the invoked method. + The type of the twelfth argument of the invoked method. + The type of the thirteenth argument of the invoked method. + The type of the fourteenth argument of the invoked method. + The type of the fifteenth argument of the invoked method. + The type of the sixteenth argument of the invoked method. + The function that will calculate the return value. + Returns a calculated value which is evaluated lazily at the time of the invocation. + + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16); + + + + + + Specifies the value to return. + + The value to return, or . + + Return a true value from the method call: + + mock.Setup(x => x.Execute("ping")) + .Returns(true); + + + + + + Specifies a function that will calculate the value to return from the method. + + The function that will calculate the return value. + + Return a calculated value when the method is called: + + mock.Setup(x => x.Execute("ping")) + .Returns(() => returnValues[0]); + + The lambda expression to retrieve the return value is lazy-executed, + meaning that its value may change depending on the moment the method + is executed and the value the returnValues array has at + that moment. + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + The type of the argument of the invoked method. + The function that will calculate the return value. + + Return a calculated value which is evaluated lazily at the time of the invocation. + + The lookup list can change between invocations and the setup + will return different values accordingly. Also, notice how the specific + string argument is retrieved by simply declaring it as part of the lambda + expression: + + + mock.Setup(x => x.Execute(It.IsAny<string>())) + .Returns((string command) => returnValues[command]); + + + + + + Implements the fluent API. + + + + + Defines the Callback verb for property getter setups. + + + Mocked type. + Type of the property. + + + + Specifies a callback to invoke when the property is retrieved. + + Callback method to invoke. + + Invokes the given callback with the property value being set. + + mock.SetupGet(x => x.Suspended) + .Callback(() => called = true) + .Returns(true); + + + + + + Implements the fluent API. + + + + + Defines the Returns verb for property get setups. + + Mocked type. + Type of the property. + + + + Specifies the value to return. + + The value to return, or . + + Return a true value from the property getter call: + + mock.SetupGet(x => x.Suspended) + .Returns(true); + + + + + + Specifies a function that will calculate the value to return for the property. + + The function that will calculate the return value. + + Return a calculated value when the property is retrieved: + + mock.SetupGet(x => x.Suspended) + .Returns(() => returnValues[0]); + + The lambda expression to retrieve the return value is lazy-executed, + meaning that its value may change depending on the moment the property + is retrieved and the value the returnValues array has at + that moment. + + + + + Implements the fluent API. + + + + + Defines the Callback verb for property setter setups. + + Type of the property. + + + + Specifies a callback to invoke when the property is set that receives the + property value being set. + + Callback method to invoke. + + Invokes the given callback with the property value being set. + + mock.SetupSet(x => x.Suspended) + .Callback((bool state) => Console.WriteLine(state)); + + + + + + Language for ReturnSequence + + + + + Returns value + + + + + Throws an exception + + + + + Throws an exception + + + + + The first method call or member access will be the + last segment of the expression (depth-first traversal), + which is the one we have to Setup rather than FluentMock. + And the last one is the one we have to Mock.Get rather + than FluentMock. + + + + + A default implementation of IQueryable for use with QueryProvider + + + + + The is a + static method that returns an IQueryable of Mocks of T which is used to + apply the linq specification to. + + + + + Utility repository class to use to construct multiple + mocks when consistent verification is + desired for all of them. + + + If multiple mocks will be created during a test, passing + the desired (if different than the + or the one + passed to the repository constructor) and later verifying each + mock can become repetitive and tedious. + + This repository class helps in that scenario by providing a + simplified creation of multiple mocks with a default + (unless overriden by calling + ) and posterior verification. + + + + The following is a straightforward example on how to + create and automatically verify strict mocks using a : + + var repository = new MockRepository(MockBehavior.Strict); + + var foo = repository.Create<IFoo>(); + var bar = repository.Create<IBar>(); + + // no need to call Verifiable() on the setup + // as we'll be validating all of them anyway. + foo.Setup(f => f.Do()); + bar.Setup(b => b.Redo()); + + // exercise the mocks here + + repository.VerifyAll(); + // At this point all setups are already checked + // and an optional MockException might be thrown. + // Note also that because the mocks are strict, any invocation + // that doesn't have a matching setup will also throw a MockException. + + The following examples shows how to setup the repository + to create loose mocks and later verify only verifiable setups: + + var repository = new MockRepository(MockBehavior.Loose); + + var foo = repository.Create<IFoo>(); + var bar = repository.Create<IBar>(); + + // this setup will be verified when we verify the repository + foo.Setup(f => f.Do()).Verifiable(); + + // this setup will NOT be verified + foo.Setup(f => f.Calculate()); + + // this setup will be verified when we verify the repository + bar.Setup(b => b.Redo()).Verifiable(); + + // exercise the mocks here + // note that because the mocks are Loose, members + // called in the interfaces for which no matching + // setups exist will NOT throw exceptions, + // and will rather return default values. + + repository.Verify(); + // At this point verifiable setups are already checked + // and an optional MockException might be thrown. + + The following examples shows how to setup the repository with a + default strict behavior, overriding that default for a + specific mock: + + var repository = new MockRepository(MockBehavior.Strict); + + // this particular one we want loose + var foo = repository.Create<IFoo>(MockBehavior.Loose); + var bar = repository.Create<IBar>(); + + // specify setups + + // exercise the mocks here + + repository.Verify(); + + + + + + + Utility factory class to use to construct multiple + mocks when consistent verification is + desired for all of them. + + + If multiple mocks will be created during a test, passing + the desired (if different than the + or the one + passed to the factory constructor) and later verifying each + mock can become repetitive and tedious. + + This factory class helps in that scenario by providing a + simplified creation of multiple mocks with a default + (unless overriden by calling + ) and posterior verification. + + + + The following is a straightforward example on how to + create and automatically verify strict mocks using a : + + var factory = new MockFactory(MockBehavior.Strict); + + var foo = factory.Create<IFoo>(); + var bar = factory.Create<IBar>(); + + // no need to call Verifiable() on the setup + // as we'll be validating all of them anyway. + foo.Setup(f => f.Do()); + bar.Setup(b => b.Redo()); + + // exercise the mocks here + + factory.VerifyAll(); + // At this point all setups are already checked + // and an optional MockException might be thrown. + // Note also that because the mocks are strict, any invocation + // that doesn't have a matching setup will also throw a MockException. + + The following examples shows how to setup the factory + to create loose mocks and later verify only verifiable setups: + + var factory = new MockFactory(MockBehavior.Loose); + + var foo = factory.Create<IFoo>(); + var bar = factory.Create<IBar>(); + + // this setup will be verified when we verify the factory + foo.Setup(f => f.Do()).Verifiable(); + + // this setup will NOT be verified + foo.Setup(f => f.Calculate()); + + // this setup will be verified when we verify the factory + bar.Setup(b => b.Redo()).Verifiable(); + + // exercise the mocks here + // note that because the mocks are Loose, members + // called in the interfaces for which no matching + // setups exist will NOT throw exceptions, + // and will rather return default values. + + factory.Verify(); + // At this point verifiable setups are already checked + // and an optional MockException might be thrown. + + The following examples shows how to setup the factory with a + default strict behavior, overriding that default for a + specific mock: + + var factory = new MockFactory(MockBehavior.Strict); + + // this particular one we want loose + var foo = factory.Create<IFoo>(MockBehavior.Loose); + var bar = factory.Create<IBar>(); + + // specify setups + + // exercise the mocks here + + factory.Verify(); + + + + + + + Initializes the factory with the given + for newly created mocks from the factory. + + The behavior to use for mocks created + using the factory method if not overriden + by using the overload. + + + + Creates a new mock with the default + specified at factory construction time. + + Type to mock. + A new . + + + var factory = new MockFactory(MockBehavior.Strict); + + var foo = factory.Create<IFoo>(); + // use mock on tests + + factory.VerifyAll(); + + + + + + Creates a new mock with the default + specified at factory construction time and with the + the given constructor arguments for the class. + + + The mock will try to find the best match constructor given the + constructor arguments, and invoke that to initialize the instance. + This applies only to classes, not interfaces. + + Type to mock. + Constructor arguments for mocked classes. + A new . + + + var factory = new MockFactory(MockBehavior.Default); + + var mock = factory.Create<MyBase>("Foo", 25, true); + // use mock on tests + + factory.Verify(); + + + + + + Creates a new mock with the given . + + Type to mock. + Behavior to use for the mock, which overrides + the default behavior specified at factory construction time. + A new . + + The following example shows how to create a mock with a different + behavior to that specified as the default for the factory: + + var factory = new MockFactory(MockBehavior.Strict); + + var foo = factory.Create<IFoo>(MockBehavior.Loose); + + + + + + Creates a new mock with the given + and with the the given constructor arguments for the class. + + + The mock will try to find the best match constructor given the + constructor arguments, and invoke that to initialize the instance. + This applies only to classes, not interfaces. + + Type to mock. + Behavior to use for the mock, which overrides + the default behavior specified at factory construction time. + Constructor arguments for mocked classes. + A new . + + The following example shows how to create a mock with a different + behavior to that specified as the default for the factory, passing + constructor arguments: + + var factory = new MockFactory(MockBehavior.Default); + + var mock = factory.Create<MyBase>(MockBehavior.Strict, "Foo", 25, true); + + + + + + Implements creation of a new mock within the factory. + + Type to mock. + The behavior for the new mock. + Optional arguments for the construction of the mock. + + + + Verifies all verifiable expectations on all mocks created + by this factory. + + + One or more mocks had expectations that were not satisfied. + + + + Verifies all verifiable expectations on all mocks created + by this factory. + + + One or more mocks had expectations that were not satisfied. + + + + Invokes for each mock + in , and accumulates the resulting + that might be + thrown from the action. + + The action to execute against + each mock. + + + + Whether the base member virtual implementation will be called + for mocked classes if no setup is matched. Defaults to . + + + + + Specifies the behavior to use when returning default values for + unexpected invocations on loose mocks. + + + + + Gets the mocks that have been created by this factory and + that will get verified together. + + + + + Access the universe of mocks of the given type, to retrieve those + that behave according to the LINQ query specification. + + The type of the mocked object to query. + + + + Access the universe of mocks of the given type, to retrieve those + that behave according to the LINQ query specification. + + The predicate with the setup expressions. + The type of the mocked object to query. + + + + Creates an mock object of the indicated type. + + The type of the mocked object. + The mocked object created. + + + + Creates an mock object of the indicated type. + + The predicate with the setup expressions. + The type of the mocked object. + The mocked object created. + + + + Creates the mock query with the underlying queriable implementation. + + + + + Wraps the enumerator inside a queryable. + + + + + Method that is turned into the actual call from .Query{T}, to + transform the queryable query into a normal enumerable query. + This method is never used directly by consumers. + + + + + Initializes the repository with the given + for newly created mocks from the repository. + + The behavior to use for mocks created + using the repository method if not overriden + by using the overload. + + + + Allows querying the universe of mocks for those that behave + according to the LINQ query specification. + + + This entry-point into Linq to Mocks is the only one in the root Moq + namespace to ease discovery. But to get all the mocking extension + methods on Object, a using of Moq.Linq must be done, so that the + polluting of the intellisense for all objects is an explicit opt-in. + + + + + Access the universe of mocks of the given type, to retrieve those + that behave according to the LINQ query specification. + + The type of the mocked object to query. + + + + Access the universe of mocks of the given type, to retrieve those + that behave according to the LINQ query specification. + + The predicate with the setup expressions. + The type of the mocked object to query. + + + + Creates an mock object of the indicated type. + + The type of the mocked object. + The mocked object created. + + + + Creates an mock object of the indicated type. + + The predicate with the setup expressions. + The type of the mocked object. + The mocked object created. + + + + Creates the mock query with the underlying queriable implementation. + + + + + Wraps the enumerator inside a queryable. + + + + + Method that is turned into the actual call from .Query{T}, to + transform the queryable query into a normal enumerable query. + This method is never used directly by consumers. + + + + + Extension method used to support Linq-like setup properties that are not virtual but do have + a getter and a setter, thereby allowing the use of Linq to Mocks to quickly initialize Dtos too :) + + + + + Helper extensions that are used by the query translator. + + + + + Retrieves a fluent mock from the given setup expression. + + + + + Allows creation custom value matchers that can be used on setups and verification, + completely replacing the built-in class with your own argument + matching rules. + + See also . + + + + + Provided for the sole purpose of rendering the delegate passed to the + matcher constructor if no friendly render lambda is provided. + + + + + Initializes the match with the condition that + will be checked in order to match invocation + values. + The condition to match against actual values. + + + + + + + + + This method is used to set an expression as the last matcher invoked, + which is used in the SetupSet to allow matchers in the prop = value + delegate expression. This delegate is executed in "fluent" mode in + order to capture the value being set, and construct the corresponding + methodcall. + This is also used in the MatcherFactory for each argument expression. + This method ensures that when we execute the delegate, we + also track the matcher that was invoked, so that when we create the + methodcall we build the expression using it, rather than the null/default + value returned from the actual invocation. + + + + + Allows creation custom value matchers that can be used on setups and verification, + completely replacing the built-in class with your own argument + matching rules. + Type of the value to match. + The argument matching is used to determine whether a concrete + invocation in the mock matches a given setup. This + matching mechanism is fully extensible. + + Creating a custom matcher is straightforward. You just need to create a method + that returns a value from a call to with + your matching condition and optional friendly render expression: + + [Matcher] + public Order IsBigOrder() + { + return Match<Order>.Create( + o => o.GrandTotal >= 5000, + /* a friendly expression to render on failures */ + () => IsBigOrder()); + } + + This method can be used in any mock setup invocation: + + mock.Setup(m => m.Submit(IsBigOrder()).Throws<UnauthorizedAccessException>(); + + At runtime, Moq knows that the return value was a matcher (note that the method MUST be + annotated with the [Matcher] attribute in order to determine this) and + evaluates your predicate with the actual value passed into your predicate. + + Another example might be a case where you want to match a lists of orders + that contains a particular one. You might create matcher like the following: + + + public static class Orders + { + [Matcher] + public static IEnumerable<Order> Contains(Order order) + { + return Match<IEnumerable<Order>>.Create(orders => orders.Contains(order)); + } + } + + Now we can invoke this static method instead of an argument in an + invocation: + + var order = new Order { ... }; + var mock = new Mock<IRepository<Order>>(); + + mock.Setup(x => x.Save(Orders.Contains(order))) + .Throws<ArgumentException>(); + + + + + + Marks a method as a matcher, which allows complete replacement + of the built-in class with your own argument + matching rules. + + + This feature has been deprecated in favor of the new + and simpler . + + + The argument matching is used to determine whether a concrete + invocation in the mock matches a given setup. This + matching mechanism is fully extensible. + + + There are two parts of a matcher: the compiler matcher + and the runtime matcher. + + + Compiler matcher + Used to satisfy the compiler requirements for the + argument. Needs to be a method optionally receiving any arguments + you might need for the matching, but with a return type that + matches that of the argument. + + Let's say I want to match a lists of orders that contains + a particular one. I might create a compiler matcher like the following: + + + public static class Orders + { + [Matcher] + public static IEnumerable<Order> Contains(Order order) + { + return null; + } + } + + Now we can invoke this static method instead of an argument in an + invocation: + + var order = new Order { ... }; + var mock = new Mock<IRepository<Order>>(); + + mock.Setup(x => x.Save(Orders.Contains(order))) + .Throws<ArgumentException>(); + + Note that the return value from the compiler matcher is irrelevant. + This method will never be called, and is just used to satisfy the + compiler and to signal Moq that this is not a method that we want + to be invoked at runtime. + + + + Runtime matcher + + The runtime matcher is the one that will actually perform evaluation + when the test is run, and is defined by convention to have the + same signature as the compiler matcher, but where the return + value is the first argument to the call, which contains the + object received by the actual invocation at runtime: + + public static bool Contains(IEnumerable<Order> orders, Order order) + { + return orders.Contains(order); + } + + At runtime, the mocked method will be invoked with a specific + list of orders. This value will be passed to this runtime + matcher as the first argument, while the second argument is the + one specified in the setup (x.Save(Orders.Contains(order))). + + The boolean returned determines whether the given argument has been + matched. If all arguments to the expected method are matched, then + the setup matches and is evaluated. + + + + + + Using this extensible infrastructure, you can easily replace the entire + set of matchers with your own. You can also avoid the + typical (and annoying) lengthy expressions that result when you have + multiple arguments that use generics. + + + The following is the complete example explained above: + + public static class Orders + { + [Matcher] + public static IEnumerable<Order> Contains(Order order) + { + return null; + } + + public static bool Contains(IEnumerable<Order> orders, Order order) + { + return orders.Contains(order); + } + } + + And the concrete test using this matcher: + + var order = new Order { ... }; + var mock = new Mock<IRepository<Order>>(); + + mock.Setup(x => x.Save(Orders.Contains(order))) + .Throws<ArgumentException>(); + + // use mock, invoke Save, and have the matcher filter. + + + + + + Matcher to treat static functions as matchers. + + mock.Setup(x => x.StringMethod(A.MagicString())); + + public static class A + { + [Matcher] + public static string MagicString() { return null; } + public static bool MagicString(string arg) + { + return arg == "magic"; + } + } + + Will succeed if: mock.Object.StringMethod("magic"); + and fail with any other call. + + + + + We need this non-generics base class so that + we can use from + generic code. + + + + + Options to customize the behavior of the mock. + + + + + Causes the mock to always throw + an exception for invocations that don't have a + corresponding setup. + + + + + Will never throw exceptions, returning default + values when necessary (null for reference types, + zero for value types or empty enumerables and arrays). + + + + + Default mock behavior, which equals . + + + + + A that returns an empty default value + for non-mockeable types, and mocks for all other types (interfaces and + non-sealed classes) that can be mocked. + + + + + Exception thrown by mocks when setups are not matched, + the mock is not properly setup, etc. + + + A distinct exception type is provided so that exceptions + thrown by the mock can be differentiated in tests that + expect other exceptions to be thrown (i.e. ArgumentException). + + Richer exception hierarchy/types are not provided as + tests typically should not catch or expect exceptions + from the mocks. These are typically the result of changes + in the tested class or its collaborators implementation, and + result in fixes in the mock setup so that they dissapear and + allow the test to pass. + + + + + + Made internal as it's of no use for + consumers, but it's important for + our own tests. + + + + + Used by the mock factory to accumulate verification + failures. + + + + + Helper class to setup a full trace between many mocks + + + + + Initialize a trace setup + + + + + Allow sequence to be repeated + + + + + define nice api + + + + + Perform an expectation in the trace. + + + + + Provides legacy API members as extensions so that + existing code continues to compile, but new code + doesn't see then. + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Provides additional methods on mocks. + + + Provided as extension methods as they confuse the compiler + with the overloads taking Action. + + + + + Specifies a setup on the mocked type for a call to + to a property setter, regardless of its value. + + + If more than one setup is set for the same property setter, + the latest one wins and is the one that will be executed. + + Type of the property. Typically omitted as it can be inferred from the expression. + Type of the mock. + The target mock for the setup. + Lambda expression that specifies the property setter. + + + mock.SetupSet(x => x.Suspended); + + + + This method is not legacy, but must be on an extension method to avoid + confusing the compiler with the new Action syntax. + + + + + Verifies that a property has been set on the mock, regarless of its value. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + Expression to verify. + The mock instance. + Mocked type. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Verifies that a property has been set on the mock, specifying a failure + error message. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + Expression to verify. + Message to show if verification fails. + The mock instance. + Mocked type. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Verifies that a property has been set on the mock, regardless + of the value but only the specified number of times. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + The invocation was not call the times specified by + . + The mock instance. + Mocked type. + The number of times a method is allowed to be called. + Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Verifies that a property has been set on the mock, regardless + of the value but only the specified number of times, and specifying a failure + error message. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + The invocation was not call the times specified by + . + The mock instance. + Mocked type. + The number of times a method is allowed to be called. + Message to show if verification fails. + Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Allows setups to be specified for protected members by using their + name as a string, rather than strong-typing them which is not possible + due to their visibility. + + + + + Specifies a setup for a void method invocation with the given + , optionally specifying arguments for the method call. + + The name of the void method to be invoked. + The optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + + + + Specifies a setup for an invocation on a property or a non void method with the given + , optionally specifying arguments for the method call. + + The name of the method or property to be invoked. + The optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + The return type of the method or property. + + + + Specifies a setup for an invocation on a property getter with the given + . + + The name of the property. + The type of the property. + + + + Specifies a setup for an invocation on a property setter with the given + . + + The name of the property. + The property value. If argument matchers are used, + remember to use rather than . + The type of the property. + + + + Specifies a verify for a void method with the given , + optionally specifying arguments for the method call. Use in conjuntion with the default + . + + The invocation was not call the times specified by + . + The name of the void method to be verified. + The number of times a method is allowed to be called. + The optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + + + + Specifies a verify for an invocation on a property or a non void method with the given + , optionally specifying arguments for the method call. + + The invocation was not call the times specified by + . + The name of the method or property to be invoked. + The optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + The number of times a method is allowed to be called. + The type of return value from the expression. + + + + Specifies a verify for an invocation on a property getter with the given + . + The invocation was not call the times specified by + . + + The name of the property. + The number of times a method is allowed to be called. + The type of the property. + + + + Specifies a setup for an invocation on a property setter with the given + . + + The invocation was not call the times specified by + . + The name of the property. + The number of times a method is allowed to be called. + The property value. + The type of the property. If argument matchers are used, + remember to use rather than . + + + + Allows the specification of a matching condition for an + argument in a protected member setup, rather than a specific + argument value. "ItExpr" refers to the argument being matched. + + + Use this variant of argument matching instead of + for protected setups. + This class allows the setup to match a method invocation + with an arbitrary value, with a value in a specified range, or + even one that matches a given predicate, or null. + + + + + Matches a null value of the given type. + + + Required for protected mocks as the null value cannot be used + directly as it prevents proper method overload selection. + + + + // Throws an exception for a call to Remove with a null string value. + mock.Protected() + .Setup("Remove", ItExpr.IsNull<string>()) + .Throws(new InvalidOperationException()); + + + Type of the value. + + + + Matches any value of the given type. + + + Typically used when the actual argument value for a method + call is not relevant. + + + + // Throws an exception for a call to Remove with any string value. + mock.Protected() + .Setup("Remove", ItExpr.IsAny<string>()) + .Throws(new InvalidOperationException()); + + + Type of the value. + + + + Matches any value that satisfies the given predicate. + + Type of the argument to check. + The predicate used to match the method argument. + + Allows the specification of a predicate to perform matching + of method call arguments. + + + This example shows how to return the value 1 whenever the argument to the + Do method is an even number. + + mock.Protected() + .Setup("Do", ItExpr.Is<int>(i => i % 2 == 0)) + .Returns(1); + + This example shows how to throw an exception if the argument to the + method is a negative number: + + mock.Protected() + .Setup("GetUser", ItExpr.Is<int>(i => i < 0)) + .Throws(new ArgumentException()); + + + + + + Matches any value that is in the range specified. + + Type of the argument to check. + The lower bound of the range. + The upper bound of the range. + The kind of range. See . + + The following example shows how to expect a method call + with an integer argument within the 0..100 range. + + mock.Protected() + .Setup("HasInventory", + ItExpr.IsAny<string>(), + ItExpr.IsInRange(0, 100, Range.Inclusive)) + .Returns(false); + + + + + + Matches a string argument if it matches the given regular expression pattern. + + The pattern to use to match the string argument value. + + The following example shows how to expect a call to a method where the + string argument matches the given regular expression: + + mock.Protected() + .Setup("Check", ItExpr.IsRegex("[a-z]+")) + .Returns(1); + + + + + + Matches a string argument if it matches the given regular expression pattern. + + The pattern to use to match the string argument value. + The options used to interpret the pattern. + + The following example shows how to expect a call to a method where the + string argument matches the given regular expression, in a case insensitive way: + + mock.Protected() + .Setup("Check", ItExpr.IsRegex("[a-z]+", RegexOptions.IgnoreCase)) + .Returns(1); + + + + + + Enables the Protected() method on , + allowing setups to be set for protected members by using their + name as a string, rather than strong-typing them which is not possible + due to their visibility. + + + + + Enable protected setups for the mock. + + Mocked object type. Typically omitted as it can be inferred from the mock instance. + The mock to set the protected setups on. + + + + + + + + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Mock type has already been initialized by accessing its Object property. Adding interfaces must be done before that.. + + + + + Looks up a localized string similar to Value cannot be an empty string.. + + + + + Looks up a localized string similar to Can only add interfaces to the mock.. + + + + + Looks up a localized string similar to Can't set return value for void method {0}.. + + + + + Looks up a localized string similar to Constructor arguments cannot be passed for interface mocks.. + + + + + Looks up a localized string similar to A matching constructor for the given arguments was not found on the mocked type.. + + + + + Looks up a localized string similar to Could not locate event for attach or detach method {0}.. + + + + + Looks up a localized string similar to Expression {0} involves a field access, which is not supported. Use properties instead.. + + + + + Looks up a localized string similar to Type to mock must be an interface or an abstract or non-sealed class. . + + + + + Looks up a localized string similar to Cannot retrieve a mock with the given object type {0} as it's not the main type of the mock or any of its additional interfaces. + Please cast the argument to one of the supported types: {1}. + Remember that there's no generics covariance in the CLR, so your object must be one of these types in order for the call to succeed.. + + + + + Looks up a localized string similar to The equals ("==" or "=" in VB) and the conditional 'and' ("&&" or "AndAlso" in VB) operators are the only ones supported in the query specification expression. Unsupported expression: {0}. + + + + + Looks up a localized string similar to LINQ method '{0}' not supported.. + + + + + Looks up a localized string similar to Expression contains a call to a method which is not virtual (overridable in VB) or abstract. Unsupported expression: {0}. + + + + + Looks up a localized string similar to Member {0}.{1} does not exist.. + + + + + Looks up a localized string similar to Method {0}.{1} is public. Use strong-typed Expect overload instead: + mock.Setup(x => x.{1}()); + . + + + + + Looks up a localized string similar to {0} invocation failed with mock behavior {1}. + {2}. + + + + + Looks up a localized string similar to Expected only {0} calls to {1}.. + + + + + Looks up a localized string similar to Expected only one call to {0}.. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at least {2} times, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at least once, but was never performed: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at most {3} times, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at most once, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock between {2} and {3} times (Exclusive), but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock between {2} and {3} times (Inclusive), but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock exactly {2} times, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock should never have been performed, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock once, but was {4} times: {1}. + + + + + Looks up a localized string similar to All invocations on the mock must have a corresponding setup.. + + + + + Looks up a localized string similar to Object instance was not created by Moq.. + + + + + Looks up a localized string similar to Out expression must evaluate to a constant value.. + + + + + Looks up a localized string similar to Property {0}.{1} does not have a getter.. + + + + + Looks up a localized string similar to Property {0}.{1} does not exist.. + + + + + Looks up a localized string similar to Property {0}.{1} is write-only.. + + + + + Looks up a localized string similar to Property {0}.{1} is read-only.. + + + + + Looks up a localized string similar to Property {0}.{1} does not have a setter.. + + + + + Looks up a localized string similar to Cannot raise a mocked event unless it has been associated (attached) to a concrete event in a mocked object.. + + + + + Looks up a localized string similar to Ref expression must evaluate to a constant value.. + + + + + Looks up a localized string similar to Invocation needs to return a value and therefore must have a corresponding setup that provides it.. + + + + + Looks up a localized string similar to A lambda expression is expected as the argument to It.Is<T>.. + + + + + Looks up a localized string similar to Invocation {0} should not have been made.. + + + + + Looks up a localized string similar to Expression is not a method invocation: {0}. + + + + + Looks up a localized string similar to Expression is not a property access: {0}. + + + + + Looks up a localized string similar to Expression is not a property setter invocation.. + + + + + Looks up a localized string similar to Expression references a method that does not belong to the mocked object: {0}. + + + + + Looks up a localized string similar to Invalid setup on a non-virtual (overridable in VB) member: {0}. + + + + + Looks up a localized string similar to Type {0} does not implement required interface {1}. + + + + + Looks up a localized string similar to Type {0} does not from required type {1}. + + + + + Looks up a localized string similar to To specify a setup for public property {0}.{1}, use the typed overloads, such as: + mock.Setup(x => x.{1}).Returns(value); + mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one + mock.SetupSet(x => x.{1}).Callback(callbackDelegate); + . + + + + + Looks up a localized string similar to Unsupported expression: {0}. + + + + + Looks up a localized string similar to Only property accesses are supported in intermediate invocations on a setup. Unsupported expression {0}.. + + + + + Looks up a localized string similar to Expression contains intermediate property access {0}.{1} which is of type {2} and cannot be mocked. Unsupported expression {3}.. + + + + + Looks up a localized string similar to Setter expression cannot use argument matchers that receive parameters.. + + + + + Looks up a localized string similar to Member {0} is not supported for protected mocking.. + + + + + Looks up a localized string similar to Setter expression can only use static custom matchers.. + + + + + Looks up a localized string similar to The following setups were not matched: + {0}. + + + + + Looks up a localized string similar to Invalid verify on a non-virtual (overridable in VB) member: {0}. + + + + + Kind of range to use in a filter specified through + . + + + + + The range includes the to and + from values. + + + + + The range does not include the to and + from values. + + + + + Helper for sequencing return values in the same method. + + + + + Return a sequence of values, once per call. + + + + + Defines the number of invocations allowed by a mocked method. + + + + + Specifies that a mocked method should be invoked times as minimum. + The minimun number of times.An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked one time as minimum. + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked time as maximun. + The maximun number of times.An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked one time as maximun. + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked between and + times. + The minimun number of times.The maximun number of times. + The kind of range. See . + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked exactly times. + The times that a method or property can be called.An object defining the allowed number of invocations. + + + + Specifies that a mocked method should not be invoked. + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked exactly one time. + An object defining the allowed number of invocations. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether two specified objects have the same value. + + The first . + + The second . + + true if the value of left is the same as the value of right; otherwise, false. + + + + + Determines whether two specified objects have different values. + + The first . + + The second . + + true if the value of left is different from the value of right; otherwise, false. + + + + diff --git a/packages/NUnit.2.5.10.11092/Logo.ico b/packages/NUnit.2.5.10.11092/Logo.ico new file mode 100644 index 0000000..13c4ff9 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/Logo.ico differ diff --git a/packages/NUnit.2.5.10.11092/NUnit.2.5.10.11092.nupkg b/packages/NUnit.2.5.10.11092/NUnit.2.5.10.11092.nupkg new file mode 100644 index 0000000..7e9a777 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/NUnit.2.5.10.11092.nupkg differ diff --git a/packages/NUnit.2.5.10.11092/NUnitFitTests.html b/packages/NUnit.2.5.10.11092/NUnitFitTests.html new file mode 100644 index 0000000..b7eb5c9 --- /dev/null +++ b/packages/NUnit.2.5.10.11092/NUnitFitTests.html @@ -0,0 +1,277 @@ + + + +

NUnit Acceptance Tests

+

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

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

Running the Tests

+

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

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

Platform and CLR Version

+ + + + +
NUnit.Fixtures.PlatformInfo
+

Verify Unit Tests

+

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

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

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

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

Code Snippet Tests

+

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

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

Summary Information

+ + + + +
fit.Summary
+ + diff --git a/packages/NUnit.2.5.10.11092/fit-license.txt b/packages/NUnit.2.5.10.11092/fit-license.txt new file mode 100644 index 0000000..af37532 --- /dev/null +++ b/packages/NUnit.2.5.10.11092/fit-license.txt @@ -0,0 +1,342 @@ + + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. \ No newline at end of file diff --git a/packages/NUnit.2.5.10.11092/lib/nunit.framework.dll b/packages/NUnit.2.5.10.11092/lib/nunit.framework.dll new file mode 100644 index 0000000..6856e51 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/lib/nunit.framework.dll differ diff --git a/packages/NUnit.2.5.10.11092/lib/nunit.framework.xml b/packages/NUnit.2.5.10.11092/lib/nunit.framework.xml new file mode 100644 index 0000000..c98e5ad --- /dev/null +++ b/packages/NUnit.2.5.10.11092/lib/nunit.framework.xml @@ -0,0 +1,10407 @@ + + + + nunit.framework + + + + + Attribute used to apply a category to a test + + + + + The name of the category + + + + + Construct attribute for a given category based on + a name. The name may not contain the characters ',', + '+', '-' or '!'. However, this is not checked in the + constructor since it would cause an error to arise at + as the test was loaded without giving a clear indication + of where the problem is located. The error is handled + in NUnitFramework.cs by marking the test as not + runnable. + + The name of the category + + + + Protected constructor uses the Type name as the name + of the category. + + + + + The name of the category + + + + + Used to mark a field for use as a datapoint when executing a theory + within the same fixture that requires an argument of the field's Type. + + + + + Used to mark an array as containing a set of datapoints to be used + executing a theory within the same fixture that requires an argument + of the Type of the array elements. + + + + + Attribute used to provide descriptive text about a + test case or fixture. + + + + + Construct the attribute + + Text describing the test + + + + Gets the test description + + + + + Enumeration indicating how the expected message parameter is to be used + + + + Expect an exact match + + + Expect a message containing the parameter string + + + Match the regular expression provided as a parameter + + + Expect a message that starts with the parameter string + + + + ExpectedExceptionAttribute + + + + + + Constructor for a non-specific exception + + + + + Constructor for a given type of exception + + The type of the expected exception + + + + Constructor for a given exception name + + The full name of the expected exception + + + + Gets or sets the expected exception type + + + + + Gets or sets the full Type name of the expected exception + + + + + Gets or sets the expected message text + + + + + Gets or sets the user message displayed in case of failure + + + + + Gets or sets the type of match to be performed on the expected message + + + + + Gets the name of a method to be used as an exception handler + + + + + ExplicitAttribute marks a test or test fixture so that it will + only be run if explicitly executed from the gui or command line + or if it is included by use of a filter. The test will not be + run simply because an enclosing suite is run. + + + + + Default constructor + + + + + Constructor with a reason + + The reason test is marked explicit + + + + The reason test is marked explicit + + + + + Attribute used to mark a test that is to be ignored. + Ignored tests result in a warning message when the + tests are run. + + + + + Constructs the attribute without giving a reason + for ignoring the test. + + + + + Constructs the attribute giving a reason for ignoring the test + + The reason for ignoring the test + + + + The reason for ignoring a test + + + + + Abstract base for Attributes that are used to include tests + in the test run based on environmental settings. + + + + + Constructor with no included items specified, for use + with named property syntax. + + + + + Constructor taking one or more included items + + Comma-delimited list of included items + + + + Name of the item that is needed in order for + a test to run. Multiple itemss may be given, + separated by a comma. + + + + + Name of the item to be excluded. Multiple items + may be given, separated by a comma. + + + + + The reason for including or excluding the test + + + + + PlatformAttribute is used to mark a test fixture or an + individual method as applying to a particular platform only. + + + + + Constructor with no platforms specified, for use + with named property syntax. + + + + + Constructor taking one or more platforms + + Comma-deliminted list of platforms + + + + CultureAttribute is used to mark a test fixture or an + individual method as applying to a particular Culture only. + + + + + Constructor with no cultures specified, for use + with named property syntax. + + + + + Constructor taking one or more cultures + + Comma-deliminted list of cultures + + + + Marks a test to use a combinatorial join of any argument data + provided. NUnit will create a test case for every combination of + the arguments provided. This can result in a large number of test + cases and so should be used judiciously. This is the default join + type, so the attribute need not be used except as documentation. + + + + + PropertyAttribute is used to attach information to a test as a name/value pair.. + + + + + Construct a PropertyAttribute with a name and string value + + The name of the property + The property value + + + + Construct a PropertyAttribute with a name and int value + + The name of the property + The property value + + + + Construct a PropertyAttribute with a name and double value + + The name of the property + The property value + + + + Constructor for derived classes that set the + property dictionary directly. + + + + + Constructor for use by derived classes that use the + name of the type as the property name. Derived classes + must ensure that the Type of the property value is + a standard type supported by the BCL. Any custom + types will cause a serialization Exception when + in the client. + + + + + Gets the property dictionary for this attribute + + + + + Default constructor + + + + + Marks a test to use pairwise join of any argument data provided. + NUnit will attempt too excercise every pair of argument values at + least once, using as small a number of test cases as it can. With + only two arguments, this is the same as a combinatorial join. + + + + + Default constructor + + + + + Marks a test to use a sequential join of any argument data + provided. NUnit will use arguements for each parameter in + sequence, generating test cases up to the largest number + of argument values provided and using null for any arguments + for which it runs out of values. Normally, this should be + used with the same number of arguments for each parameter. + + + + + Default constructor + + + + + Summary description for MaxTimeAttribute. + + + + + Construct a MaxTimeAttribute, given a time in milliseconds. + + The maximum elapsed time in milliseconds + + + + RandomAttribute is used to supply a set of random values + to a single parameter of a parameterized test. + + + + + ValuesAttribute is used to provide literal arguments for + an individual parameter of a test. + + + + + Abstract base class for attributes that apply to parameters + and supply data for the parameter. + + + + + Gets the data to be provided to the specified parameter + + + + + The collection of data to be returned. Must + be set by any derived attribute classes. + We use an object[] so that the individual + elements may have their type changed in GetData + if necessary. + + + + + Construct with one argument + + + + + + Construct with two arguments + + + + + + + Construct with three arguments + + + + + + + + Construct with an array of arguments + + + + + + Get the collection of values to be used as arguments + + + + + Construct a set of doubles from 0.0 to 1.0, + specifying only the count. + + + + + + Construct a set of doubles from min to max + + + + + + + + Construct a set of ints from min to max + + + + + + + + Get the collection of values to be used as arguments + + + + + RangeAttribute is used to supply a range of values to an + individual parameter of a parameterized test. + + + + + Construct a range of ints using default step of 1 + + + + + + + Construct a range of ints specifying the step size + + + + + + + + Construct a range of longs + + + + + + + + Construct a range of doubles + + + + + + + + Construct a range of floats + + + + + + + + RepeatAttribute may be applied to test case in order + to run it multiple times. + + + + + Construct a RepeatAttribute + + The number of times to run the test + + + + RequiredAddinAttribute may be used to indicate the names of any addins + that must be present in order to run some or all of the tests in an + assembly. If the addin is not loaded, the entire assembly is marked + as NotRunnable. + + + + + Initializes a new instance of the class. + + The required addin. + + + + Gets the name of required addin. + + The required addin name. + + + + Summary description for SetCultureAttribute. + + + + + Construct given the name of a culture + + + + + + Summary description for SetUICultureAttribute. + + + + + Construct given the name of a culture + + + + + + Attribute used to mark a class that contains one-time SetUp + and/or TearDown methods that apply to all the tests in a + namespace or an assembly. + + + + + SetUpFixtureAttribute is used to identify a SetUpFixture + + + + + Attribute used to mark a static (shared in VB) property + that returns a list of tests. + + + + + Attribute used to identify a method that is called + immediately after each test is run. The method is + guaranteed to be called, even if an exception is thrown. + + + + + Adding this attribute to a method within a + class makes the method callable from the NUnit test runner. There is a property + called Description which is optional which you can provide a more detailed test + description. This class cannot be inherited. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + publc void TestDescriptionMethod() + {} + } + + + + + + Descriptive text for this test + + + + + TestCaseAttribute is used to mark parameterized test cases + and provide them with their arguments. + + + + + The ITestCaseData interface is implemented by a class + that is able to return complete testcases for use by + a parameterized test method. + + NOTE: This interface is used in both the framework + and the core, even though that results in two different + types. However, sharing the source code guarantees that + the various implementations will be compatible and that + the core is able to reflect successfully over the + framework implementations of ITestCaseData. + + + + + Gets the argument list to be provided to the test + + + + + Gets the expected result + + + + + Gets the expected exception Type + + + + + Gets the FullName of the expected exception + + + + + Gets the name to be used for the test + + + + + Gets the description of the test + + + + + Gets a value indicating whether this is ignored. + + true if ignored; otherwise, false. + + + + Gets the ignore reason. + + The ignore reason. + + + + Construct a TestCaseAttribute with a list of arguments. + This constructor is not CLS-Compliant + + + + + + Construct a TestCaseAttribute with a single argument + + + + + + Construct a TestCaseAttribute with a two arguments + + + + + + + Construct a TestCaseAttribute with a three arguments + + + + + + + + Gets the list of arguments to a test case + + + + + Gets or sets the expected result. + + The result. + + + + Gets a list of categories associated with this test; + + + + + Gets or sets the category associated with this test. + May be a single category or a comma-separated list. + + + + + Gets or sets the expected exception. + + The expected exception. + + + + Gets or sets the name the expected exception. + + The expected name of the exception. + + + + Gets or sets the expected message of the expected exception + + The expected message of the exception. + + + + Gets or sets the type of match to be performed on the expected message + + + + + Gets or sets the description. + + The description. + + + + Gets or sets the name of the test. + + The name of the test. + + + + Gets or sets the ignored status of the test + + + + + Gets or sets the ignored status of the test + + + + + Gets the ignore reason. + + The ignore reason. + + + + FactoryAttribute indicates the source to be used to + provide test cases for a test method. + + + + + Construct with the name of the factory - for use with languages + that don't support params arrays. + + An array of the names of the factories that will provide data + + + + Construct with a Type and name - for use with languages + that don't support params arrays. + + The Type that will provide data + The name of the method, property or field that will provide data + + + + The name of a the method, property or fiend to be used as a source + + + + + A Type to be used as a source + + + + + [TestFixture] + public class ExampleClass + {} + + + + + Default constructor + + + + + Construct with a object[] representing a set of arguments. + In .NET 2.0, the arguments may later be separated into + type arguments and constructor arguments. + + + + + + Descriptive text for this fixture + + + + + Gets and sets the category for this fixture. + May be a comma-separated list of categories. + + + + + Gets a list of categories for this fixture + + + + + The arguments originally provided to the attribute + + + + + Gets or sets a value indicating whether this should be ignored. + + true if ignore; otherwise, false. + + + + Gets or sets the ignore reason. May set Ignored as a side effect. + + The ignore reason. + + + + Get or set the type arguments. If not set + explicitly, any leading arguments that are + Types are taken as type arguments. + + + + + Attribute used to identify a method that is + called before any tests in a fixture are run. + + + + + Attribute used to identify a method that is called after + all the tests in a fixture have run. The method is + guaranteed to be called, even if an exception is thrown. + + + + + Adding this attribute to a method within a + class makes the method callable from the NUnit test runner. There is a property + called Description which is optional which you can provide a more detailed test + description. This class cannot be inherited. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + publc void TestDescriptionMethod() + {} + } + + + + + + WUsed on a method, marks the test with a timeout value in milliseconds. + The test will be run in a separate thread and is cancelled if the timeout + is exceeded. Used on a method or assembly, sets the default timeout + for all contained test methods. + + + + + Construct a TimeoutAttribute given a time in milliseconds + + The timeout value in milliseconds + + + + Marks a test that must run in the STA, causing it + to run in a separate thread if necessary. + + On methods, you may also use STAThreadAttribute + to serve the same purpose. + + + + + Construct a RequiresSTAAttribute + + + + + Marks a test that must run in the MTA, causing it + to run in a separate thread if necessary. + + On methods, you may also use MTAThreadAttribute + to serve the same purpose. + + + + + Construct a RequiresMTAAttribute + + + + + Marks a test that must run on a separate thread. + + + + + Construct a RequiresThreadAttribute + + + + + Construct a RequiresThreadAttribute, specifying the apartment + + + + + ValueSourceAttribute indicates the source to be used to + provide data for one parameter of a test method. + + + + + Construct with the name of the factory - for use with languages + that don't support params arrays. + + The name of the data source to be used + + + + Construct with a Type and name - for use with languages + that don't support params arrays. + + The Type that will provide data + The name of the method, property or field that will provide data + + + + The name of a the method, property or fiend to be used as a source + + + + + A Type to be used as a source + + + + + AttributeExistsConstraint tests for the presence of a + specified attribute on a Type. + + + + + The Constraint class is the base of all built-in constraints + within NUnit. It provides the operator overloads used to combine + constraints. + + + + + The IConstraintExpression interface is implemented by all + complete and resolvable constraints and expressions. + + + + + Return the top-level constraint for this expression + + + + + + Static UnsetObject used to detect derived constraints + failing to set the actual value. + + + + + The actual value being tested against a constraint + + + + + The display name of this Constraint for use by ToString() + + + + + Argument fields used by ToString(); + + + + + The builder holding this constraint + + + + + Construct a constraint with no arguments + + + + + Construct a constraint with one argument + + + + + Construct a constraint with two arguments + + + + + Sets the ConstraintBuilder holding this constraint + + + + + Write the failure message to the MessageWriter provided + as an argument. The default implementation simply passes + the constraint and the actual value to the writer, which + then displays the constraint description and the value. + + Constraints that need to provide additional details, + such as where the error occured can override this. + + The MessageWriter on which to display the message + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Test whether the constraint is satisfied by an + ActualValueDelegate that returns the value to be tested. + The default implementation simply evaluates the delegate + but derived classes may override it to provide for delayed + processing. + + An ActualValueDelegate + True for success, false for failure + + + + Test whether the constraint is satisfied by a given reference. + The default implementation simply dereferences the value but + derived classes may override it to provide for delayed processing. + + A reference to the value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Default override of ToString returns the constraint DisplayName + followed by any arguments within angle brackets. + + + + + + Returns the string representation of this constraint + + + + + This operator creates a constraint that is satisfied only if both + argument constraints are satisfied. + + + + + This operator creates a constraint that is satisfied if either + of the argument constraints is satisfied. + + + + + This operator creates a constraint that is satisfied if the + argument constraint is not satisfied. + + + + + Returns a DelayedConstraint with the specified delay time. + + The delay in milliseconds. + + + + + Returns a DelayedConstraint with the specified delay time + and polling interval. + + The delay in milliseconds. + The interval at which to test the constraint. + + + + + The display name of this Constraint for use by ToString(). + The default value is the name of the constraint with + trailing "Constraint" removed. Derived classes may set + this to another name in their constructors. + + + + + Returns a ConstraintExpression by appending And + to the current constraint. + + + + + Returns a ConstraintExpression by appending And + to the current constraint. + + + + + Returns a ConstraintExpression by appending Or + to the current constraint. + + + + + Class used to detect any derived constraints + that fail to set the actual value in their + Matches override. + + + + + Constructs an AttributeExistsConstraint for a specific attribute Type + + + + + + Tests whether the object provides the expected attribute. + + A Type, MethodInfo, or other ICustomAttributeProvider + True if the expected attribute is present, otherwise false + + + + Writes the description of the constraint to the specified writer + + + + + AttributeConstraint tests that a specified attribute is present + on a Type or other provider and that the value of the attribute + satisfies some other constraint. + + + + + Abstract base class used for prefixes + + + + + The base constraint + + + + + Construct given a base constraint + + + + + + Constructs an AttributeConstraint for a specified attriute + Type and base constraint. + + + + + + + Determines whether the Type or other provider has the + expected attribute and if its value matches the + additional constraint specified. + + + + + Writes a description of the attribute to the specified writer. + + + + + Writes the actual value supplied to the specified writer. + + + + + Returns a string representation of the constraint. + + + + + BasicConstraint is the abstract base for constraints that + perform a simple comparison to a constant value. + + + + + Initializes a new instance of the class. + + The expected. + The description. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + NullConstraint tests that the actual value is null + + + + + Initializes a new instance of the class. + + + + + TrueConstraint tests that the actual value is true + + + + + Initializes a new instance of the class. + + + + + FalseConstraint tests that the actual value is false + + + + + Initializes a new instance of the class. + + + + + NaNConstraint tests that the actual value is a double or float NaN + + + + + Test that the actual value is an NaN + + + + + + + Write the constraint description to a specified writer + + + + + + BinaryConstraint is the abstract base of all constraints + that combine two other constraints in some fashion. + + + + + The first constraint being combined + + + + + The second constraint being combined + + + + + Construct a BinaryConstraint from two other constraints + + The first constraint + The second constraint + + + + AndConstraint succeeds only if both members succeed. + + + + + Create an AndConstraint from two other constraints + + The first constraint + The second constraint + + + + Apply both member constraints to an actual value, succeeding + succeeding only if both of them succeed. + + The actual value + True if the constraints both succeeded + + + + Write a description for this contraint to a MessageWriter + + The MessageWriter to receive the description + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + OrConstraint succeeds if either member succeeds + + + + + Create an OrConstraint from two other constraints + + The first constraint + The second constraint + + + + Apply the member constraints to an actual value, succeeding + succeeding as soon as one of them succeeds. + + The actual value + True if either constraint succeeded + + + + Write a description for this contraint to a MessageWriter + + The MessageWriter to receive the description + + + + CollectionConstraint is the abstract base class for + constraints that operate on collections. + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Determines whether the specified enumerable is empty. + + The enumerable. + + true if the specified enumerable is empty; otherwise, false. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Protected method to be implemented by derived classes + + + + + + + CollectionItemsEqualConstraint is the abstract base class for all + collection constraints that apply some notion of item equality + as a part of their operation. + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied Comparison object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Compares two collection members for equality + + + + + Return a new CollectionTally for use in making tests + + The collection to be included in the tally + + + + Flag the constraint to ignore case and return self. + + + + + EmptyCollectionConstraint tests whether a collection is empty. + + + + + Check that the collection is empty + + + + + + + Write the constraint description to a MessageWriter + + + + + + UniqueItemsConstraint tests whether all the items in a + collection are unique. + + + + + Check that all items are unique. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + CollectionContainsConstraint is used to test whether a collection + contains an expected object as a member. + + + + + Construct a CollectionContainsConstraint + + + + + + Test whether the expected item is contained in the collection + + + + + + + Write a descripton of the constraint to a MessageWriter + + + + + + CollectionEquivalentCOnstraint is used to determine whether two + collections are equivalent. + + + + + Construct a CollectionEquivalentConstraint + + + + + + Test whether two collections are equivalent + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + CollectionSubsetConstraint is used to determine whether + one collection is a subset of another + + + + + Construct a CollectionSubsetConstraint + + The collection that the actual value is expected to be a subset of + + + + Test whether the actual collection is a subset of + the expected collection provided. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + CollectionOrderedConstraint is used to test whether a collection is ordered. + + + + + Construct a CollectionOrderedConstraint + + + + + Modifies the constraint to use an IComparer and returns self. + + + + + Modifies the constraint to use an IComparer<T> and returns self. + + + + + Modifies the constraint to use a Comparison<T> and returns self. + + + + + Modifies the constraint to test ordering by the value of + a specified property and returns self. + + + + + Test whether the collection is ordered + + + + + + + Write a description of the constraint to a MessageWriter + + + + + + Returns the string representation of the constraint. + + + + + + If used performs a reverse comparison + + + + + CollectionTally counts (tallies) the number of + occurences of each object in one or more enumerations. + + + + + Construct a CollectionTally object from a comparer and a collection + + + + + Try to remove an object from the tally + + The object to remove + True if successful, false if the object was not found + + + + Try to remove a set of objects from the tally + + The objects to remove + True if successful, false if any object was not found + + + + The number of objects remaining in the tally + + + + + ComparisonAdapter class centralizes all comparisons of + values in NUnit, adapting to the use of any provided + IComparer, IComparer<T> or Comparison<T> + + + + + Returns a ComparisonAdapter that wraps an IComparer + + + + + Returns a ComparisonAdapter that wraps an IComparer<T> + + + + + Returns a ComparisonAdapter that wraps a Comparison<T> + + + + + Compares two objects + + + + + Gets the default ComparisonAdapter, which wraps an + NUnitComparer object. + + + + + Construct a ComparisonAdapter for an IComparer + + + + + Compares two objects + + + + + + + + Construct a default ComparisonAdapter + + + + + ComparisonAdapter<T> extends ComparisonAdapter and + allows use of an IComparer<T> or Comparison<T> + to actually perform the comparison. + + + + + Construct a ComparisonAdapter for an IComparer<T> + + + + + Compare a Type T to an object + + + + + Construct a ComparisonAdapter for a Comparison<T> + + + + + Compare a Type T to an object + + + + + Abstract base class for constraints that compare values to + determine if one is greater than, equal to or less than + the other. + + + + + The value against which a comparison is to be made + + + + + If true, less than returns success + + + + + if true, equal returns success + + + + + if true, greater than returns success + + + + + The predicate used as a part of the description + + + + + ComparisonAdapter to be used in making the comparison + + + + + Initializes a new instance of the class. + + The value against which to make a comparison. + if set to true less succeeds. + if set to true equal succeeds. + if set to true greater succeeds. + String used in describing the constraint. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Modifies the constraint to use an IComparer and returns self + + + + + Modifies the constraint to use an IComparer<T> and returns self + + + + + Modifies the constraint to use a Comparison<T> and returns self + + + + + Tests whether a value is greater than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Tests whether a value is greater than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Tests whether a value is less than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Tests whether a value is less than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Delegate used to delay evaluation of the actual value + to be used in evaluating a constraint + + + + + ConstraintBuilder maintains the stacks that are used in + processing a ConstraintExpression. An OperatorStack + is used to hold operators that are waiting for their + operands to be reognized. a ConstraintStack holds + input constraints as well as the results of each + operator applied. + + + + + Initializes a new instance of the class. + + + + + Appends the specified operator to the expression by first + reducing the operator stack and then pushing the new + operator on the stack. + + The operator to push. + + + + Appends the specified constraint to the expresson by pushing + it on the constraint stack. + + The constraint to push. + + + + Sets the top operator right context. + + The right context. + + + + Reduces the operator stack until the topmost item + precedence is greater than or equal to the target precedence. + + The target precedence. + + + + Resolves this instance, returning a Constraint. If the builder + is not currently in a resolvable state, an exception is thrown. + + The resolved constraint + + + + Gets a value indicating whether this instance is resolvable. + + + true if this instance is resolvable; otherwise, false. + + + + + OperatorStack is a type-safe stack for holding ConstraintOperators + + + + + Initializes a new instance of the class. + + The builder. + + + + Pushes the specified operator onto the stack. + + The op. + + + + Pops the topmost operator from the stack. + + + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost operator without modifying the stack. + + The top. + + + + ConstraintStack is a type-safe stack for holding Constraints + + + + + Initializes a new instance of the class. + + The builder. + + + + Pushes the specified constraint. As a side effect, + the constraint's builder field is set to the + ConstraintBuilder owning this stack. + + The constraint. + + + + Pops this topmost constrait from the stack. + As a side effect, the constraint's builder + field is set to null. + + + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost constraint without modifying the stack. + + The topmost constraint + + + + ConstraintExpression represents a compound constraint in the + process of being constructed from a series of syntactic elements. + + Individual elements are appended to the expression as they are + reognized. Once an actual Constraint is appended, the expression + returns a resolvable Constraint. + + + + + ConstraintExpressionBase is the abstract base class for the + generated ConstraintExpression class, which represents a + compound constraint in the process of being constructed + from a series of syntactic elements. + + NOTE: ConstraintExpressionBase is aware of some of its + derived classes, which is an apparent violation of + encapsulation. Ideally, these classes would be a + single class, but they must be separated in order to + allow parts to be generated under .NET 1.x and to + provide proper user feedback in syntactically + aware IDEs. + + + + + The ConstraintBuilder holding the elements recognized so far + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the + class passing in a ConstraintBuilder, which may be pre-populated. + + The builder. + + + + Returns a string representation of the expression as it + currently stands. This should only be used for testing, + since it has the side-effect of resolving the expression. + + + + + + Appends an operator to the expression and returns the + resulting expression itself. + + + + + Appends a self-resolving operator to the expression and + returns a new ResolvableConstraintExpression. + + + + + Appends a constraint to the expression and returns that + constraint, which is associated with the current state + of the expression being built. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the + class passing in a ConstraintBuilder, which may be pre-populated. + + The builder. + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns the constraint provided as an argument - used to allow custom + custom constraints to easily participate in the syntax. + + + + + Returns the constraint provided as an argument - used to allow custom + custom constraints to easily participate in the syntax. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new ContainsConstraint. This constraint + will, in turn, make use of the appropriate second-level + constraint, depending on the type of the actual argument. + This overload is only used if the item sought is a string, + since any other type implies that we are looking for a + collection member. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + With is currently a NOP - reserved for future use. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new ContainsConstraint. This constraint + will, in turn, make use of the appropriate second-level + constraint, depending on the type of the actual argument. + This overload is only used if the item sought is a string, + since any other type implies that we are looking for a + collection member. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that fails if the actual + value matches the pattern supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + The ConstraintOperator class is used internally by a + ConstraintBuilder to represent an operator that + modifies or combines constraints. + + Constraint operators use left and right precedence + values to determine whether the top operator on the + stack should be reduced before pushing a new operator. + + + + + The precedence value used when the operator + is about to be pushed to the stack. + + + + + The precedence value used when the operator + is on the top of the stack. + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + The syntax element preceding this operator + + + + + The syntax element folowing this operator + + + + + The precedence value used when the operator + is about to be pushed to the stack. + + + + + The precedence value used when the operator + is on the top of the stack. + + + + + PrefixOperator takes a single constraint and modifies + it's action in some way. + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + Returns the constraint created by applying this + prefix to another constraint. + + + + + + + Negates the test of the constraint it wraps. + + + + + Constructs a new NotOperator + + + + + Returns a NotConstraint applied to its argument. + + + + + Abstract base for operators that indicate how to + apply a constraint to items in a collection. + + + + + Constructs a CollectionOperator + + + + + Represents a constraint that succeeds if all the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + they all succeed. + + + + + Represents a constraint that succeeds if any of the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + any of them succeed. + + + + + Represents a constraint that succeeds if none of the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + none of them succeed. + + + + + Represents a constraint that simply wraps the + constraint provided as an argument, without any + further functionality, but which modifes the + order of evaluation because of its precedence. + + + + + Constructor for the WithOperator + + + + + Returns a constraint that wraps its argument + + + + + Abstract base class for operators that are able to reduce to a + constraint whether or not another syntactic element follows. + + + + + Operator used to test for the presence of a named Property + on an object and optionally apply further tests to the + value of that property. + + + + + Constructs a PropOperator for a particular named property + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + Gets the name of the property to which the operator applies + + + + + Operator that tests for the presence of a particular attribute + on a type and optionally applies further tests to the attribute. + + + + + Construct an AttributeOperator for a particular Type + + The Type of attribute tested + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + Operator that tests that an exception is thrown and + optionally applies further tests to the exception. + + + + + Construct a ThrowsOperator + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + Abstract base class for all binary operators + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + Abstract method that produces a constraint by applying + the operator to its left and right constraint arguments. + + + + + Gets the left precedence of the operator + + + + + Gets the right precedence of the operator + + + + + Operator that requires both it's arguments to succeed + + + + + Construct an AndOperator + + + + + Apply the operator to produce an AndConstraint + + + + + Operator that requires at least one of it's arguments to succeed + + + + + Construct an OrOperator + + + + + Apply the operator to produce an OrConstraint + + + + + ContainsConstraint tests a whether a string contains a substring + or a collection contains an object. It postpones the decision of + which test to use until the type of the actual argument is known. + This allows testing whether a string is contained in a collection + or as a substring of another string using the same syntax. + + + + + Initializes a new instance of the class. + + The expected. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied Comparison object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to ignore case and return self. + + + + + Applies a delay to the match so that a match can be evaluated in the future. + + + + + Creates a new DelayedConstraint + + The inner constraint two decorate + The time interval after which the match is performed + If the value of is less than 0 + + + + Creates a new DelayedConstraint + + The inner constraint two decorate + The time interval after which the match is performed + The time interval used for polling + If the value of is less than 0 + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for if the base constraint fails, false if it succeeds + + + + Test whether the constraint is satisfied by a delegate + + The delegate whose value is to be tested + True for if the base constraint fails, false if it succeeds + + + + Test whether the constraint is satisfied by a given reference. + Overridden to wait for the specified delay period before + calling the base constraint with the dereferenced value. + + A reference to the value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a MessageWriter. + + The writer on which the actual value is displayed + + + + Returns the string representation of the constraint. + + + + + EmptyDirectoryConstraint is used to test that a directory is empty + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + EmptyConstraint tests a whether a string or collection is empty, + postponing the decision about which test is applied until the + type of the actual argument is known. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + EqualConstraint is able to compare an actual value with the + expected value provided in its constructor. Two objects are + considered equal if both are null, or if both have the same + value. NUnit has special semantics for some object types. + + + + + If true, strings in error messages will be clipped + + + + + NUnitEqualityComparer used to test equality. + + + + + Initializes a new instance of the class. + + The expected value. + + + + Flag the constraint to use a tolerance when determining equality. + + Tolerance value to be used + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied Comparison object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write a failure message. Overridden to provide custom + failure messages for EqualConstraint. + + The MessageWriter to write to + + + + Write description of this constraint + + The MessageWriter to write to + + + + Display the failure information for two collections that did not match. + + The MessageWriter on which to display + The expected collection. + The actual collection + The depth of this failure in a set of nested collections + + + + Displays a single line showing the types and sizes of the expected + and actual collections or arrays. If both are identical, the value is + only shown once. + + The MessageWriter on which to display + The expected collection or array + The actual collection or array + The indentation level for the message line + + + + Displays a single line showing the point in the expected and actual + arrays at which the comparison failed. If the arrays have different + structures or dimensions, both values are shown. + + The MessageWriter on which to display + The expected array + The actual array + Index of the failure point in the underlying collections + The indentation level for the message line + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to suppress string clipping + and return self. + + + + + Flag the constraint to compare arrays as collections + and return self. + + + + + Switches the .Within() modifier to interpret its tolerance as + a distance in representable values (see remarks). + + Self. + + Ulp stands for "unit in the last place" and describes the minimum + amount a given value can change. For any integers, an ulp is 1 whole + digit. For floating point values, the accuracy of which is better + for smaller numbers and worse for larger numbers, an ulp depends + on the size of the number. Using ulps for comparison of floating + point results instead of fixed tolerances is safer because it will + automatically compensate for the added inaccuracy of larger numbers. + + + + + Switches the .Within() modifier to interpret its tolerance as + a percentage that the actual values is allowed to deviate from + the expected value. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in days. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in hours. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in minutes. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in seconds. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in milliseconds. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in clock ticks. + + Self + + + + EqualityAdapter class handles all equality comparisons + that use an IEqualityComparer, IEqualityComparer<T> + or a ComparisonAdapter. + + + + + Compares two objects, returning true if they are equal + + + + + Returns an EqualityAdapter that wraps an IComparer. + + + + + Returns an EqualityAdapter that wraps an IEqualityComparer. + + + + + Returns an EqualityAdapter that wraps an IEqualityComparer<T>. + + + + + Returns an EqualityAdapter that wraps an IComparer<T>. + + + + + Returns an EqualityAdapter that wraps a Comparison<T>. + + + + Helper routines for working with floating point numbers + + + The floating point comparison code is based on this excellent article: + http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm + + + "ULP" means Unit in the Last Place and in the context of this library refers to + the distance between two adjacent floating point numbers. IEEE floating point + numbers can only represent a finite subset of natural numbers, with greater + accuracy for smaller numbers and lower accuracy for very large numbers. + + + If a comparison is allowed "2 ulps" of deviation, that means the values are + allowed to deviate by up to 2 adjacent floating point values, which might be + as low as 0.0000001 for small numbers or as high as 10.0 for large numbers. + + + + + Compares two floating point values for equality + First floating point value to be compared + Second floating point value t be compared + + Maximum number of representable floating point values that are allowed to + be between the left and the right floating point values + + True if both numbers are equal or close to being equal + + + Floating point values can only represent a finite subset of natural numbers. + For example, the values 2.00000000 and 2.00000024 can be stored in a float, + but nothing inbetween them. + + + This comparison will count how many possible floating point values are between + the left and the right number. If the number of possible values between both + numbers is less than or equal to maxUlps, then the numbers are considered as + being equal. + + + Implementation partially follows the code outlined here: + http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ + + + + + Compares two double precision floating point values for equality + First double precision floating point value to be compared + Second double precision floating point value t be compared + + Maximum number of representable double precision floating point values that are + allowed to be between the left and the right double precision floating point values + + True if both numbers are equal or close to being equal + + + Double precision floating point values can only represent a limited series of + natural numbers. For example, the values 2.0000000000000000 and 2.0000000000000004 + can be stored in a double, but nothing inbetween them. + + + This comparison will count how many possible double precision floating point + values are between the left and the right number. If the number of possible + values between both numbers is less than or equal to maxUlps, then the numbers + are considered as being equal. + + + Implementation partially follows the code outlined here: + http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ + + + + + + Reinterprets the memory contents of a floating point value as an integer value + + + Floating point value whose memory contents to reinterpret + + + The memory contents of the floating point value interpreted as an integer + + + + + Reinterprets the memory contents of a double precision floating point + value as an integer value + + + Double precision floating point value whose memory contents to reinterpret + + + The memory contents of the double precision floating point value + interpreted as an integer + + + + + Reinterprets the memory contents of an integer as a floating point value + + Integer value whose memory contents to reinterpret + + The memory contents of the integer value interpreted as a floating point value + + + + + Reinterprets the memory contents of an integer value as a double precision + floating point value + + Integer whose memory contents to reinterpret + + The memory contents of the integer interpreted as a double precision + floating point value + + + + Union of a floating point variable and an integer + + + The union's value as a floating point variable + + + The union's value as an integer + + + The union's value as an unsigned integer + + + Union of a double precision floating point variable and a long + + + The union's value as a double precision floating point variable + + + The union's value as a long + + + The union's value as an unsigned long + + + + MessageWriter is the abstract base for classes that write + constraint descriptions and messages in some form. The + class has separate methods for writing various components + of a message, allowing implementations to tailor the + presentation as needed. + + + + + Construct a MessageWriter given a culture + + + + + Method to write single line message with optional args, usually + written to precede the general failure message. + + The message to be written + Any arguments used in formatting the message + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a givel + indentation level. + + The indentation level of the message + The message to be written + Any arguments used in formatting the message + + + + Display Expected and Actual lines for a constraint. This + is called by MessageWriter's default implementation of + WriteMessageTo and provides the generic two-line display. + + The constraint that failed + + + + Display Expected and Actual lines for given values. This + method may be called by constraints that need more control over + the display of actual and expected values than is provided + by the default implementation. + + The expected value + The actual value causing the failure + + + + Display Expected and Actual lines for given values, including + a tolerance value on the Expected line. + + The expected value + The actual value causing the failure + The tolerance within which the test was made + + + + Display the expected and actual string values on separate lines. + If the mismatch parameter is >=0, an additional line is displayed + line containing a caret that points to the mismatch point. + + The expected string value + The actual string value + The point at which the strings don't match or -1 + If true, case is ignored in locating the point where the strings differ + If true, the strings should be clipped to fit the line + + + + Writes the text for a connector. + + The connector. + + + + Writes the text for a predicate. + + The predicate. + + + + Writes the text for an expected value. + + The expected value. + + + + Writes the text for a modifier + + The modifier. + + + + Writes the text for an actual value. + + The actual value. + + + + Writes the text for a generalized value. + + The value. + + + + Writes the text for a collection value, + starting at a particular point, to a max length + + The collection containing elements to write. + The starting point of the elements to write + The maximum number of elements to write + + + + Abstract method to get the max line length + + + + + Static methods used in creating messages + + + + + Static string used when strings are clipped + + + + + Returns the representation of a type as used in NUnitLite. + This is the same as Type.ToString() except for arrays, + which are displayed with their declared sizes. + + + + + + + Converts any control characters in a string + to their escaped representation. + + The string to be converted + The converted string + + + + Return the a string representation for a set of indices into an array + + Array of indices for which a string is needed + + + + Get an array of indices representing the point in a collection or + array corresponding to a single int index into the collection. + + The collection to which the indices apply + Index in the collection + Array of indices + + + + Clip a string to a given length, starting at a particular offset, returning the clipped + string with ellipses representing the removed parts + + The string to be clipped + The maximum permitted length of the result string + The point at which to start clipping + The clipped string + + + + Clip the expected and actual strings in a coordinated fashion, + so that they may be displayed together. + + + + + + + + + Shows the position two strings start to differ. Comparison + starts at the start index. + + The expected string + The actual string + The index in the strings at which comparison should start + Boolean indicating whether case should be ignored + -1 if no mismatch found, or the index where mismatch found + + + + The Numerics class contains common operations on numeric values. + + + + + Checks the type of the object, returning true if + the object is a numeric type. + + The object to check + true if the object is a numeric type + + + + Checks the type of the object, returning true if + the object is a floating point numeric type. + + The object to check + true if the object is a floating point numeric type + + + + Checks the type of the object, returning true if + the object is a fixed point numeric type. + + The object to check + true if the object is a fixed point numeric type + + + + Test two numeric values for equality, performing the usual numeric + conversions and using a provided or default tolerance. If the tolerance + provided is Empty, this method may set it to a default tolerance. + + The expected value + The actual value + A reference to the tolerance in effect + True if the values are equal + + + + Compare two numeric values, performing the usual numeric conversions. + + The expected value + The actual value + The relationship of the values to each other + + + + NUnitComparer encapsulates NUnit's default behavior + in comparing two objects. + + + + + Compares two objects + + + + + + + + Returns the default NUnitComparer. + + + + + NUnitEqualityComparer encapsulates NUnit's handling of + equality tests between objects. + + + + + If true, all string comparisons will ignore case + + + + + If true, arrays will be treated as collections, allowing + those of different dimensions to be compared + + + + + If non-zero, equality comparisons within the specified + tolerance will succeed. + + + + + Comparison object used in comparisons for some constraints. + + + + + Compares two objects for equality. + + + + + Helper method to compare two arrays + + + + + Method to compare two DirectoryInfo objects + + first directory to compare + second directory to compare + true if equivalent, false if not + + + + Returns the default NUnitEqualityComparer + + + + + Gets and sets a flag indicating whether case should + be ignored in determining equality. + + + + + Gets and sets a flag indicating that arrays should be + compared as collections, without regard to their shape. + + + + + Gets and sets an external comparer to be used to + test for equality. It is applied to members of + collections, in place of NUnit's own logic. + + + + + Gets and sets a tolerance used to compare objects of + certin types. + + + + + Gets the list of failure points for the last Match performed. + + + + + PathConstraint serves as the abstract base of constraints + that operate on paths and provides several helper methods. + + + + + The expected path used in the constraint + + + + + The actual path being tested + + + + + Flag indicating whether a caseInsensitive comparison should be made + + + + + Construct a PathConstraint for a give expected path + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Returns true if the expected path and actual path match + + + + + Returns the string representation of this constraint + + + + + Canonicalize the provided path + + + The path in standardized form + + + + Test whether two paths are the same + + The first path + The second path + Indicates whether case should be ignored + + + + + Test whether one path is under another path + + The first path - supposed to be the parent path + The second path - supposed to be the child path + Indicates whether case should be ignored + + + + + Test whether one path is the same as or under another path + + The first path - supposed to be the parent path + The second path - supposed to be the child path + + + + + Modifies the current instance to be case-insensitve + and returns it. + + + + + Modifies the current instance to be case-sensitve + and returns it. + + + + + Summary description for SamePathConstraint. + + + + + Initializes a new instance of the class. + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The expected path + The actual path + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + SubPathConstraint tests that the actual path is under the expected path + + + + + Initializes a new instance of the class. + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The expected path + The actual path + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + SamePathOrUnderConstraint tests that one path is under another + + + + + Initializes a new instance of the class. + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The expected path + The actual path + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Predicate constraint wraps a Predicate in a constraint, + returning success if the predicate is true. + + + + + Construct a PredicateConstraint from a predicate + + + + + Determines whether the predicate succeeds when applied + to the actual value. + + + + + Writes the description to a MessageWriter + + + + + NotConstraint negates the effect of some other constraint + + + + + Initializes a new instance of the class. + + The base constraint to be negated. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for if the base constraint fails, false if it succeeds + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a MessageWriter. + + The writer on which the actual value is displayed + + + + AllItemsConstraint applies another constraint to each + item in a collection, succeeding if they all succeed. + + + + + Construct an AllItemsConstraint on top of an existing constraint + + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + SomeItemsConstraint applies another constraint to each + item in a collection, succeeding if any of them succeeds. + + + + + Construct a SomeItemsConstraint on top of an existing constraint + + + + + + Apply the item constraint to each item in the collection, + succeeding if any item succeeds. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + NoItemConstraint applies another constraint to each + item in a collection, failing if any of them succeeds. + + + + + Construct a SomeItemsConstraint on top of an existing constraint + + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + PropertyExistsConstraint tests that a named property + exists on the object provided through Match. + + Originally, PropertyConstraint provided this feature + in addition to making optional tests on the vaue + of the property. The two constraints are now separate. + + + + + Initializes a new instance of the class. + + The name of the property. + + + + Test whether the property exists for a given object + + The object to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. + + The writer on which the actual value is displayed + + + + Returns the string representation of the constraint. + + + + + + PropertyConstraint extracts a named property and uses + its value as the actual value for a chained constraint. + + + + + Initializes a new instance of the class. + + The name. + The constraint to apply to the property. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation of the constraint. + + + + + + RangeConstraint tests whethe two values are within a + specified range. + + + + + Initializes a new instance of the class. + + From. + To. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Modifies the constraint to use an IComparer and returns self. + + + + + Modifies the constraint to use an IComparer<T> and returns self. + + + + + Modifies the constraint to use a Comparison<T> and returns self. + + + + + ResolvableConstraintExpression is used to represent a compound + constraint being constructed at a point where the last operator + may either terminate the expression or may have additional + qualifying constraints added to it. + + It is used, for example, for a Property element or for + an Exception element, either of which may be optionally + followed by constraints that apply to the property or + exception. + + + + + Create a new instance of ResolvableConstraintExpression + + + + + Create a new instance of ResolvableConstraintExpression, + passing in a pre-populated ConstraintBuilder. + + + + + Resolve the current expression to a Constraint + + + + + Appends an And Operator to the expression + + + + + Appends an Or operator to the expression. + + + + + ReusableConstraint wraps a resolved constraint so that it + may be saved and reused as needed. + + + + + Construct a ReusableConstraint + + The constraint or expression to be reused + + + + Conversion operator from a normal constraint to a ReusableConstraint. + + The original constraint to be wrapped as a ReusableConstraint + + + + + Returns the string representation of the constraint. + + A string representing the constraint + + + + Resolves the ReusableConstraint by returning the constraint + that it originally wrapped. + + A resolved constraint + + + + SameAsConstraint tests whether an object is identical to + the object passed to its constructor + + + + + Initializes a new instance of the class. + + The expected object. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + BinarySerializableConstraint tests whether + an object is serializable in binary format. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation + + + + + BinarySerializableConstraint tests whether + an object is serializable in binary format. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation of this constraint + + + + + StringConstraint is the abstract base for constraints + that operate on strings. It supports the IgnoreCase + modifier for string operations. + + + + + The expected value + + + + + Indicates whether tests should be case-insensitive + + + + + Constructs a StringConstraint given an expected value + + The expected value + + + + Modify the constraint to ignore case in matching. + + + + + EmptyStringConstraint tests whether a string is empty. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + NullEmptyStringConstraint tests whether a string is either null or empty. + + + + + Constructs a new NullOrEmptyStringConstraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + SubstringConstraint can test whether a string contains + the expected substring. + + + + + Initializes a new instance of the class. + + The expected. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + StartsWithConstraint can test whether a string starts + with an expected substring. + + + + + Initializes a new instance of the class. + + The expected string + + + + Test whether the constraint is matched by the actual value. + This is a template method, which calls the IsMatch method + of the derived class. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + EndsWithConstraint can test whether a string ends + with an expected substring. + + + + + Initializes a new instance of the class. + + The expected string + + + + Test whether the constraint is matched by the actual value. + This is a template method, which calls the IsMatch method + of the derived class. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + RegexConstraint can test whether a string matches + the pattern provided. + + + + + Initializes a new instance of the class. + + The pattern. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + ThrowsConstraint is used to test the exception thrown by + a delegate by applying a constraint to it. + + + + + Initializes a new instance of the class, + using a constraint to be applied to the exception. + + A constraint to apply to the caught exception. + + + + Executes the code of the delegate and captures any exception. + If a non-null base constraint was provided, it applies that + constraint to the exception. + + A delegate representing the code to be tested + True if an exception is thrown and the constraint succeeds, otherwise false + + + + Converts an ActualValueDelegate to a TestDelegate + before calling the primary overload. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation of this constraint + + + + + Get the actual exception thrown - used by Assert.Throws. + + + + + ThrowsNothingConstraint tests that a delegate does not + throw an exception. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True if no exception is thrown, otherwise false + + + + Converts an ActualValueDelegate to a TestDelegate + before calling the primary overload. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Modes in which the tolerance value for a comparison can + be interpreted. + + + + + The tolerance was created with a value, without specifying + how the value would be used. This is used to prevent setting + the mode more than once and is generally changed to Linear + upon execution of the test. + + + + + The tolerance is used as a numeric range within which + two compared values are considered to be equal. + + + + + Interprets the tolerance as the percentage by which + the two compared values my deviate from each other. + + + + + Compares two values based in their distance in + representable numbers. + + + + + The Tolerance class generalizes the notion of a tolerance + within which an equality test succeeds. Normally, it is + used with numeric types, but it can be used with any + type that supports taking a difference between two + objects and comparing that difference to a value. + + + + + Constructs a linear tolerance of a specdified amount + + + + + Constructs a tolerance given an amount and ToleranceMode + + + + + Tests that the current Tolerance is linear with a + numeric value, throwing an exception if it is not. + + + + + Returns an empty Tolerance object, equivalent to + specifying an exact match. + + + + + Gets the ToleranceMode for the current Tolerance + + + + + Gets the value of the current Tolerance instance. + + + + + Returns a new tolerance, using the current amount as a percentage. + + + + + Returns a new tolerance, using the current amount in Ulps. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of days. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of hours. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of minutes. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of seconds. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of milliseconds. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of clock ticks. + + + + + Returns true if the current tolerance is empty. + + + + + TypeConstraint is the abstract base for constraints + that take a Type as their expected value. + + + + + The expected Type used by the constraint + + + + + Construct a TypeConstraint for a given Type + + + + + + Write the actual value for a failing constraint test to a + MessageWriter. TypeConstraints override this method to write + the name of the type. + + The writer on which the actual value is displayed + + + + ExactTypeConstraint is used to test that an object + is of the exact type provided in the constructor + + + + + Construct an ExactTypeConstraint for a given Type + + The expected Type. + + + + Test that an object is of the exact type specified + + The actual value. + True if the tested object is of the exact type provided, otherwise false. + + + + Write the description of this constraint to a MessageWriter + + The MessageWriter to use + + + + InstanceOfTypeConstraint is used to test that an object + is of the same type provided or derived from it. + + + + + Construct an InstanceOfTypeConstraint for the type provided + + The expected Type + + + + Test whether an object is of the specified type or a derived type + + The object to be tested + True if the object is of the provided type or derives from it, otherwise false. + + + + Write a description of this constraint to a MessageWriter + + The MessageWriter to use + + + + AssignableFromConstraint is used to test that an object + can be assigned from a given Type. + + + + + Construct an AssignableFromConstraint for the type provided + + + + + + Test whether an object can be assigned from the specified type + + The object to be tested + True if the object can be assigned a value of the expected Type, otherwise false. + + + + Write a description of this constraint to a MessageWriter + + The MessageWriter to use + + + + AssignableToConstraint is used to test that an object + can be assigned to a given Type. + + + + + Construct an AssignableToConstraint for the type provided + + + + + + Test whether an object can be assigned to the specified type + + The object to be tested + True if the object can be assigned a value of the expected Type, otherwise false. + + + + Write a description of this constraint to a MessageWriter + + The MessageWriter to use + + + + Thrown when an assertion failed. + + + + + The error message that explains + the reason for the exception + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when a test executes inconclusively. + + + + + The error message that explains + the reason for the exception + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Delegate used by tests that execute code and + capture any thrown exception. + + + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + + + We don't actually want any instances of this object, but some people + like to inherit from it to add other static methods. Hence, the + protected constructor disallows any instances of this object. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Helper for Assert.AreEqual(double expected, double actual, ...) + allowing code generation to work consistently. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Throws a with the message and arguments + that are passed in. This allows a test to be cut short, with a result + of success returned to NUnit. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws a with the message and arguments + that are passed in. This allows a test to be cut short, with a result + of success returned to NUnit. + + The message to initialize the with. + + + + Throws a with the message and arguments + that are passed in. This allows a test to be cut short, with a result + of success returned to NUnit. + + + + + Throws an with the message and arguments + that are passed in. This is used by the other Assert functions. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws an with the message that is + passed in. This is used by the other Assert functions. + + The message to initialize the with. + + + + Throws an . + This is used by the other Assert functions. + + + + + Throws an with the message and arguments + that are passed in. This causes the test to be reported as ignored. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws an with the message that is + passed in. This causes the test to be reported as ignored. + + The message to initialize the with. + + + + Throws an . + This causes the test to be reported as ignored. + + + + + Throws an with the message and arguments + that are passed in. This causes the test to be reported as inconclusive. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws an with the message that is + passed in. This causes the test to be reported as inconclusive. + + The message to initialize the with. + + + + Throws an . + This causes the test to be reported as Inconclusive. + + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A ThrowsConstraint used in the test + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestSnippet delegate + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestSnippet delegate + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + + + + Verifies that a delegate does not throw an exception + + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate does not throw an exception. + + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate does not throw an exception. + + A TestSnippet delegate + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + + + + Assert that a string is empty - that is equal to string.Empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is empty - that is equal to string.Empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is empty - that is equal to string.Empty + + The string to be tested + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing ICollection + + + + Assert that a string is not empty - that is not equal to string.Empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is not empty - that is not equal to string.Empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is not empty - that is not equal to string.Empty + + The string to be tested + + + + Assert that an array, list or other collection is not empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that an array, list or other collection is not empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + + + + Assert that an array, list or other collection is not empty + + An array, list or other collection implementing ICollection + + + + Assert that a string is either null or equal to string.Empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is either null or equal to string.Empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is either null or equal to string.Empty + + The string to be tested + + + + Assert that a string is not null or empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is not null or empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is not null or empty + + The string to be tested + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + + + + Verifies that two objects are equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are not equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two objects are equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are not equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + + + + Verifies that two objects are equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are not equal an is thrown. + + The value that is expected + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two objects are not equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two objects are not equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + + + + Verifies that two objects are not equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are equal an is thrown. + + The value that is expected + The actual value + + + + Asserts that two objects refer to the same object. If they + are not the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that two objects refer to the same object. If they + are not the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + + + + Asserts that two objects refer to the same object. If they + are not the same an is thrown. + + The expected object + The actual object + + + + Asserts that two objects do not refer to the same object. If they + are the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that two objects do not refer to the same object. If they + are the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + + + + Asserts that two objects do not refer to the same object. If they + are the same an is thrown. + + The expected object + The actual object + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Asserts that an object is contained in a list. + + The expected object + The list to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is contained in a list. + + The expected object + The list to be examined + The message to display in case of failure + + + + Asserts that an object is contained in a list. + + The expected object + The list to be examined + + + + Gets the number of assertions executed so far and + resets the counter to zero. + + + + + AssertionHelper is an optional base class for user tests, + allowing the use of shorter names for constraints and + asserts and avoiding conflict with the definition of + , from which it inherits much of its + behavior, in certain mock object frameworks. + + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to + . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to + . + + The evaluated condition + The message to display if the condition is false + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to . + + The evaluated condition + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A ThrowsConstraint used in the test + + + + Returns a ListMapper based on a collection. + + The original collection + + + + + Provides static methods to express the assumptions + that must be met for a test to give a meaningful + result. If an assumption is not met, the test + should produce an inconclusive result. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + + + + Asserts that a condition is true. If the condition is false the + method throws an . + + The evaluated condition + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A ThrowsConstraint used in the test + + + + A set of Assert methods operationg on one or more collections + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Asserts that all items contained in collection are of the type specified by expectedType. + + IEnumerable containing objects to be considered + System.Type that all objects in collection must be instances of + + + + Asserts that all items contained in collection are of the type specified by expectedType. + + IEnumerable containing objects to be considered + System.Type that all objects in collection must be instances of + The message that will be displayed on failure + + + + Asserts that all items contained in collection are of the type specified by expectedType. + + IEnumerable containing objects to be considered + System.Type that all objects in collection must be instances of + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that all items contained in collection are not equal to null. + + IEnumerable containing objects to be considered + + + + Asserts that all items contained in collection are not equal to null. + + IEnumerable containing objects to be considered + The message that will be displayed on failure + + + + Asserts that all items contained in collection are not equal to null. + + IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Ensures that every object contained in collection exists within the collection + once and only once. + + IEnumerable of objects to be considered + + + + Ensures that every object contained in collection exists within the collection + once and only once. + + IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Ensures that every object contained in collection exists within the collection + once and only once. + + IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are not exactly equal. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are not exactly equal. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + + + + Asserts that expected and actual are not exactly equal. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are not exactly equal. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + + + + Asserts that expected and actual are not exactly equal. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are not exactly equal. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are not equivalent. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are not equivalent. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are not equivalent. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that collection contains actual as an item. + + IEnumerable of objects to be considered + Object to be found within collection + + + + Asserts that collection contains actual as an item. + + IEnumerable of objects to be considered + Object to be found within collection + The message that will be displayed on failure + + + + Asserts that collection contains actual as an item. + + IEnumerable of objects to be considered + Object to be found within collection + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that collection does not contain actual as an item. + + IEnumerable of objects to be considered + Object that cannot exist within collection + + + + Asserts that collection does not contain actual as an item. + + IEnumerable of objects to be considered + Object that cannot exist within collection + The message that will be displayed on failure + + + + Asserts that collection does not contain actual as an item. + + IEnumerable of objects to be considered + Object that cannot exist within collection + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that superset is not a subject of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that superset is not a subject of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + + + + Asserts that superset is not a subject of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that superset is a subset of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that superset is a subset of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + + + + Asserts that superset is a subset of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + + + + Assert that an array,list or other collection is empty + + An array, list or other collection implementing IEnumerable + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + + + + Assert that an array,list or other collection is empty + + An array, list or other collection implementing IEnumerable + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + A custom comparer to perform the comparisons + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + A custom comparer to perform the comparisons + The message to be displayed on failure + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + A custom comparer to perform the comparisons + + + + Static helper class used in the constraint-based syntax + + + + + Creates a new SubstringConstraint + + The value of the substring + A SubstringConstraint + + + + Creates a new CollectionContainsConstraint. + + The item that should be found. + A new CollectionContainsConstraint + + + + Summary description for DirectoryAssert + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + We don't actually want any instances of this object, but some people + like to inherit from it to add other static methods. Hence, the + protected constructor disallows any instances of this object. + + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are not equal + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are equal + Arguments to be used in formatting the message + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are equal + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Summary description for FileAssert. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + We don't actually want any instances of this object, but some people + like to inherit from it to add other static methods. Hence, the + protected constructor disallows any instances of this object. + + + + + Verifies that two Streams are equal. Two Streams are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The expected Stream + The actual Stream + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Verifies that two Streams are equal. Two Streams are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The expected Stream + The actual Stream + The message to display if objects are not equal + + + + Verifies that two Streams are equal. Two Streams are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The expected Stream + The actual Stream + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if objects are not equal + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A file containing the value that is expected + A file containing the actual value + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if objects are not equal + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + + + + Asserts that two Streams are not equal. If they are equal + an is thrown. + + The expected Stream + The actual Stream + The message to be displayed when the two Stream are the same. + Arguments to be used in formatting the message + + + + Asserts that two Streams are not equal. If they are equal + an is thrown. + + The expected Stream + The actual Stream + The message to be displayed when the Streams are the same. + + + + Asserts that two Streams are not equal. If they are equal + an is thrown. + + The expected Stream + The actual Stream + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if objects are not equal + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + A file containing the value that is expected + A file containing the actual value + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if objects are not equal + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + + + + GlobalSettings is a place for setting default values used + by the framework in performing asserts. + + + + + Default tolerance for floating point equality + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + Interface implemented by a user fixture in order to + validate any expected exceptions. It is only called + for test methods marked with the ExpectedException + attribute. + + + + + Method to handle an expected exception + + The exception to be handled + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + The Iz class is a synonym for Is intended for use in VB, + which regards Is as a keyword. + + + + + The List class is a helper class with properties and methods + that supply a number of constraints used with lists and collections. + + + + + List.Map returns a ListMapper, which can be used to map + the original collection to another collection. + + + + + + + ListMapper is used to transform a collection used as an actual argument + producing another collection to be used in the assertion. + + + + + Construct a ListMapper based on a collection + + The collection to be transformed + + + + Produces a collection containing all the values of a property + + The collection of property values + + + + + Randomizer returns a set of random values in a repeatable + way, to allow re-running of tests if necessary. + + + + + Get a randomizer for a particular member, returning + one that has already been created if it exists. + This ensures that the same values are generated + each time the tests are reloaded. + + + + + Get a randomizer for a particular parameter, returning + one that has already been created if it exists. + This ensures that the same values are generated + each time the tests are reloaded. + + + + + Construct a randomizer using a random seed + + + + + Construct a randomizer using a specified seed + + + + + Return an array of random doubles between 0.0 and 1.0. + + + + + + + Return an array of random doubles with values in a specified range. + + + + + Return an array of random ints with values in a specified range. + + + + + Get a random seed for use in creating a randomizer. + + + + + The SpecialValue enum is used to represent TestCase arguments + that cannot be used as arguments to an Attribute. + + + + + Null represents a null value, which cannot be used as an + argument to an attriute under .NET 1.x + + + + + Basic Asserts on strings. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + + + + Asserts that a string is not found within another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + + + + Asserts that two strings are not equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that two strings are Notequal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + + + + Asserts that two strings are not equal, without regard to case. + + The expected string + The actual string + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + The message to display in case of failure + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + The message to display in case of failure + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + + + + The TestCaseData class represents a set of arguments + and other parameter info to be used for a parameterized + test case. It provides a number of instance modifiers + for use in initializing the test case. + + Note: Instance modifiers are getters that return + the same instance after modifying it's state. + + + + + The argument list to be provided to the test + + + + + The expected result to be returned + + + + + The expected exception Type + + + + + The FullName of the expected exception + + + + + The name to be used for the test + + + + + The description of the test + + + + + A dictionary of properties, used to add information + to tests without requiring the class to change. + + + + + If true, indicates that the test case is to be ignored + + + + + The reason for ignoring a test case + + + + + Initializes a new instance of the class. + + The arguments. + + + + Initializes a new instance of the class. + + The argument. + + + + Initializes a new instance of the class. + + The first argument. + The second argument. + + + + Initializes a new instance of the class. + + The first argument. + The second argument. + The third argument. + + + + Sets the expected result for the test + + The expected result + A modified TestCaseData + + + + Sets the expected exception type for the test + + Type of the expected exception. + The modified TestCaseData instance + + + + Sets the expected exception type for the test + + FullName of the expected exception. + The modified TestCaseData instance + + + + Sets the name of the test case + + The modified TestCaseData instance + + + + Sets the description for the test case + being constructed. + + The description. + The modified TestCaseData instance. + + + + Applies a category to the test + + + + + + + Applies a named property to the test + + + + + + + + Applies a named property to the test + + + + + + + + Applies a named property to the test + + + + + + + + Ignores this TestCase. + + + + + + Ignores this TestCase, specifying the reason. + + The reason. + + + + + Gets the argument list to be provided to the test + + + + + Gets the expected result + + + + + Gets the expected exception Type + + + + + Gets the FullName of the expected exception + + + + + Gets the name to be used for the test + + + + + Gets the description of the test + + + + + Gets a value indicating whether this is ignored. + + true if ignored; otherwise, false. + + + + Gets the ignore reason. + + The ignore reason. + + + + Gets a list of categories associated with this test. + + + + + Gets the property dictionary for this test + + + + + Provide the context information of the current test + + + + + Constructs a TestContext using the provided context dictionary + + A context dictionary + + + + Get the current test context. This is created + as needed. The user may save the context for + use within a test, but it should not be used + outside the test for which it is created. + + + + + Gets a TestAdapter representing the currently executing test in this context. + + + + + Gets a ResultAdapter representing the current result for the test + executing in this context. + + + + + Gets the current directory for this TestContext + + + + + TestAdapter adapts a Test for consumption by + the user test code. + + + + + Constructs a TestAdapter for this context + + The context dictionary + + + + The name of the test. + + + + + The FullName of the test + + + + + The properties of the test. + + + + + ResultAdapter adapts a TestResult for consumption by + the user test code. + + + + + Construct a ResultAdapter for a context + + The context holding the result + + + + The TestState of current test. This maps to the ResultState + used in nunit.core and is subject to change in the future. + + + + + The TestStatus of current test. This enum will be used + in future versions of NUnit and so is to be preferred + to the TestState value. + + + + + The ResultState enum indicates the result of running a test + + + + + The result is inconclusive + + + + + The test was not runnable. + + + + + The test has been skipped. + + + + + The test has been ignored. + + + + + The test succeeded + + + + + The test failed + + + + + The test encountered an unexpected exception + + + + + The test was cancelled by the user + + + + + The TestStatus enum indicates the result of running a test + + + + + The test was inconclusive + + + + + The test has skipped + + + + + The test succeeded + + + + + The test failed + + + + + Helper class with static methods used to supply constraints + that operate on strings. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that fails if the actual + value matches the pattern supplied as an argument. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + TextMessageWriter writes constraint descriptions and messages + in displayable form as a text stream. It tailors the display + of individual message components to form the standard message + format of NUnit assertion failure messages. + + + + + Prefix used for the expected value line of a message + + + + + Prefix used for the actual value line of a message + + + + + Length of a message prefix + + + + + Construct a TextMessageWriter + + + + + Construct a TextMessageWriter, specifying a user message + and optional formatting arguments. + + + + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a givel + indentation level. + + The indentation level of the message + The message to be written + Any arguments used in formatting the message + + + + Display Expected and Actual lines for a constraint. This + is called by MessageWriter's default implementation of + WriteMessageTo and provides the generic two-line display. + + The constraint that failed + + + + Display Expected and Actual lines for given values. This + method may be called by constraints that need more control over + the display of actual and expected values than is provided + by the default implementation. + + The expected value + The actual value causing the failure + + + + Display Expected and Actual lines for given values, including + a tolerance value on the expected line. + + The expected value + The actual value causing the failure + The tolerance within which the test was made + + + + Display the expected and actual string values on separate lines. + If the mismatch parameter is >=0, an additional line is displayed + line containing a caret that points to the mismatch point. + + The expected string value + The actual string value + The point at which the strings don't match or -1 + If true, case is ignored in string comparisons + If true, clip the strings to fit the max line length + + + + Writes the text for a connector. + + The connector. + + + + Writes the text for a predicate. + + The predicate. + + + + Write the text for a modifier. + + The modifier. + + + + Writes the text for an expected value. + + The expected value. + + + + Writes the text for an actual value. + + The actual value. + + + + Writes the text for a generalized value. + + The value. + + + + Writes the text for a collection value, + starting at a particular point, to a max length + + The collection containing elements to write. + The starting point of the elements to write + The maximum number of elements to write + + + + Write the generic 'Expected' line for a constraint + + The constraint that failed + + + + Write the generic 'Expected' line for a given value + + The expected value + + + + Write the generic 'Expected' line for a given value + and tolerance. + + The expected value + The tolerance within which the test was made + + + + Write the generic 'Actual' line for a constraint + + The constraint for which the actual value is to be written + + + + Write the generic 'Actual' line for a given value + + The actual value causing a failure + + + + Gets or sets the maximum line length for this writer + + + + + Helper class with properties and methods that supply + constraints that operate on exceptions. + + + + + Creates a constraint specifying the exact type of exception expected + + + + + Creates a constraint specifying the exact type of exception expected + + + + + Creates a constraint specifying the type of exception expected + + + + + Creates a constraint specifying the type of exception expected + + + + + Creates a constraint specifying an expected exception + + + + + Creates a constraint specifying an exception with a given InnerException + + + + + Creates a constraint specifying an expected TargetInvocationException + + + + + Creates a constraint specifying an expected TargetInvocationException + + + + + Creates a constraint specifying an expected TargetInvocationException + + + + + Creates a constraint specifying that no exception is thrown + + + + diff --git a/packages/NUnit.2.5.10.11092/lib/nunit.mocks.dll b/packages/NUnit.2.5.10.11092/lib/nunit.mocks.dll new file mode 100644 index 0000000..6ee2c1c Binary files /dev/null and b/packages/NUnit.2.5.10.11092/lib/nunit.mocks.dll differ diff --git a/packages/NUnit.2.5.10.11092/lib/pnunit.framework.dll b/packages/NUnit.2.5.10.11092/lib/pnunit.framework.dll new file mode 100644 index 0000000..6c105d7 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/lib/pnunit.framework.dll differ diff --git a/packages/NUnit.2.5.10.11092/license.txt b/packages/NUnit.2.5.10.11092/license.txt new file mode 100644 index 0000000..ab91df4 --- /dev/null +++ b/packages/NUnit.2.5.10.11092/license.txt @@ -0,0 +1,15 @@ +Copyright © 2002-2008 Charlie Poole +Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov +Copyright © 2000-2002 Philip A. Craig + +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required. + +Portions Copyright © 2002-2008 Charlie Poole or Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig + +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. diff --git a/packages/NUnit.2.5.10.11092/tools/NUnitTests.VisualState.xml b/packages/NUnit.2.5.10.11092/tools/NUnitTests.VisualState.xml new file mode 100644 index 0000000..603cda7 --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/NUnitTests.VisualState.xml @@ -0,0 +1,124 @@ + + + [0-1000]D:\Dev\NUnit\nunit-2.5\work\build\net\2.0\release\NUnitTests.nunit + [0-1000]D:\Dev\NUnit\nunit-2.5\work\build\net\2.0\release\NUnitTests.nunit + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/NUnit.2.5.10.11092/tools/NUnitTests.config b/packages/NUnit.2.5.10.11092/tools/NUnitTests.config new file mode 100644 index 0000000..9487c07 --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/NUnitTests.config @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/NUnit.2.5.10.11092/tools/NUnitTests.nunit b/packages/NUnit.2.5.10.11092/tools/NUnitTests.nunit new file mode 100644 index 0000000..bb80dd6 --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/NUnitTests.nunit @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/packages/NUnit.2.5.10.11092/tools/agent.conf b/packages/NUnit.2.5.10.11092/tools/agent.conf new file mode 100644 index 0000000..b4cf550 --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/agent.conf @@ -0,0 +1,4 @@ + + 8080 + . + \ No newline at end of file diff --git a/packages/NUnit.2.5.10.11092/tools/agent.log.conf b/packages/NUnit.2.5.10.11092/tools/agent.log.conf new file mode 100644 index 0000000..d340cad --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/agent.log.conf @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/packages/NUnit.2.5.10.11092/tools/launcher.log.conf b/packages/NUnit.2.5.10.11092/tools/launcher.log.conf new file mode 100644 index 0000000..d340cad --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/launcher.log.conf @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/packages/NUnit.2.5.10.11092/tools/lib/Failure.png b/packages/NUnit.2.5.10.11092/tools/lib/Failure.png new file mode 100644 index 0000000..2e400b2 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/Failure.png differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/Ignored.png b/packages/NUnit.2.5.10.11092/tools/lib/Ignored.png new file mode 100644 index 0000000..478efbf Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/Ignored.png differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/Inconclusive.png b/packages/NUnit.2.5.10.11092/tools/lib/Inconclusive.png new file mode 100644 index 0000000..4807b7c Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/Inconclusive.png differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/Skipped.png b/packages/NUnit.2.5.10.11092/tools/lib/Skipped.png new file mode 100644 index 0000000..7c9fc64 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/Skipped.png differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/Success.png b/packages/NUnit.2.5.10.11092/tools/lib/Success.png new file mode 100644 index 0000000..2a30150 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/Success.png differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/fit.dll b/packages/NUnit.2.5.10.11092/tools/lib/fit.dll new file mode 100644 index 0000000..40bbef0 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/fit.dll differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/log4net.dll b/packages/NUnit.2.5.10.11092/tools/lib/log4net.dll new file mode 100644 index 0000000..20a2e1c Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/log4net.dll differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/nunit-console-runner.dll b/packages/NUnit.2.5.10.11092/tools/lib/nunit-console-runner.dll new file mode 100644 index 0000000..1709ce7 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/nunit-console-runner.dll differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/nunit-gui-runner.dll b/packages/NUnit.2.5.10.11092/tools/lib/nunit-gui-runner.dll new file mode 100644 index 0000000..35efa73 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/nunit-gui-runner.dll differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.dll b/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.dll new file mode 100644 index 0000000..a1dd698 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.dll differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.interfaces.dll b/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.interfaces.dll new file mode 100644 index 0000000..0ac8788 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.interfaces.dll differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/nunit.fixtures.dll b/packages/NUnit.2.5.10.11092/tools/lib/nunit.fixtures.dll new file mode 100644 index 0000000..8fd1932 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/nunit.fixtures.dll differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/nunit.uiexception.dll b/packages/NUnit.2.5.10.11092/tools/lib/nunit.uiexception.dll new file mode 100644 index 0000000..610c170 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/nunit.uiexception.dll differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/nunit.uikit.dll b/packages/NUnit.2.5.10.11092/tools/lib/nunit.uikit.dll new file mode 100644 index 0000000..9087db2 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/nunit.uikit.dll differ diff --git a/packages/NUnit.2.5.10.11092/tools/lib/nunit.util.dll b/packages/NUnit.2.5.10.11092/tools/lib/nunit.util.dll new file mode 100644 index 0000000..0b315c2 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/lib/nunit.util.dll differ diff --git a/packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe b/packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe new file mode 100644 index 0000000..ebcee1b Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe differ diff --git a/packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe.config b/packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe.config new file mode 100644 index 0000000..84c2906 --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe.config @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/NUnit.2.5.10.11092/tools/nunit-agent.exe b/packages/NUnit.2.5.10.11092/tools/nunit-agent.exe new file mode 100644 index 0000000..ec41f32 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/nunit-agent.exe differ diff --git a/packages/NUnit.2.5.10.11092/tools/nunit-agent.exe.config b/packages/NUnit.2.5.10.11092/tools/nunit-agent.exe.config new file mode 100644 index 0000000..84c2906 --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/nunit-agent.exe.config @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe b/packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe new file mode 100644 index 0000000..e08ac9c Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe differ diff --git a/packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe.config b/packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe.config new file mode 100644 index 0000000..ce92b5b --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe.config @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/NUnit.2.5.10.11092/tools/nunit-console.exe b/packages/NUnit.2.5.10.11092/tools/nunit-console.exe new file mode 100644 index 0000000..1544a9d Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/nunit-console.exe differ diff --git a/packages/NUnit.2.5.10.11092/tools/nunit-console.exe.config b/packages/NUnit.2.5.10.11092/tools/nunit-console.exe.config new file mode 100644 index 0000000..ce92b5b --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/nunit-console.exe.config @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/NUnit.2.5.10.11092/tools/nunit-x86.exe b/packages/NUnit.2.5.10.11092/tools/nunit-x86.exe new file mode 100644 index 0000000..fd342c0 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/nunit-x86.exe differ diff --git a/packages/NUnit.2.5.10.11092/tools/nunit-x86.exe.config b/packages/NUnit.2.5.10.11092/tools/nunit-x86.exe.config new file mode 100644 index 0000000..6c0320e --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/nunit-x86.exe.config @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/NUnit.2.5.10.11092/tools/nunit.exe b/packages/NUnit.2.5.10.11092/tools/nunit.exe new file mode 100644 index 0000000..ad8b08a Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/nunit.exe differ diff --git a/packages/NUnit.2.5.10.11092/tools/nunit.exe.config b/packages/NUnit.2.5.10.11092/tools/nunit.exe.config new file mode 100644 index 0000000..6c0320e --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/nunit.exe.config @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/NUnit.2.5.10.11092/tools/nunit.framework.dll b/packages/NUnit.2.5.10.11092/tools/nunit.framework.dll new file mode 100644 index 0000000..6856e51 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/nunit.framework.dll differ diff --git a/packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe b/packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe new file mode 100644 index 0000000..7a555e1 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe differ diff --git a/packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe.config b/packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe.config new file mode 100644 index 0000000..5ed5f7b --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe.config @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe b/packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe new file mode 100644 index 0000000..c70e58e Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe differ diff --git a/packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe.config b/packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe.config new file mode 100644 index 0000000..5ed5f7b --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe.config @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/NUnit.2.5.10.11092/tools/pnunit.framework.dll b/packages/NUnit.2.5.10.11092/tools/pnunit.framework.dll new file mode 100644 index 0000000..6c105d7 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/pnunit.framework.dll differ diff --git a/packages/NUnit.2.5.10.11092/tools/pnunit.tests.dll b/packages/NUnit.2.5.10.11092/tools/pnunit.tests.dll new file mode 100644 index 0000000..dce018a Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/pnunit.tests.dll differ diff --git a/packages/NUnit.2.5.10.11092/tools/runFile.exe b/packages/NUnit.2.5.10.11092/tools/runFile.exe new file mode 100644 index 0000000..a794458 Binary files /dev/null and b/packages/NUnit.2.5.10.11092/tools/runFile.exe differ diff --git a/packages/NUnit.2.5.10.11092/tools/runFile.exe.config b/packages/NUnit.2.5.10.11092/tools/runFile.exe.config new file mode 100644 index 0000000..35909b4 --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/runFile.exe.config @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/NUnit.2.5.10.11092/tools/runpnunit.bat b/packages/NUnit.2.5.10.11092/tools/runpnunit.bat new file mode 100644 index 0000000..6efc8b4 --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/runpnunit.bat @@ -0,0 +1,2 @@ +start pnunit-agent agent.conf +pnunit-launcher test.conf \ No newline at end of file diff --git a/packages/NUnit.2.5.10.11092/tools/test.conf b/packages/NUnit.2.5.10.11092/tools/test.conf new file mode 100644 index 0000000..a35e718 --- /dev/null +++ b/packages/NUnit.2.5.10.11092/tools/test.conf @@ -0,0 +1,24 @@ + + + + + Testing + + + Testing + pnunit.tests.dll + TestLibraries.Testing.EqualTo19 + localhost:8080 + + ..\server + + + + + + + + + + + \ No newline at end of file diff --git a/packages/jQuery.1.5.1/Content/Scripts/jquery-1.5.1.js b/packages/jQuery.1.5.1/Content/Scripts/jquery-1.5.1.js new file mode 100644 index 0000000..5948d8c --- /dev/null +++ b/packages/jQuery.1.5.1/Content/Scripts/jquery-1.5.1.js @@ -0,0 +1,8325 @@ +/*! +* Note: While Microsoft is not the author of this file, Microsoft is +* offering you a license subject to the terms of the Microsoft Software +* License Terms for Microsoft ASP.NET Model View Controller 3. +* Microsoft reserves all other rights. The notices below are provided +* for informational purposes only and are not the license terms under +* which Microsoft distributed this file. +* +* jQuery JavaScript Library v1.5.1 +* http://jquery.com/ +* Copyright 2011, John Resig +* +* Includes Sizzle.js +* http://sizzlejs.com/ +* Copyright 2011, The Dojo Foundation +* +* Date: Thu Nov 11 19:04:53 2010 -0500 +*/ +(function( window, undefined ) { + +// Use the correct document accordingly with window argument (sandbox) +var document = window.document; +var jQuery = (function() { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + + // Used for trimming whitespace + trimLeft = /^\s+/, + trimRight = /\s+$/, + + // Check for digits + rdigit = /\d/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + + // Useragent RegExp + rwebkit = /(webkit)[ \/]([\w.]+)/, + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, + rmsie = /(msie) ([\w.]+)/, + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // Has the ready events already been bound? + readyBound = false, + + // The deferred used on DOM ready + readyList, + + // Promise methods + promiseMethods = "then done fail isResolved isRejected promise".split( " " ), + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + constructor: jQuery, + init: function( selector, context, rootjQuery ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context && document.body ) { + this.context = document; + this[0] = document.body; + this.selector = "body"; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + doc = (context ? context.ownerDocument || context : document); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); + selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return (context || rootjQuery).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if (selector.selector !== undefined) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.5.1", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this[ this.length + num ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = this.constructor(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + (this.selector ? " " : "") + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // Add the callback + readyList.done( fn ); + + return this; + }, + + eq: function( i ) { + return i === -1 ? + this.slice( i ) : + this.slice( i, +i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + // A third-party is pushing the ready event forwards + if ( wait === true ) { + jQuery.readyWait--; + } + + // Make sure that the DOM is not already loaded + if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).unbind( "ready" ); + } + } + }, + + bindReady: function() { + if ( readyBound ) { + return; + } + + readyBound = true; + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 1 ); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent("onreadystatechange", DOMContentLoaded); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + // A crude way of determining if an object is a window + isWindow: function( obj ) { + return obj && typeof obj === "object" && "setInterval" in obj; + }, + + isNaN: function( obj ) { + return obj == null || !rdigit.test( obj ) || isNaN( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw msg; + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test(data.replace(rvalidescape, "@") + .replace(rvalidtokens, "]") + .replace(rvalidbraces, "")) ) { + + // Try to use the native JSON parser first + return window.JSON && window.JSON.parse ? + window.JSON.parse( data ) : + (new Function("return " + data))(); + + } else { + jQuery.error( "Invalid JSON: " + data ); + } + }, + + // Cross-browser xml parsing + // (xml & tmp used internally) + parseXML: function( data , xml , tmp ) { + + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + + tmp = xml.documentElement; + + if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) { + jQuery.error( "Invalid XML: " + data ); + } + + return xml; + }, + + noop: function() {}, + + // Evalulates a script in a global context + globalEval: function( data ) { + if ( data && rnotwhite.test(data) ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement, + script = document.createElement( "script" ); + + if ( jQuery.support.scriptEval() ) { + script.appendChild( document.createTextNode( data ) ); + } else { + script.text = data; + } + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction(object); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} + } + } + + return object; + }, + + // Use native String.trim function wherever possible + trim: trim ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + var type = jQuery.type(array); + + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, + j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = [], retVal; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var ret = [], value; + + // Go through the array, translating each of the items to their + // new value (or values). + for ( var i = 0, length = elems.length; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + // Flatten any nested arrays + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + proxy: function( fn, proxy, thisObject ) { + if ( arguments.length === 2 ) { + if ( typeof proxy === "string" ) { + thisObject = fn; + fn = thisObject[ proxy ]; + proxy = undefined; + + } else if ( proxy && !jQuery.isFunction( proxy ) ) { + thisObject = proxy; + proxy = undefined; + } + } + + if ( !proxy && fn ) { + proxy = function() { + return fn.apply( thisObject || this, arguments ); + }; + } + + // Set the guid of unique handler to the same of original handler, so it can be removed + if ( fn ) { + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + } + + // So proxy can be declared as an argument + return proxy; + }, + + // Mutifunctional method to get and set values to a collection + // The value/s can be optionally by executed if its a function + access: function( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + jQuery.access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; + }, + + now: function() { + return (new Date()).getTime(); + }, + + // Create a simple deferred (one callbacks list) + _Deferred: function() { + var // callbacks list + callbacks = [], + // stored [ context , args ] + fired, + // to avoid firing when already doing so + firing, + // flag to know if the deferred has been cancelled + cancelled, + // the deferred itself + deferred = { + + // done( f1, f2, ...) + done: function() { + if ( !cancelled ) { + var args = arguments, + i, + length, + elem, + type, + _fired; + if ( fired ) { + _fired = fired; + fired = 0; + } + for ( i = 0, length = args.length; i < length; i++ ) { + elem = args[ i ]; + type = jQuery.type( elem ); + if ( type === "array" ) { + deferred.done.apply( deferred, elem ); + } else if ( type === "function" ) { + callbacks.push( elem ); + } + } + if ( _fired ) { + deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] ); + } + } + return this; + }, + + // resolve with given context and args + resolveWith: function( context, args ) { + if ( !cancelled && !fired && !firing ) { + firing = 1; + try { + while( callbacks[ 0 ] ) { + callbacks.shift().apply( context, args ); + } + } + // We have to add a catch block for + // IE prior to 8 or else the finally + // block will never get executed + catch (e) { + throw e; + } + finally { + fired = [ context, args ]; + firing = 0; + } + } + return this; + }, + + // resolve with this as context and given arguments + resolve: function() { + deferred.resolveWith( jQuery.isFunction( this.promise ) ? this.promise() : this, arguments ); + return this; + }, + + // Has this deferred been resolved? + isResolved: function() { + return !!( firing || fired ); + }, + + // Cancel + cancel: function() { + cancelled = 1; + callbacks = []; + return this; + } + }; + + return deferred; + }, + + // Full fledged deferred (two callbacks list) + Deferred: function( func ) { + var deferred = jQuery._Deferred(), + failDeferred = jQuery._Deferred(), + promise; + // Add errorDeferred methods, then and promise + jQuery.extend( deferred, { + then: function( doneCallbacks, failCallbacks ) { + deferred.done( doneCallbacks ).fail( failCallbacks ); + return this; + }, + fail: failDeferred.done, + rejectWith: failDeferred.resolveWith, + reject: failDeferred.resolve, + isRejected: failDeferred.isResolved, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + if ( obj == null ) { + if ( promise ) { + return promise; + } + promise = obj = {}; + } + var i = promiseMethods.length; + while( i-- ) { + obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ]; + } + return obj; + } + } ); + // Make sure only one callback list will be used + deferred.done( failDeferred.cancel ).fail( deferred.cancel ); + // Unexpose cancel + delete deferred.cancel; + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + return deferred; + }, + + // Deferred helper + when: function( object ) { + var lastIndex = arguments.length, + deferred = lastIndex <= 1 && object && jQuery.isFunction( object.promise ) ? + object : + jQuery.Deferred(), + promise = deferred.promise(); + + if ( lastIndex > 1 ) { + var array = slice.call( arguments, 0 ), + count = lastIndex, + iCallback = function( index ) { + return function( value ) { + array[ index ] = arguments.length > 1 ? slice.call( arguments, 0 ) : value; + if ( !( --count ) ) { + deferred.resolveWith( promise, array ); + } + }; + }; + while( ( lastIndex-- ) ) { + object = array[ lastIndex ]; + if ( object && jQuery.isFunction( object.promise ) ) { + object.promise().then( iCallback(lastIndex), deferred.reject ); + } else { + --count; + } + } + if ( !count ) { + deferred.resolveWith( promise, array ); + } + } else if ( deferred !== object ) { + deferred.resolve( object ); + } + return promise; + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + sub: function() { + function jQuerySubclass( selector, context ) { + return new jQuerySubclass.fn.init( selector, context ); + } + jQuery.extend( true, jQuerySubclass, this ); + jQuerySubclass.superclass = this; + jQuerySubclass.fn = jQuerySubclass.prototype = this(); + jQuerySubclass.fn.constructor = jQuerySubclass; + jQuerySubclass.subclass = this.subclass; + jQuerySubclass.fn.init = function init( selector, context ) { + if ( context && context instanceof jQuery && !(context instanceof jQuerySubclass) ) { + context = jQuerySubclass(context); + } + + return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass ); + }; + jQuerySubclass.fn.init.prototype = jQuerySubclass.fn; + var rootjQuerySubclass = jQuerySubclass(document); + return jQuerySubclass; + }, + + browser: {} +}); + +// Create readyList deferred +readyList = jQuery._Deferred(); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +if ( indexOf ) { + jQuery.inArray = function( elem, array ) { + return indexOf.call( array, elem ); + }; +} + +// IE doesn't match non-breaking spaces with \s +if ( rnotwhite.test( "\xA0" ) ) { + trimLeft = /^[\s\xA0]+/; + trimRight = /[\s\xA0]+$/; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch(e) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +// Expose jQuery to the global object +return jQuery; + +})(); + + +(function() { + + jQuery.support = {}; + + var div = document.createElement("div"); + + div.style.display = "none"; + div.innerHTML = "
a"; + + var all = div.getElementsByTagName("*"), + a = div.getElementsByTagName("a")[0], + select = document.createElement("select"), + opt = select.appendChild( document.createElement("option") ), + input = div.getElementsByTagName("input")[0]; + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return; + } + + jQuery.support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: div.firstChild.nodeType === 3, + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText insted) + style: /red/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: a.getAttribute("href") === "/a", + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55$/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: input.value === "on", + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Will be defined later + deleteExpando: true, + optDisabled: false, + checkClone: false, + noCloneEvent: true, + noCloneChecked: true, + boxModel: null, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableHiddenOffsets: true + }; + + input.checked = true; + jQuery.support.noCloneChecked = input.cloneNode( true ).checked; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as diabled) + select.disabled = true; + jQuery.support.optDisabled = !opt.disabled; + + var _scriptEval = null; + jQuery.support.scriptEval = function() { + if ( _scriptEval === null ) { + var root = document.documentElement, + script = document.createElement("script"), + id = "script" + jQuery.now(); + + try { + script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); + } catch(e) {} + + root.insertBefore( script, root.firstChild ); + + // Make sure that the execution of code works by injecting a script + // tag with appendChild/createTextNode + // (IE doesn't support this, fails, and uses .text instead) + if ( window[ id ] ) { + _scriptEval = true; + delete window[ id ]; + } else { + _scriptEval = false; + } + + root.removeChild( script ); + // release memory in IE + root = script = id = null; + } + + return _scriptEval; + }; + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete div.test; + + } catch(e) { + jQuery.support.deleteExpando = false; + } + + if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { + div.attachEvent("onclick", function click() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + jQuery.support.noCloneEvent = false; + div.detachEvent("onclick", click); + }); + div.cloneNode(true).fireEvent("onclick"); + } + + div = document.createElement("div"); + div.innerHTML = ""; + + var fragment = document.createDocumentFragment(); + fragment.appendChild( div.firstChild ); + + // WebKit doesn't clone checked state correctly in fragments + jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; + + // Figure out if the W3C box model works as expected + // document.body must exist before we can do this + jQuery(function() { + var div = document.createElement("div"), + body = document.getElementsByTagName("body")[0]; + + // Frameset documents with no body should not run this code + if ( !body ) { + return; + } + + div.style.width = div.style.paddingLeft = "1px"; + body.appendChild( div ); + jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + + if ( "zoom" in div.style ) { + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + // (IE < 8 does this) + div.style.display = "inline"; + div.style.zoom = 1; + jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2; + + // Check if elements with layout shrink-wrap their children + // (IE 6 does this) + div.style.display = ""; + div.innerHTML = "
"; + jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; + } + + div.innerHTML = "
t
"; + var tds = div.getElementsByTagName("td"); + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0; + + tds[0].style.display = ""; + tds[1].style.display = "none"; + + // Check if empty table cells still have offsetWidth/Height + // (IE < 8 fail this test) + jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0; + div.innerHTML = ""; + + body.removeChild( div ).style.display = "none"; + div = tds = null; + }); + + // Technique from Juriy Zaytsev + // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ + var eventSupported = function( eventName ) { + var el = document.createElement("div"); + eventName = "on" + eventName; + + // We only care about the case where non-standard event systems + // are used, namely in IE. Short-circuiting here helps us to + // avoid an eval call (in setAttribute) which can cause CSP + // to go haywire. See: https://developer.mozilla.org/en/Security/CSP + if ( !el.attachEvent ) { + return true; + } + + var isSupported = (eventName in el); + if ( !isSupported ) { + el.setAttribute(eventName, "return;"); + isSupported = typeof el[eventName] === "function"; + } + el = null; + + return isSupported; + }; + + jQuery.support.submitBubbles = eventSupported("submit"); + jQuery.support.changeBubbles = eventSupported("change"); + + // release memory in IE + div = all = a = null; +})(); + + + +var rbrace = /^(?:\{.*\}|\[.*\])$/; + +jQuery.extend({ + cache: {}, + + // Please use with caution + uuid: 0, + + // Unique for each copy of jQuery on the page + // Non-digits removed to match rinlinejQuery + expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache, + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + elem[ jQuery.expando ] = id = ++jQuery.uuid; + } else { + id = jQuery.expando; + } + } + + if ( !cache[ id ] ) { + cache[ id ] = {}; + + // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery + // metadata on plain JS objects when the object is serialized using + // JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name); + } else { + cache[ id ] = jQuery.extend(cache[ id ], name); + } + } + + thisCache = cache[ id ]; + + // Internal jQuery data is stored in a separate object inside the object's data + // cache in order to avoid key collisions between internal data and user-defined + // data + if ( pvt ) { + if ( !thisCache[ internalKey ] ) { + thisCache[ internalKey ] = {}; + } + + thisCache = thisCache[ internalKey ]; + } + + if ( data !== undefined ) { + thisCache[ name ] = data; + } + + // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should + // not attempt to inspect the internal events object using jQuery.data, as this + // internal data object is undocumented and subject to change. + if ( name === "events" && !thisCache[name] ) { + return thisCache[ internalKey ] && thisCache[ internalKey ].events; + } + + return getByName ? thisCache[ name ] : thisCache; + }, + + removeData: function( elem, name, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var internalKey = jQuery.expando, isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + + // See jQuery.data for more information + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; + + if ( thisCache ) { + delete thisCache[ name ]; + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( !isEmptyDataObject(thisCache) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( pvt ) { + delete cache[ id ][ internalKey ]; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject(cache[ id ]) ) { + return; + } + } + + var internalCache = cache[ id ][ internalKey ]; + + // Browsers that fail expando deletion also refuse to delete expandos on + // the window, but it will allow it on all other JS objects; other browsers + // don't care + if ( jQuery.support.deleteExpando || cache != window ) { + delete cache[ id ]; + } else { + cache[ id ] = null; + } + + // We destroyed the entire user cache at once because it's faster than + // iterating through each key, but we need to continue to persist internal + // data if it existed + if ( internalCache ) { + cache[ id ] = {}; + // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery + // metadata on plain JS objects when the object is serialized using + // JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + + cache[ id ][ internalKey ] = internalCache; + + // Otherwise, we need to eliminate the expando on the node to avoid + // false lookups in the cache for entries that no longer exist + } else if ( isNode ) { + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( jQuery.support.deleteExpando ) { + delete elem[ jQuery.expando ]; + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + } else { + elem[ jQuery.expando ] = null; + } + } + }, + + // For internal use only. + _data: function( elem, name, data ) { + return jQuery.data( elem, name, data, true ); + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + if ( elem.nodeName ) { + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + + if ( match ) { + return !(match === true || elem.getAttribute("classid") !== match); + } + } + + return true; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var data = null; + + if ( typeof key === "undefined" ) { + if ( this.length ) { + data = jQuery.data( this[0] ); + + if ( this[0].nodeType === 1 ) { + var attr = this[0].attributes, name; + for ( var i = 0, l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( name.indexOf( "data-" ) === 0 ) { + name = name.substr( 5 ); + dataAttr( this[0], name, data[ name ] ); + } + } + } + } + + return data; + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + // Try to fetch any internally stored data first + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + data = dataAttr( this[0], key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + + } else { + return this.each(function() { + var $this = jQuery( this ), + args = [ parts[0], value ]; + + $this.triggerHandler( "setData" + parts[1] + "!", args ); + jQuery.data( this, key, value ); + $this.triggerHandler( "changeData" + parts[1] + "!", args ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + data = elem.getAttribute( "data-" + key ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + !jQuery.isNaN( data ) ? parseFloat( data ) : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON +// property to be considered empty objects; this property always exists in +// order to make sure JSON.stringify does not expose internal metadata +function isEmptyDataObject( obj ) { + for ( var name in obj ) { + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} + + + + +jQuery.extend({ + queue: function( elem, type, data ) { + if ( !elem ) { + return; + } + + type = (type || "fx") + "queue"; + var q = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( !data ) { + return q || []; + } + + if ( !q || jQuery.isArray(data) ) { + q = jQuery._data( elem, type, jQuery.makeArray(data) ); + + } else { + q.push( data ); + } + + return q; + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + fn = queue.shift(); + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift("inprogress"); + } + + fn.call(elem, function() { + jQuery.dequeue(elem, type); + }); + } + + if ( !queue.length ) { + jQuery.removeData( elem, type + "queue", true ); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function( i ) { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; + type = type || "fx"; + + return this.queue( type, function() { + var elem = this; + setTimeout(function() { + jQuery.dequeue( elem, type ); + }, time ); + }); + }, + + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + } +}); + + + + +var rclass = /[\n\t\r]/g, + rspaces = /\s+/, + rreturn = /\r/g, + rspecialurl = /^(?:href|src|style)$/, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea)?$/i, + rradiocheck = /^(?:radio|checkbox)$/i; + +jQuery.props = { + "for": "htmlFor", + "class": "className", + readonly: "readOnly", + maxlength: "maxLength", + cellspacing: "cellSpacing", + rowspan: "rowSpan", + colspan: "colSpan", + tabindex: "tabIndex", + usemap: "useMap", + frameborder: "frameBorder" +}; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name, fn ) { + return this.each(function(){ + jQuery.attr( this, name, "" ); + if ( this.nodeType === 1 ) { + this.removeAttribute( name ); + } + }); + }, + + addClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.addClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( value && typeof value === "string" ) { + var classNames = (value || "").split( rspaces ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className ) { + elem.className = value; + + } else { + var className = " " + elem.className + " ", + setClass = elem.className; + + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { + setClass += " " + classNames[c]; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.removeClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + var classNames = (value || "").split( rspaces ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + var className = (" " + elem.className + " ").replace(rclass, " "); + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[c] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( rspaces ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " "; + for ( var i = 0, l = this.length; i < l; i++ ) { + if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + if ( !arguments.length ) { + var elem = this[0]; + + if ( elem ) { + if ( jQuery.nodeName( elem, "option" ) ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + // Fixes Bug #2551 -- select.val() broken in IE after form.reset() + if ( one && !values.length && options.length ) { + return jQuery( options[ index ] ).val(); + } + + return values; + } + + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { + return elem.getAttribute("value") === null ? "on" : elem.value; + } + + // Everything else, we just grab the value + return (elem.value || "").replace(rreturn, ""); + + } + + return undefined; + } + + var isFunction = jQuery.isFunction(value); + + return this.each(function(i) { + var self = jQuery(this), val = value; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call(this, i, self.val()); + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray(val) ) { + val = jQuery.map(val, function (value) { + return value == null ? "" : value + ""; + }); + } + + if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { + this.checked = jQuery.inArray( self.val(), val ) >= 0; + + } else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(val); + + jQuery( "option", this ).each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + this.selectedIndex = -1; + } + + } else { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || elem.nodeType === 2 ) { + return undefined; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery(elem)[name](value); + } + + var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), + // Whether we are setting (or getting) + set = value !== undefined; + + // Try to normalize/fix the name + name = notxml && jQuery.props[ name ] || name; + + // Only do all the following if this is a node (faster for style) + if ( elem.nodeType === 1 ) { + // These attributes require special treatment + var special = rspecialurl.test( name ); + + // Safari mis-reports the default selected property of an option + // Accessing the parent's selectedIndex property fixes it + if ( name === "selected" && !jQuery.support.optSelected ) { + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + + // If applicable, access the attribute via the DOM 0 way + // 'in' checks fail in Blackberry 4.7 #6931 + if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) { + if ( set ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } + + if ( value === null ) { + if ( elem.nodeType === 1 ) { + elem.removeAttribute( name ); + } + + } else { + elem[ name ] = value; + } + } + + // browsers index elements by id/name on forms, give priority to attributes. + if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { + return elem.getAttributeNode( name ).nodeValue; + } + + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + if ( name === "tabIndex" ) { + var attributeNode = elem.getAttributeNode( "tabIndex" ); + + return attributeNode && attributeNode.specified ? + attributeNode.value : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + + return elem[ name ]; + } + + if ( !jQuery.support.style && notxml && name === "style" ) { + if ( set ) { + elem.style.cssText = "" + value; + } + + return elem.style.cssText; + } + + if ( set ) { + // convert the value to a string (all browsers do this but IE) see #1070 + elem.setAttribute( name, "" + value ); + } + + // Ensure that missing attributes return undefined + // Blackberry 4.7 returns "" from getAttribute #6938 + if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) { + return undefined; + } + + var attr = !jQuery.support.hrefNormalized && notxml && special ? + // Some attributes require a special call on IE + elem.getAttribute( name, 2 ) : + elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return attr === null ? undefined : attr; + } + // Handle everything which isn't a DOM element node + if ( set ) { + elem[ name ] = value; + } + return elem[ name ]; + } +}); + + + + +var rnamespaces = /\.(.*)$/, + rformElems = /^(?:textarea|input|select)$/i, + rperiod = /\./g, + rspace = / /g, + rescape = /[^\w\s.|`]/g, + fcleanup = function( nm ) { + return nm.replace(rescape, "\\$&"); + }; + +/* + * A number of helper functions used for managing events. + * Many of the ideas behind this code originated from + * Dean Edwards' addEvent library. + */ +jQuery.event = { + + // Bind an event to an element + // Original by Dean Edwards + add: function( elem, types, handler, data ) { + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // TODO :: Use a try/catch until it's safe to pull this out (likely 1.6) + // Minor release fix for bug #8018 + try { + // For whatever reason, IE has trouble passing the window object + // around, causing it to be cloned in the process + if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) { + elem = window; + } + } + catch ( e ) {} + + if ( handler === false ) { + handler = returnFalse; + } else if ( !handler ) { + // Fixes bug #7229. Fix recommended by jdalton + return; + } + + var handleObjIn, handleObj; + + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure + var elemData = jQuery._data( elem ); + + // If no elemData is found then we must be trying to bind to one of the + // banned noData elements + if ( !elemData ) { + return; + } + + var events = elemData.events, + eventHandle = elemData.handle; + + if ( !events ) { + elemData.events = events = {}; + } + + if ( !eventHandle ) { + elemData.handle = eventHandle = function() { + // Handle the second event of a trigger and when + // an event is called after a page has unloaded + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? + jQuery.event.handle.apply( eventHandle.elem, arguments ) : + undefined; + }; + } + + // Add elem as a property of the handle function + // This is to prevent a memory leak with non-native events in IE. + eventHandle.elem = elem; + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = types.split(" "); + + var type, i = 0, namespaces; + + while ( (type = types[ i++ ]) ) { + handleObj = handleObjIn ? + jQuery.extend({}, handleObjIn) : + { handler: handler, data: data }; + + // Namespaced event handlers + if ( type.indexOf(".") > -1 ) { + namespaces = type.split("."); + type = namespaces.shift(); + handleObj.namespace = namespaces.slice(0).sort().join("."); + + } else { + namespaces = []; + handleObj.namespace = ""; + } + + handleObj.type = type; + if ( !handleObj.guid ) { + handleObj.guid = handler.guid; + } + + // Get the current list of functions bound to this event + var handlers = events[ type ], + special = jQuery.event.special[ type ] || {}; + + // Init the event handler queue + if ( !handlers ) { + handlers = events[ type ] = []; + + // Check for a special event handler + // Only use addEventListener/attachEvent if the special + // events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add the function to the element's handler list + handlers.push( handleObj ); + + // Keep track of which events have been used, for global triggering + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, pos ) { + // don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + if ( handler === false ) { + handler = returnFalse; + } + + var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ), + events = elemData && elemData.events; + + if ( !elemData || !events ) { + return; + } + + // types is actually an event object here + if ( types && types.type ) { + handler = types.handler; + types = types.type; + } + + // Unbind all events for the element + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { + types = types || ""; + + for ( type in events ) { + jQuery.event.remove( elem, type + types ); + } + + return; + } + + // Handle multiple events separated by a space + // jQuery(...).unbind("mouseover mouseout", fn); + types = types.split(" "); + + while ( (type = types[ i++ ]) ) { + origType = type; + handleObj = null; + all = type.indexOf(".") < 0; + namespaces = []; + + if ( !all ) { + // Namespaced event handlers + namespaces = type.split("."); + type = namespaces.shift(); + + namespace = new RegExp("(^|\\.)" + + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + eventType = events[ type ]; + + if ( !eventType ) { + continue; + } + + if ( !handler ) { + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( all || namespace.test( handleObj.namespace ) ) { + jQuery.event.remove( elem, origType, handleObj.handler, j ); + eventType.splice( j--, 1 ); + } + } + + continue; + } + + special = jQuery.event.special[ type ] || {}; + + for ( j = pos || 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( handler.guid === handleObj.guid ) { + // remove the given handler for the given type + if ( all || namespace.test( handleObj.namespace ) ) { + if ( pos == null ) { + eventType.splice( j--, 1 ); + } + + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + + if ( pos != null ) { + break; + } + } + } + + // remove generic event handler if no more handlers exist + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + ret = null; + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + var handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + delete elemData.events; + delete elemData.handle; + + if ( jQuery.isEmptyObject( elemData ) ) { + jQuery.removeData( elem, undefined, true ); + } + } + }, + + // bubbling is internal + trigger: function( event, data, elem /*, bubbling */ ) { + // Event object or event type + var type = event.type || event, + bubbling = arguments[3]; + + if ( !bubbling ) { + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + jQuery.extend( jQuery.Event(type), event ) : + // Just the event type (string) + jQuery.Event(type); + + if ( type.indexOf("!") >= 0 ) { + event.type = type = type.slice(0, -1); + event.exclusive = true; + } + + // Handle a global trigger + if ( !elem ) { + // Don't bubble custom events when global (to avoid too much overhead) + event.stopPropagation(); + + // Only trigger if we've ever bound an event for it + if ( jQuery.event.global[ type ] ) { + // XXX This code smells terrible. event.js should not be directly + // inspecting the data cache + jQuery.each( jQuery.cache, function() { + // internalKey variable is just used to make it easier to find + // and potentially change this stuff later; currently it just + // points to jQuery.expando + var internalKey = jQuery.expando, + internalCache = this[ internalKey ]; + if ( internalCache && internalCache.events && internalCache.events[ type ] ) { + jQuery.event.trigger( event, data, internalCache.handle.elem ); + } + }); + } + } + + // Handle triggering a single element + + // don't do events on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + // Clean up in case it is reused + event.result = undefined; + event.target = elem; + + // Clone the incoming data, if any + data = jQuery.makeArray( data ); + data.unshift( event ); + } + + event.currentTarget = elem; + + // Trigger the event, it is assumed that "handle" is a function + var handle = jQuery._data( elem, "handle" ); + + if ( handle ) { + handle.apply( elem, data ); + } + + var parent = elem.parentNode || elem.ownerDocument; + + // Trigger an inline bound script + try { + if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { + if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { + event.result = false; + event.preventDefault(); + } + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (inlineError) {} + + if ( !event.isPropagationStopped() && parent ) { + jQuery.event.trigger( event, data, parent, true ); + + } else if ( !event.isDefaultPrevented() ) { + var old, + target = event.target, + targetType = type.replace( rnamespaces, "" ), + isClick = jQuery.nodeName( target, "a" ) && targetType === "click", + special = jQuery.event.special[ targetType ] || {}; + + if ( (!special._default || special._default.call( elem, event ) === false) && + !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { + + try { + if ( target[ targetType ] ) { + // Make sure that we don't accidentally re-trigger the onFOO events + old = target[ "on" + targetType ]; + + if ( old ) { + target[ "on" + targetType ] = null; + } + + jQuery.event.triggered = true; + target[ targetType ](); + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (triggerError) {} + + if ( old ) { + target[ "on" + targetType ] = old; + } + + jQuery.event.triggered = false; + } + } + }, + + handle: function( event ) { + var all, handlers, namespaces, namespace_re, events, + namespace_sort = [], + args = jQuery.makeArray( arguments ); + + event = args[0] = jQuery.event.fix( event || window.event ); + event.currentTarget = this; + + // Namespaced event handlers + all = event.type.indexOf(".") < 0 && !event.exclusive; + + if ( !all ) { + namespaces = event.type.split("."); + event.type = namespaces.shift(); + namespace_sort = namespaces.slice(0).sort(); + namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.namespace = event.namespace || namespace_sort.join("."); + + events = jQuery._data(this, "events"); + + handlers = (events || {})[ event.type ]; + + if ( events && handlers ) { + // Clone the handlers to prevent manipulation + handlers = handlers.slice(0); + + for ( var j = 0, l = handlers.length; j < l; j++ ) { + var handleObj = handlers[ j ]; + + // Filter the functions by class + if ( all || namespace_re.test( handleObj.namespace ) ) { + // Pass in a reference to the handler function itself + // So that we can later remove it + event.handler = handleObj.handler; + event.data = handleObj.data; + event.handleObj = handleObj; + + var ret = handleObj.handler.apply( this, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + } + + return event.result; + }, + + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // store a copy of the original event object + // and "clone" to set read-only properties + var originalEvent = event; + event = jQuery.Event( originalEvent ); + + for ( var i = this.props.length, prop; i; ) { + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary + if ( !event.target ) { + // Fixes #1925 where srcElement might not be defined either + event.target = event.srcElement || document; + } + + // check if target is a textnode (safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var doc = document.documentElement, + body = document.body; + + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Add which for key events + if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { + event.which = event.charCode != null ? event.charCode : event.keyCode; + } + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) { + event.metaKey = event.ctrlKey; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button !== undefined ) { + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + } + + return event; + }, + + // Deprecated, use jQuery.guid instead + guid: 1E8, + + // Deprecated, use jQuery.proxy instead + proxy: jQuery.proxy, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady, + teardown: jQuery.noop + }, + + live: { + add: function( handleObj ) { + jQuery.event.add( this, + liveConvert( handleObj.origType, handleObj.selector ), + jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); + }, + + remove: function( handleObj ) { + jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); + } + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } + }; + +jQuery.Event = function( src ) { + // Allow instantiation without the 'new' keyword + if ( !this.preventDefault ) { + return new jQuery.Event( src ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || + src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse; + + // Event type + } else { + this.type = src; + } + + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function( event ) { + // Check if mouse(over|out) are still within the same parent element + var parent = event.relatedTarget; + + // Firefox sometimes assigns relatedTarget a XUL element + // which we cannot access the parentNode property of + try { + + // Chrome does something similar, the parentNode property + // can be accessed but is null. + if ( parent !== document && !parent.parentNode ) { + return; + } + // Traverse up the tree + while ( parent && parent !== this ) { + parent = parent.parentNode; + } + + if ( parent !== this ) { + // set the correct event type + event.type = event.data; + + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); + } + + // assuming we've left the element since we most likely mousedover a xul element + } catch(e) { } +}, + +// In case of event delegation, we only need to rename the event.type, +// liveHandler will take care of the rest. +delegate = function( event ) { + event.type = event.data; + jQuery.event.handle.apply( this, arguments ); +}; + +// Create mouseenter and mouseleave events +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + setup: function( data ) { + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); + }, + teardown: function( data ) { + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); + } + }; +}); + +// submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function( data, namespaces ) { + if ( this.nodeName && this.nodeName.toLowerCase() !== "form" ) { + jQuery.event.add(this, "click.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { + trigger( "submit", this, arguments ); + } + }); + + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { + trigger( "submit", this, arguments ); + } + }); + + } else { + return false; + } + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialSubmit" ); + } + }; + +} + +// change delegation, happens here so we have bind. +if ( !jQuery.support.changeBubbles ) { + + var changeFilters, + + getVal = function( elem ) { + var type = elem.type, val = elem.value; + + if ( type === "radio" || type === "checkbox" ) { + val = elem.checked; + + } else if ( type === "select-multiple" ) { + val = elem.selectedIndex > -1 ? + jQuery.map( elem.options, function( elem ) { + return elem.selected; + }).join("-") : + ""; + + } else if ( elem.nodeName.toLowerCase() === "select" ) { + val = elem.selectedIndex; + } + + return val; + }, + + testChange = function testChange( e ) { + var elem = e.target, data, val; + + if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { + return; + } + + data = jQuery._data( elem, "_change_data" ); + val = getVal(elem); + + // the current data will be also retrieved by beforeactivate + if ( e.type !== "focusout" || elem.type !== "radio" ) { + jQuery._data( elem, "_change_data", val ); + } + + if ( data === undefined || val === data ) { + return; + } + + if ( data != null || val ) { + e.type = "change"; + e.liveFired = undefined; + jQuery.event.trigger( e, arguments[1], elem ); + } + }; + + jQuery.event.special.change = { + filters: { + focusout: testChange, + + beforedeactivate: testChange, + + click: function( e ) { + var elem = e.target, type = elem.type; + + if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { + testChange.call( this, e ); + } + }, + + // Change has to be called before submit + // Keydown will be called before keypress, which is used in submit-event delegation + keydown: function( e ) { + var elem = e.target, type = elem.type; + + if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || + type === "select-multiple" ) { + testChange.call( this, e ); + } + }, + + // Beforeactivate happens also before the previous element is blurred + // with this event you can't trigger a change event, but you can store + // information + beforeactivate: function( e ) { + var elem = e.target; + jQuery._data( elem, "_change_data", getVal(elem) ); + } + }, + + setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + + for ( var type in changeFilters ) { + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); + } + + return rformElems.test( this.nodeName ); + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialChange" ); + + return rformElems.test( this.nodeName ); + } + }; + + changeFilters = jQuery.event.special.change.filters; + + // Handle when the input is .focus()'d + changeFilters.focus = changeFilters.beforeactivate; +} + +function trigger( type, elem, args ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + // Don't pass args or remember liveFired; they apply to the donor event. + var event = jQuery.extend( {}, args[ 0 ] ); + event.type = type; + event.originalEvent = {}; + event.liveFired = undefined; + jQuery.event.handle.call( elem, event ); + if ( event.isDefaultPrevented() ) { + args[ 0 ].preventDefault(); + } +} + +// Create "bubbling" focus and blur events +if ( document.addEventListener ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + jQuery.event.special[ fix ] = { + setup: function() { + this.addEventListener( orig, handler, true ); + }, + teardown: function() { + this.removeEventListener( orig, handler, true ); + } + }; + + function handler( e ) { + e = jQuery.event.fix( e ); + e.type = fix; + return jQuery.event.handle.call( this, e ); + } + }); +} + +jQuery.each(["bind", "one"], function( i, name ) { + jQuery.fn[ name ] = function( type, data, fn ) { + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ name ](key, data, type[key], fn); + } + return this; + } + + if ( jQuery.isFunction( data ) || data === false ) { + fn = data; + data = undefined; + } + + var handler = name === "one" ? jQuery.proxy( fn, function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }) : fn; + + if ( type === "unload" && name !== "one" ) { + this.one( type, data, fn ); + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.add( this[i], type, handler, data ); + } + } + + return this; + }; +}); + +jQuery.fn.extend({ + unbind: function( type, fn ) { + // Handle object literals + if ( typeof type === "object" && !type.preventDefault ) { + for ( var key in type ) { + this.unbind(key, type[key]); + } + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.remove( this[i], type, fn ); + } + } + + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.live( types, data, fn, selector ); + }, + + undelegate: function( selector, types, fn ) { + if ( arguments.length === 0 ) { + return this.unbind( "live" ); + + } else { + return this.die( types, null, fn, selector ); + } + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + + triggerHandler: function( type, data ) { + if ( this[0] ) { + var event = jQuery.Event( type ); + event.preventDefault(); + event.stopPropagation(); + jQuery.event.trigger( event, data, this[0] ); + return event.result; + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, + i = 1; + + // link all the functions, so any of them can unbind this click handler + while ( i < args.length ) { + jQuery.proxy( fn, args[ i++ ] ); + } + + return this.click( jQuery.proxy( fn, function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + })); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +var liveMap = { + focus: "focusin", + blur: "focusout", + mouseenter: "mouseover", + mouseleave: "mouseout" +}; + +jQuery.each(["live", "die"], function( i, name ) { + jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { + var type, i = 0, match, namespaces, preType, + selector = origSelector || this.selector, + context = origSelector ? this : jQuery( this.context ); + + if ( typeof types === "object" && !types.preventDefault ) { + for ( var key in types ) { + context[ name ]( key, data, types[key], selector ); + } + + return this; + } + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + types = (types || "").split(" "); + + while ( (type = types[ i++ ]) != null ) { + match = rnamespaces.exec( type ); + namespaces = ""; + + if ( match ) { + namespaces = match[0]; + type = type.replace( rnamespaces, "" ); + } + + if ( type === "hover" ) { + types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); + continue; + } + + preType = type; + + if ( type === "focus" || type === "blur" ) { + types.push( liveMap[ type ] + namespaces ); + type = type + namespaces; + + } else { + type = (liveMap[ type ] || type) + namespaces; + } + + if ( name === "live" ) { + // bind live handler + for ( var j = 0, l = context.length; j < l; j++ ) { + jQuery.event.add( context[j], "live." + liveConvert( type, selector ), + { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); + } + + } else { + // unbind live handler + context.unbind( "live." + liveConvert( type, selector ), fn ); + } + } + + return this; + }; +}); + +function liveHandler( event ) { + var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, + elems = [], + selectors = [], + events = jQuery._data( this, "events" ); + + // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911) + if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) { + return; + } + + if ( event.namespace ) { + namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.liveFired = this; + + var live = events.live.slice(0); + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { + selectors.push( handleObj.selector ); + + } else { + live.splice( j--, 1 ); + } + } + + match = jQuery( event.target ).closest( selectors, event.currentTarget ); + + for ( i = 0, l = match.length; i < l; i++ ) { + close = match[i]; + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) { + elem = close.elem; + related = null; + + // Those two events require additional checking + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { + event.type = handleObj.preType; + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; + } + + if ( !related || related !== elem ) { + elems.push({ elem: elem, handleObj: handleObj, level: close.level }); + } + } + } + } + + for ( i = 0, l = elems.length; i < l; i++ ) { + match = elems[i]; + + if ( maxLevel && match.level > maxLevel ) { + break; + } + + event.currentTarget = match.elem; + event.data = match.handleObj.data; + event.handleObj = match.handleObj; + + ret = match.handleObj.origHandler.apply( match.elem, arguments ); + + if ( ret === false || event.isPropagationStopped() ) { + maxLevel = match.level; + + if ( ret === false ) { + stop = false; + } + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + + return stop; +} + +function liveConvert( type, selector ) { + return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&"); +} + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + if ( fn == null ) { + fn = data; + data = null; + } + + return arguments.length > 0 ? + this.bind( name, data, fn ) : + this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } +}); + + +/*! + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true, + rBackslash = /\\/g, + rNonWord = /\W/; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var match, + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace( rBackslash, "" ); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( "*" ) : + []; + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var found, item, + filter = Expr.filter[ type ], + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + }, + type: function( elem ) { + return elem.getAttribute( "type" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !rNonWord.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( match[1] ); + } + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace( rBackslash, "" ) + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace( rBackslash, "" ); + }, + + TAG: function( match, curLoop ) { + return match[1].replace( rBackslash, "" ).toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + if ( !match[2] ) { + Sizzle.error( match[0] ); + } + + match[2] = match[2].replace(/^\+|\s*/g, ''); + + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + else if ( match[2] ) { + Sizzle.error( match[0] ); + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1] = match[1].replace( rBackslash, "" ); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + // Handle if an un-quoted value was used + match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return "text" === elem.getAttribute( 'type' ); + }, + radio: function( elem ) { + return "radio" === elem.type; + }, + + checkbox: function( elem ) { + return "checkbox" === elem.type; + }, + + file: function( elem ) { + return "file" === elem.type; + }, + password: function( elem ) { + return "password" === elem.type; + }, + + submit: function( elem ) { + return "submit" === elem.type; + }, + + image: function( elem ) { + return "image" === elem.type; + }, + + reset: function( elem ) { + return "reset" === elem.type; + }, + + button: function( elem ) { + return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( name ); + } + }, + + CHILD: function( elem, match ) { + var type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + var first = match[2], + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // If the nodes are siblings (or identical) we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +Sizzle.getText = function( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += Sizzle.getText( elem.childNodes ); + } + } + + return ret; +}; + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(), + root = document.documentElement; + + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + + Expr.attrHandle.href = function( elem ) { + return elem.getAttribute( "href", 2 ); + }; + } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "

"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + // See if we find a selector to speed up + var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); + + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { + // Speed-up: Sizzle("TAG") + if ( match[1] ) { + return makeArray( context.getElementsByTagName( query ), extra ); + + // Speed-up: Sizzle(".CLASS") + } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { + return makeArray( context.getElementsByClassName( match[2] ), extra ); + } + } + + if ( context.nodeType === 9 ) { + // Speed-up: Sizzle("body") + // The body element only exists once, optimize finding it + if ( query === "body" && context.body ) { + return makeArray( [ context.body ], extra ); + + // Speed-up: Sizzle("#ID") + } else if ( match && match[3] ) { + var elem = context.getElementById( match[3] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id === match[3] ) { + return makeArray( [ elem ], extra ); + } + + } else { + return makeArray( [], extra ); + } + } + + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var oldContext = context, + old = context.getAttribute( "id" ), + nid = old || id, + hasParent = context.parentNode, + relativeHierarchySelector = /^\s*[+~]/.test( query ); + + if ( !old ) { + context.setAttribute( "id", nid ); + } else { + nid = nid.replace( /'/g, "\\$&" ); + } + if ( relativeHierarchySelector && hasParent ) { + context = context.parentNode; + } + + try { + if ( !relativeHierarchySelector || hasParent ) { + return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); + } + + } catch(pseudoError) { + } finally { + if ( !old ) { + oldContext.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector, + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + if ( matches ) { + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + return matches.call( node, expr ); + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})(); + + +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + isSimple = /^.[^:#\[\.,]*$/, + slice = Array.prototype.slice, + POS = jQuery.expr.match.POS, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend({ + find: function( selector ) { + var ret = this.pushStack( "", "find", selector ), + length = 0; + + for ( var i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( var n = length; n < ret.length; n++ ) { + for ( var r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && jQuery.filter( selector, this ).length > 0; + }, + + closest: function( selectors, context ) { + var ret = [], i, l, cur = this[0]; + + if ( jQuery.isArray( selectors ) ) { + var match, selector, + matches = {}, + level = 1; + + if ( cur && selectors.length ) { + for ( i = 0, l = selectors.length; i < l; i++ ) { + selector = selectors[i]; + + if ( !matches[selector] ) { + matches[selector] = jQuery.expr.match.POS.test( selector ) ? + jQuery( selector, context || this.context ) : + selector; + } + } + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( selector in matches ) { + match = matches[selector]; + + if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { + ret.push({ selector: selector, elem: cur, level: level }); + } + } + + cur = cur.parentNode; + level++; + } + } + + return ret; + } + + var pos = POS.test( selectors ) ? + jQuery( selectors, context || this.context ) : null; + + for ( i = 0, l = this.length; i < l; i++ ) { + cur = this[i]; + + while ( cur ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + + } else { + cur = cur.parentNode; + if ( !cur || !cur.ownerDocument || cur === context ) { + break; + } + } + } + } + + ret = ret.length > 1 ? jQuery.unique(ret) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + if ( !elem || typeof elem === "string" ) { + return jQuery.inArray( this[0], + // If it receives a string, the selector is used + // If it receives nothing, the siblings are used + elem ? jQuery( elem ) : this.parent().children() ); + } + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context ) : + jQuery.makeArray( selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ), + // The variable 'args' was introduced in + // https://github.com/jquery/jquery/commit/52a0238 + // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed. + // http://code.google.com/p/v8/issues/detail?id=1050 + args = slice.call(arguments); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, args.join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return (elem === qualifier) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return (jQuery.inArray( elem, qualifier ) >= 0) === keep; + }); +} + + + + +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rtagName = /<([\w:]+)/, + rtbody = /", "" ], + legend: [ 1, "
", "
" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + col: [ 2, "", "
" ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and